libkdenetwork Library API Documentation

kwidgetlister.h

00001 /*  -*- c++ -*-
00002     kwidgetlister.h
00003 
00004     This file is part of libkdenetwork.
00005     Copyright (c) 2001 Marc Mutz <mutz@kde.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License,
00009     version 2, as published by the Free Software Foundation.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this library; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020     In addition, as a special exception, the copyright holders give
00021     permission to link the code of this library with any edition of
00022     the Qt library by Trolltech AS, Norway (or with modified versions
00023     of Qt that use the same license as Qt), and distribute linked
00024     combinations including the two.  You must obey the GNU General
00025     Public License in all respects for all of the code used other than
00026     Qt.  If you modify this file, you may extend this exception to
00027     your version of the file, but you are not obligated to do so.  If
00028     you do not wish to do so, delete this exception statement from
00029     your version.
00030 */
00031 
00032 #ifndef _KWIDGETLISTER_H_
00033 #define _KWIDGETLISTER_H_
00034 
00035 #include <qwidget.h>
00036 #include <qptrlist.h>
00037 
00038 class QPushButton;
00039 class QVBoxLayout;
00040 class QHBox;
00041 
00064 class KWidgetLister : public QWidget
00065 {
00066   Q_OBJECT
00067 public:
00068   KWidgetLister( int minWidgets=1, int maxWidgets=8, QWidget* parent=0, const char* name=0 );
00069   virtual ~KWidgetLister();
00070 
00071 protected slots:
00077   virtual void slotMore();
00083   virtual void slotFewer();
00089   virtual void slotClear();
00090 
00091 
00092 
00093 protected:
00102   virtual void addWidgetAtEnd(QWidget *w =0);
00110   virtual void removeLastWidget();
00113   virtual void clearWidget( QWidget* );
00118   virtual QWidget* createWidget( QWidget *parent );
00122   virtual void setNumberOfShownWidgetsTo( int aNum );
00126   QPtrList<QWidget> mWidgetList;
00128   int mMinWidgets;
00130   int mMaxWidgets;
00131 
00132 signals:
00134   void widgetAdded();
00136   void widgetAdded(QWidget *);
00138   void widgetRemoved();
00140   void clearWidgets();
00141 
00142 private:
00143   void enableControls();
00144 
00145   QPushButton *mBtnMore, *mBtnFewer, *mBtnClear;
00146   QVBoxLayout *mLayout;
00147   QHBox       *mButtonBox;
00148 };
00149 
00150 
00151 
00152 #endif /* _KWIDGETLISTER_H_ */
KDE Logo
This file is part of the documentation for libkdenetwork Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jan 31 15:51:51 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003