Line data Source code
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 : #include "svtools/viewdataentry.hxx"
21 :
22 : #include "tools/debug.hxx"
23 :
24 : // Entryflags that are attached to the View
25 : #define SVLISTENTRYFLAG_SELECTED 0x0001
26 : #define SVLISTENTRYFLAG_EXPANDED 0x0002
27 : #define SVLISTENTRYFLAG_FOCUSED 0x0004
28 : #define SVLISTENTRYFLAG_CURSORED 0x0008
29 : #define SVLISTENTRYFLAG_NOT_SELECTABLE 0x0010
30 :
31 : DBG_NAME(SvViewDataEntry);
32 :
33 0 : SvViewDataEntry::SvViewDataEntry() :
34 : nVisPos(0),
35 : mbSelected(false),
36 : mbHighlighted(false),
37 : mbExpanded(false),
38 : mbFocused(false),
39 : mbCursored(false),
40 0 : mbSelectable(true)
41 : {
42 : DBG_CTOR(SvViewDataEntry,0);
43 0 : }
44 :
45 0 : SvViewDataEntry::SvViewDataEntry( const SvViewDataEntry& rData ) :
46 : nVisPos(rData.nVisPos),
47 : mbSelected(false),
48 : mbHighlighted(false),
49 : mbExpanded(rData.mbExpanded),
50 : mbFocused(false),
51 : mbCursored(rData.mbCursored),
52 0 : mbSelectable(rData.mbSelectable)
53 : {
54 : DBG_CTOR(SvViewDataEntry,0);
55 0 : }
56 :
57 0 : SvViewDataEntry::~SvViewDataEntry()
58 : {
59 : DBG_DTOR(SvViewDataEntry,0);
60 : #ifdef DBG_UTIL
61 : nVisPos = 0x12345678;
62 : #endif
63 0 : }
64 :
65 0 : bool SvViewDataEntry::IsSelected() const
66 : {
67 0 : return mbSelected;
68 : }
69 :
70 0 : bool SvViewDataEntry::IsHighlighted() const
71 : {
72 0 : return mbHighlighted;
73 : }
74 :
75 0 : bool SvViewDataEntry::IsExpanded() const
76 : {
77 0 : return mbExpanded;
78 : }
79 :
80 0 : bool SvViewDataEntry::HasFocus() const
81 : {
82 0 : return mbFocused;
83 : }
84 :
85 0 : bool SvViewDataEntry::IsCursored() const
86 : {
87 0 : return mbCursored;
88 : }
89 :
90 0 : bool SvViewDataEntry::IsSelectable() const
91 : {
92 0 : return mbSelectable;
93 : }
94 :
95 0 : void SvViewDataEntry::SetFocus( bool bFocus )
96 : {
97 0 : mbFocused = bFocus;
98 0 : }
99 :
100 0 : void SvViewDataEntry::SetSelected( bool bSelected )
101 : {
102 0 : mbSelected = bSelected;
103 0 : mbHighlighted = bSelected;
104 0 : }
105 :
106 0 : void SvViewDataEntry::SetHighlighted( bool bHighlighted )
107 : {
108 0 : mbHighlighted = bHighlighted;
109 0 : }
110 :
111 0 : void SvViewDataEntry::SetExpanded( bool bExpanded )
112 : {
113 0 : mbExpanded = bExpanded;
114 0 : }
115 :
116 0 : void SvViewDataEntry::SetSelectable( bool bSelectable )
117 : {
118 0 : mbSelectable = bSelectable;
119 0 : }
120 :
121 0 : void SvViewDataEntry::Init(size_t nSize)
122 : {
123 0 : maItems.resize(nSize);
124 0 : }
125 :
126 0 : const SvViewDataItem* SvViewDataEntry::GetItem(size_t nPos) const
127 : {
128 0 : return &maItems[nPos];
129 : }
130 :
131 0 : SvViewDataItem* SvViewDataEntry::GetItem(size_t nPos)
132 : {
133 0 : return &maItems[nPos];
134 : }
135 :
136 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|