fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / svtools / treelistentry.hxx
blobdfea2651eb0e2a43c5235987929551adbfd89f0b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef __SVTOOLS_TREELISTENTRY_HXX__
21 #define __SVTOOLS_TREELISTENTRY_HXX__
23 #include "svtdllapi.h"
24 #include "tools/solar.h"
25 #include "treelistbox.hxx"
26 #include "treelistentries.hxx"
28 #include <boost/ptr_container/ptr_vector.hpp>
30 // Flags, die am Model haengen
31 #define SV_ENTRYFLAG_CHILDREN_ON_DEMAND 0x0001
32 #define SV_ENTRYFLAG_DISABLE_DROP 0x0002
33 #define SV_ENTRYFLAG_IN_USE 0x0004
34 // wird gesetzt, wenn RequestingChildren keine Children gestzt hat
35 #define SV_ENTRYFLAG_NO_NODEBMP 0x0008
36 // Eintrag hatte oder hat Kinder
37 #define SV_ENTRYFLAG_HAD_CHILDREN 0x0010
39 #define SV_ENTRYFLAG_USER_FLAGS 0xF000
40 #define SV_ENTRYFLAG_SEMITRANSPARENT 0x8000 // draw semi-transparent entry bitmaps
43 class SVT_DLLPUBLIC SvTreeListEntry
45 friend class SvTreeList;
46 friend class SvListView;
47 friend class SvTreeListBox;
49 typedef boost::ptr_vector<SvLBoxItem> ItemsType;
51 SvTreeListEntry* pParent;
52 SvTreeListEntries maChildren;
53 sal_uLong nAbsPos;
54 sal_uLong nListPos;
55 ItemsType maItems;
56 void* pUserData;
57 sal_uInt16 nEntryFlags;
59 private:
60 void ClearChildren();
61 void SetListPositions();
62 void InvalidateChildrensListPositions();
64 public:
65 static size_t ITEM_NOT_FOUND;
67 SvTreeListEntry();
68 SvTreeListEntry(const SvTreeListEntry& r);
69 virtual ~SvTreeListEntry();
71 bool HasChildren() const;
72 bool HasChildListPos() const;
73 sal_uLong GetChildListPos() const;
75 SvTreeListEntries& GetChildEntries();
76 const SvTreeListEntries& GetChildEntries() const;
78 void Clone(SvTreeListEntry* pSource);
80 size_t ItemCount() const;
82 // DARF NUR GERUFEN WERDEN, WENN DER EINTRAG NOCH NICHT IM MODEL
83 // EINGEFUEGT IST, DA SONST FUER DAS ITEM KEINE VIEW-ABHAENGIGEN
84 // DATEN ALLOZIERT WERDEN!
85 void AddItem( SvLBoxItem* pItem );
86 void ReplaceItem( SvLBoxItem* pNewItem, size_t nPos );
87 const SvLBoxItem* GetItem( size_t nPos ) const;
88 SvLBoxItem* GetItem( size_t nPos );
89 const SvLBoxItem* GetFirstItem( sal_uInt16 nId ) const;
90 SvLBoxItem* GetFirstItem( sal_uInt16 nId );
91 size_t GetPos( const SvLBoxItem* pItem ) const;
92 void* GetUserData() const;
93 void SetUserData( void* pPtr );
94 void EnableChildrenOnDemand( bool bEnable=true );
95 bool HasChildrenOnDemand() const;
96 bool HasInUseEmphasis() const;
98 sal_uInt16 GetFlags() const;
99 void SetFlags( sal_uInt16 nFlags );
102 #endif
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */