KDevelop API Documentation

flagboxes.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2000-2001 Bernd Gehrmann <bernd@kdevelop.org>
00003    Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef _FLAGBOXES_H_
00022 #define _FLAGBOXES_H_
00023 
00024 #include <kfile.h>
00025 
00026 #include <qlistview.h>
00027 #include <qcheckbox.h>
00028 #include <qradiobutton.h>
00029 #include <qptrlist.h>
00030 #include <qstringlist.h>
00031 
00032 class QSpinBox;
00033 class FlagListBox;
00034 class FlagListToolTip;
00035 class FlagCheckBoxController;
00036 class FlagRadioButtonController;
00037 class FlagPathEditController;
00038 class FlagEditController;
00039 class KLineEdit;
00040 class QPushButton;
00041 class KURLRequester;
00042 
00043 
00044 class FlagListItem : public QCheckListItem
00045 {
00046 public:
00047     FlagListItem(FlagListBox *parent, const QString &flagstr,
00048                  const QString &description);
00049     FlagListItem(FlagListBox *parent, const QString &flagstr,
00050                  const QString &description, const QString &offstr);
00051     ~FlagListItem()
00052         {}
00053 private:
00054     QString flag;
00055     QString off;
00056     QString desc;
00057     friend class FlagListToolTip;
00058     friend class FlagListBox;
00059 };
00060 
00061 
00062 class FlagListBox : public QListView
00063 {
00064     Q_OBJECT
00065 public:
00066     FlagListBox( QWidget *parent=0, const char *name=0 );
00067     ~FlagListBox()
00068         {}
00069 
00070     void readFlags(QStringList *list);
00071     void writeFlags(QStringList *list);
00072 };
00073 
00074 
00075 class FlagCheckBox : public QCheckBox
00076 {
00077     Q_OBJECT
00078 public:
00079     FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
00080                  const QString &flagstr, const QString &description);
00081     FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
00082                  const QString &flagstr, const QString &description,
00083                  const QString &offstr);
00084     FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
00085                  const QString &flagstr, const QString &description,
00086                  const QString &offstr, const QString &defstr);
00087     ~FlagCheckBox()
00088         {}
00089 
00090 private:
00091     QString flag;
00092     QString off;
00093     QString def;
00094     bool includeOff;
00095     bool useDef;
00096     bool defSet;
00097     friend class FlagCheckBoxController;
00098 };
00099 
00100 class FlagRadioButton : public QRadioButton
00101 {
00102     Q_OBJECT
00103 public:
00104     FlagRadioButton(QWidget *parent, FlagRadioButtonController *controller,
00105                  const QString &flagstr, const QString &description);
00106     ~FlagRadioButton()
00107         {}
00108 
00109 private:
00110     QString flag;
00111     friend class FlagRadioButtonController;
00112 };
00113 
00114 class FlagPathEdit: public QWidget
00115 {
00116     Q_OBJECT
00117 public:
00119     FlagPathEdit(QWidget *parent, QString pathDelimiter, FlagPathEditController *controller,
00120                  const QString &flagstr, const QString &description, KFile::Mode mode = KFile::Directory);
00121 
00122     ~FlagPathEdit() {}
00123 
00124     void setText(const QString text);
00125     bool isEmpty();
00126     QString text();
00127 
00128 private slots:
00129     void showPathDetails();
00130 
00131 private:
00132     KLineEdit *edit;
00133     QPushButton *details;
00134     KURLRequester *url;
00135 
00136     QString delimiter;
00137     QString flag;
00138     QString m_description;
00139     friend class FlagPathEditController;
00140 };
00141 
00142 class FlagListEdit: public QWidget
00143 {
00144     Q_OBJECT
00145 public:
00147     FlagListEdit(QWidget *parent, QString listDelimiter, FlagEditController *controller,
00148                  const QString &flagstr, const QString &description);
00149 
00150     ~FlagListEdit() {}
00151 
00152     void setText(const QString text);
00153     void appendText(const QString text);
00154     bool isEmpty();
00155     QString text();
00156     QStringList flags();
00157 
00158 private slots:
00159     void showListDetails();
00160 
00161 private:
00162     KLineEdit *edit;
00163     QPushButton *details;
00164 
00165     QString delimiter;
00166     QString flag;
00167     QString m_description;
00168     friend class FlagEditController;
00169 };
00170 
00171 class FlagSpinEdit: public QWidget
00172 {
00173 public:
00174     FlagSpinEdit(QWidget *parent, int minVal, int maxVal, int incr, int defaultVal, FlagEditController *controller,
00175                  const QString &flagstr, const QString &description);
00176     ~FlagSpinEdit() {}
00177 
00178     void setText(const QString text);
00179     QString text();
00180     bool isDefault();
00181 
00182     QString flags();
00183 
00184 private:
00185     int m_defaultVal;
00186     QString flag;
00187 
00188     QSpinBox *spb;
00189 
00190     friend class FlagEditController;
00191 };
00192 
00193 class FlagPathEditController
00194 {
00195 public:
00196     FlagPathEditController();
00197     ~FlagPathEditController();
00198 
00199     void readFlags(QStringList *list);
00200     void writeFlags(QStringList *list);
00201 
00202 private:
00203     void addPathEdit(FlagPathEdit *item);
00204     QPtrList<FlagPathEdit> plist;
00205     friend class FlagPathEdit;
00206 };
00207 
00208 class FlagEditController
00209 {
00210 public:
00211     FlagEditController();
00212     ~FlagEditController();
00213 
00214     void readFlags(QStringList *list);
00215     void writeFlags(QStringList *list);
00216 
00217 private:
00218     void addListEdit(FlagListEdit *item);
00219     void addSpinBox(FlagSpinEdit *item);
00220     QPtrList<FlagListEdit> plist;
00221     QPtrList<FlagSpinEdit>  slist;
00222     friend class FlagListEdit;
00223     friend class FlagSpinEdit;
00224 };
00225 
00226 class FlagCheckBoxController
00227 {
00228 public:
00233     FlagCheckBoxController(QStringList multiKeys = QStringList());
00234     ~FlagCheckBoxController()
00235         {}
00236 
00237     void readFlags(QStringList *list);
00238     void writeFlags(QStringList *list);
00239 
00240     void addCheckBox(FlagCheckBox *item);
00241 private:
00242     QPtrList<FlagCheckBox> cblist;
00243 
00244     QStringList m_multiKeys;
00245 };
00246 
00247 class FlagRadioButtonController
00248 {
00249 public:
00254     FlagRadioButtonController(QStringList multiKeys = QStringList());
00255     ~FlagRadioButtonController()
00256         {}
00257 
00258     void readFlags(QStringList *list);
00259     void writeFlags(QStringList *list);
00260 
00261     void addRadioButton(FlagRadioButton *item);
00262 private:
00263     QPtrList<FlagRadioButton> cblist;
00264 
00265     QStringList m_multiKeys;
00266 };
00267 
00268 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:52 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003