00001 /*************************************************************************** 00002 kguiutils.h - description 00003 ------------------- 00004 begin : Fri Jan 27 2006 00005 copyright : (C) 2006 Tony Bloomfield 00006 email : Tony Bloomfield <tonybloom@users.sourceforge.net> 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef KGUIUTILS_H 00019 #define KGUIUTILS_H 00020 00021 // ---------------------------------------------------------------------------- 00022 // QT Includes 00023 00024 #include <qobject.h> 00025 #include <qvaluelist.h> 00026 class QWidget; 00027 00028 // ---------------------------------------------------------------------------- 00029 // KDE Includes 00030 00031 #include <kpushbutton.h> 00032 #include <kcombobox.h> 00033 00034 // ---------------------------------------------------------------------------- 00035 // Project Includes 00036 00040 class kMandatoryFieldGroup : public QObject 00041 { 00042 Q_OBJECT 00043 00044 public: 00045 kMandatoryFieldGroup(QObject *parent) : 00046 QObject(parent), okButton(0), m_enabled(true) {} 00047 00053 void add(QWidget *widget); 00054 00060 void remove(QWidget *widget); 00061 00068 void setOkButton(QPushButton *button); 00069 00074 bool isEnabled(void) const { return m_enabled; } 00075 00076 public slots: 00077 void clear(void); 00078 00082 void changed(void); 00083 00084 signals: 00085 void stateChanged(void); 00086 void stateChanged(bool state); 00087 00088 private: 00089 QValueList<QWidget *> widgets; 00090 QPushButton* okButton; 00091 bool m_enabled; 00092 }; 00093 00094 #endif // KGUIUTILS_H