libyui
 
Loading...
Searching...
No Matches
YTree.h
1/*
2 Copyright (C) 2000-2012 Novell, Inc
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) version 3.0 of the License. This library
7 is distributed in the hope that it will be useful, but WITHOUT ANY
8 WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 License for more details. You should have received a copy of the GNU
11 Lesser General Public License along with this library; if not, write
12 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 Floor, Boston, MA 02110-1301 USA
14*/
15
16
17/*-/
18
19 File: YTree.h
20
21 Author: Stefan Hundhammer <shundhammer@suse.de>
22
23/-*/
24
25#ifndef YTree_h
26#define YTree_h
27
28#include "YSelectionWidget.h"
29
30class YTreeItem;
31class YTreePrivate;
32
33
57class YTree : public YSelectionWidget
58{
59protected:
60
65 const std::string & label,
66 bool multiSelection,
68
69public:
70
74 virtual ~YTree();
75
80 virtual const char * widgetClass() const { return "YTree"; }
81
90 virtual void rebuildTree() = 0;
91
102 virtual void addItems( const YItemCollection & itemCollection );
103
122 bool immediateMode() const;
123
127 void setImmediateMode( bool on = true );
128
139 virtual bool setProperty( const std::string & propertyName,
140 const YPropertyValue & val );
141
148 virtual YPropertyValue getProperty( const std::string & propertyName );
149
156 virtual const YPropertySet & propertySet();
157
162 const char * userInputProperty() { return YUIProperty_CurrentItem; }
163
164
168 bool hasMultiSelection() const;
169
179 virtual YTreeItem * currentItem() = 0;
180
187 virtual void activate() = 0;
188
195 YTreeItem * findItem( const std::vector<std::string> & path ) const;
196
197
198protected:
199
207 YTreeItem * findItem( std::vector<std::string>::const_iterator path_begin,
208 std::vector<std::string>::const_iterator path_end,
210 YItemConstIterator end ) const;
211
212private:
213
215};
216
217
218#endif // YTree_h
YItemCollection::const_iterator YItemConstIterator
Const iterator over YItemCollection.
Definition YItem.h:45
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
Definition YItem.h:39
Definition ImplPtr.h:43
Definition YProperty.h:198
Definition YProperty.h:105
bool recursiveSelection() const
Definition YSelectionWidget.cc:130
YSelectionWidget(YWidget *parent, const std::string &label, bool enforceSingleSelection, bool recursiveSelection=false)
Definition YSelectionWidget.cc:59
std::string label() const
Definition YSelectionWidget.cc:99
Definition YTreeItem.h:36
bool hasMultiSelection() const
Definition YTree.cc:175
virtual ~YTree()
Definition YTree.cc:64
virtual void activate()=0
virtual void addItems(const YItemCollection &itemCollection)
Definition YTree.cc:88
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition YTree.cc:155
YTree(YWidget *parent, const std::string &label, bool multiSelection, bool recursiveSelection)
Definition YTree.cc:48
virtual const char * widgetClass() const
Definition YTree.h:80
virtual void rebuildTree()=0
const char * userInputProperty()
Definition YTree.h:162
YTreeItem * findItem(std::vector< std::string >::const_iterator path_begin, std::vector< std::string >::const_iterator path_end, YItemConstIterator begin, YItemConstIterator end) const
virtual YTreeItem * currentItem()=0
bool immediateMode() const
Definition YTree.cc:71
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition YTree.cc:133
virtual const YPropertySet & propertySet()
Definition YTree.cc:96
void setImmediateMode(bool on=true)
Definition YTree.cc:78
YTreeItem * findItem(const std::vector< std::string > &path) const
YWidgetListIterator end()
Definition YWidget.h:245
YWidgetListIterator begin()
Definition YWidget.h:238
YWidget(YWidget *parent)
Definition YWidget.cc:106
YWidget * parent() const
Definition YWidget.cc:277
Definition YTree.cc:39