libtdepim

kwidgetlister.h
1/*
2 kwidgetlister.h
3
4 This file is part of libtdenetwork.
5 Copyright (c) 2001 Marc Mutz <mutz@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License,
9 version 2, as published by the Free Software Foundation.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
20 In addition, as a special exception, the copyright holders give
21 permission to link the code of this library with any edition of
22 the TQt library by Trolltech AS, Norway (or with modified versions
23 of TQt that use the same license as TQt), and distribute linked
24 combinations including the two. You must obey the GNU General
25 Public License in all respects for all of the code used other than
26 TQt. If you modify this file, you may extend this exception to
27 your version of the file, but you are not obligated to do so. If
28 you do not wish to do so, delete this exception statement from
29 your version.
30*/
31
32#ifndef _KWIDGETLISTER_H_
33#define _KWIDGETLISTER_H_
34
35#include <tqwidget.h>
36#include <tqptrlist.h>
37#include <tdemacros.h>
38
39class TQPushButton;
40class TQVBoxLayout;
41class TQHBox;
42
65class TDE_EXPORT KWidgetLister : public TQWidget
66{
67 TQ_OBJECT
68
69public:
70 KWidgetLister( int minWidgets=1, int maxWidgets=8, TQWidget* parent=0, const char* name=0 );
71 virtual ~KWidgetLister();
72
73protected slots:
79 virtual void slotMore();
85 virtual void slotFewer();
91 virtual void slotClear();
92
93
94
95protected:
104 virtual void addWidgetAtEnd(TQWidget *w =0);
112 virtual void removeLastWidget();
115 virtual void clearWidget( TQWidget* );
120 virtual TQWidget* createWidget( TQWidget *parent );
124 virtual void setNumberOfShownWidgetsTo( int aNum );
128 TQPtrList<TQWidget> mWidgetList;
133
134signals:
138 void widgetAdded(TQWidget *);
143
144private:
145 void enableControls();
146
147 TQPushButton *mBtnMore, *mBtnFewer, *mBtnClear;
148 TQVBoxLayout *mLayout;
149 TQHBox *mButtonBox;
150};
151
152
153
154#endif /* _KWIDGETLISTER_H_ */
Widget that manages a list of other widgets (incl.
Definition: kwidgetlister.h:66
int mMaxWidgets
The maximum number of widgets that are to be shown on screen.
void clearWidgets()
This signal is emitted whenever the clear button is clicked.
void widgetAdded()
This signal is emitted whenever a widget was added.
void widgetAdded(TQWidget *)
This signal is emitted whenever a widget was added.
void widgetRemoved()
This signal is emitted whenever a widget was removed.
TQPtrList< TQWidget > mWidgetList
The list of widgets.
int mMinWidgets
The minimum number of widgets that are to stay on screen.