Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/toolkit/viewdataentry.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#pragma once
21
22
#if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
23
#error "don't use this in new code"
24
#endif
25
26
#include <sal/types.h>
27
#include <vector>
28
29
class SvTreeListBox;
30
31
struct SvViewDataItem
32
{
33
    int mnWidth = 0;
34
    int mnHeight = 0;
35
};
36
37
/**
38
 * View-dependent data for a tree list entry created in the virtual function
39
 * SvTreeListBox::CreateViewData(). The item array contains the same number
40
 * of items as that of the items in its corresponding tree list entry.
41
 *
42
 * When an entry is selected, it is logically selected and visually
43
 * highlighted. When an entry is only highlighted, it looks visually
44
 * highlighted, but not logically selected.
45
 */
46
class SvViewDataEntry
47
{
48
    friend class SvTreeList;
49
50
    std::vector<SvViewDataItem> maItems;
51
    sal_uInt32 nVisPos;
52
    bool mbSelected:1;
53
    bool mbHighlighted:1;
54
    bool mbExpanded:1;
55
    bool mbFocused:1;
56
    bool mbSelectable:1;
57
    bool mbDragTarget:1;
58
59
public:
60
    SvViewDataEntry();
61
    SvViewDataEntry( const SvViewDataEntry& );
62
    ~SvViewDataEntry();
63
64
0
    bool IsSelected() const { return mbSelected;}
65
0
    bool IsHighlighted() const { return mbHighlighted;}
66
0
    bool IsExpanded() const { return mbExpanded;}
67
0
    bool HasFocus() const { return mbFocused;}
68
0
    bool IsSelectable() const { return mbSelectable;}
69
0
    bool IsDragTarget() const { return mbDragTarget;}
70
    void SetFocus( bool bFocus );
71
    void SetSelected( bool bSelected );
72
    void SetExpanded( bool bExpanded );
73
    void SetSelectable( bool bSelectable );
74
    void SetDragTarget( bool bDragTarget )
75
0
    {
76
0
        mbDragTarget = bDragTarget;
77
0
    }
78
79
    void Init(size_t nSize);
80
81
    const SvViewDataItem& GetItem(size_t nPos) const;
82
    SvViewDataItem& GetItem(size_t nPos);
83
};
84
85
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */