libyui
 
Loading...
Searching...
No Matches
YItemSelector.h
1/*
2 Copyright (c) [2019] SUSE LLC
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: YItemSelector.h
20
21 Author: Stefan Hundhammer <shundhammer@suse.de>
22
23/-*/
24
25#ifndef YItemSelector_h
26#define YItemSelector_h
27
28#include "YSelectionWidget.h"
29#include "YDescribedItem.h"
30#include "YItemCustomStatus.h"
31
32
34
44{
45public:
46
51 bool enforceSingleSelection = true );
52
81 const YItemCustomStatusVector & customStates );
82
86 virtual ~YItemSelector();
87
92 virtual const char * widgetClass() const;
93
101 int visibleItems() const;
102
110 virtual void setVisibleItems( int newVal );
111
118 virtual void setItemStatus( YItem * item, int status );
119
124 bool usingCustomStatus() const;
125
130 int customStatusCount() const;
131
138 const YItemCustomStatus & customStatus( int index );
139
144 bool validCustomStatusIndex( int index ) const;
145
152 int cycleCustomStatus( int oldStatus );
153
164 virtual bool setProperty( const std::string & propertyName,
165 const YPropertyValue & val );
166
173 virtual YPropertyValue getProperty( const std::string & propertyName );
174
181 virtual const YPropertySet & propertySet();
182
187 const char * userInputProperty() { return YUIProperty_Value; }
188
194 virtual void activateItem( YItem * item ) = 0;
195
196protected:
197
204 virtual void updateCustomStatusIndicator( YItem * item ) {}
205
206
207private:
208
212 void init();
213
217 void checkCustomStates();
218
219
220 // Data members
221
223
224}; // class YItemSelector
225
226#endif // YItemSelector_h
Definition ImplPtr.h:43
Definition YItemCustomStatus.h:45
virtual void setVisibleItems(int newVal)
Definition YItemSelector.cc:106
int visibleItems() const
Definition YItemSelector.cc:100
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition YItemSelector.cc:239
int customStatusCount() const
Definition YItemSelector.cc:142
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition YItemSelector.cc:260
virtual const YPropertySet & propertySet()
Definition YItemSelector.cc:209
virtual void activateItem(YItem *item)=0
int cycleCustomStatus(int oldStatus)
Definition YItemSelector.cc:196
YItemSelector(YWidget *parent, bool enforceSingleSelection=true)
Definition YItemSelector.cc:46
bool validCustomStatusIndex(int index) const
Definition YItemSelector.cc:161
virtual const char * widgetClass() const
Definition YItemSelector.cc:90
const YItemCustomStatus & customStatus(int index)
Definition YItemSelector.cc:149
virtual void setItemStatus(YItem *item, int status)
Definition YItemSelector.cc:115
virtual void updateCustomStatusIndicator(YItem *item)
Definition YItemSelector.h:204
const char * userInputProperty()
Definition YItemSelector.h:187
bool usingCustomStatus() const
Definition YItemSelector.cc:136
virtual ~YItemSelector()
Definition YItemSelector.cc:74
Definition YItem.h:56
Definition YProperty.h:198
Definition YProperty.h:105
bool enforceSingleSelection() const
Definition YSelectionWidget.cc:111
YSelectionWidget(YWidget *parent, const std::string &label, bool enforceSingleSelection, bool recursiveSelection=false)
Definition YSelectionWidget.cc:59
YWidget(YWidget *parent)
Definition YWidget.cc:106
YWidget * parent() const
Definition YWidget.cc:277
Definition YItemSelector.cc:36