libyui-qt
YQCustomStatusItemSelector.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: YQCustomStatusItemSelector.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQCustomStatusItemSelector_h
27 #define YQCustomStatusItemSelector_h
28 
29 #include "YQItemSelector.h"
30 
31 
33 
34 
42 {
43  Q_OBJECT
44 
45 public:
46 
50  YQCustomStatusItemSelector( YWidget * parent,
51  const YItemCustomStatusVector & customStates );
52 
57 
63  virtual void addItem( YItem * item );
64 
70  virtual void selectItem( YItem * item, bool selected = true );
71 
75  const QIcon & statusIcon( int status ) const;
76 
82  virtual void activateItem( YItem * item );
83 
84 protected slots:
85 
90  void itemClicked( YQCustomStatusSelectorItemWidget * itemWidget );
91 
92 
93 protected:
94 
98  void preloadStatusIcons();
99 
105  virtual void updateCustomStatusIndicator( YItem * item );
106 
107 
108  // Data members
109 
110  QList<QIcon> _statusIcons;
111 
112 }; // class YQCustomStatusItemSelector
113 
114 
115 
120 {
121  Q_OBJECT
122 
123 public:
124 
129  YItem * item );
130 
135 
139  void setStatusIcon();
140 
141 signals:
142 
147  void clicked( YQCustomStatusSelectorItemWidget * itemWidget );
148 
149 protected slots:
150 
154  void slotClicked();
155 
156 protected:
157 
164  virtual QAbstractButton * createHeadingToggle( const std::string & label,
165  QWidget * parent );
166 
170  void setStatusIcon( QAbstractButton * toggle );
171 
177  virtual int itemDescriptionIndent() const;
178 
179 }; // class YQCustomStatusSelectorItemWidget
180 
181 
182 #endif // YQCustomStatusItemSelector_h
virtual void updateCustomStatusIndicator(YItem *item)
Definition: YQCustomStatusItemSelector.cc:99
void itemClicked(YQCustomStatusSelectorItemWidget *itemWidget)
Definition: YQCustomStatusItemSelector.cc:114
Definition: YQCustomStatusItemSelector.h:119
virtual void addItem(YItem *item)
Definition: YQCustomStatusItemSelector.cc:59
const QIcon & statusIcon(int status) const
Definition: YQCustomStatusItemSelector.cc:88
void clicked(YQCustomStatusSelectorItemWidget *itemWidget)
YQCustomStatusItemSelector(YWidget *parent, const YItemCustomStatusVector &customStates)
Definition: YQCustomStatusItemSelector.cc:36
virtual void activateItem(YItem *item)
Definition: YQCustomStatusItemSelector.cc:144
YQCustomStatusSelectorItemWidget(YQItemSelector *parent, YItem *item)
Definition: YQCustomStatusItemSelector.cc:158
void preloadStatusIcons()
Definition: YQCustomStatusItemSelector.cc:50
Definition: YQCustomStatusItemSelector.h:41
void setStatusIcon()
Definition: YQCustomStatusItemSelector.cc:192
void slotClicked()
Definition: YQCustomStatusItemSelector.cc:236
virtual ~YQCustomStatusSelectorItemWidget()
Definition: YQCustomStatusItemSelector.cc:166
virtual QAbstractButton * createHeadingToggle(const std::string &label, QWidget *parent)
Definition: YQCustomStatusItemSelector.cc:173
virtual ~YQCustomStatusItemSelector()
Definition: YQCustomStatusItemSelector.cc:44
Definition: YQItemSelector.h:211
virtual void selectItem(YItem *item, bool selected=true)
Definition: YQCustomStatusItemSelector.cc:80
virtual int itemDescriptionIndent() const
Definition: YQCustomStatusItemSelector.cc:220
Definition: YQItemSelector.h:42