00001 /* 00002 * Linux Advanced Business Enterprise Management System 00003 * 00004 * 00005 * File name....... : qlabcategorymanager.h 00006 * File version.... : 1.2.3 00007 * Revision Date... : Wed Mar 10 2004 00008 * 00009 * File Description : Generic Category Manager Widget 00010 * 00011 * Author.......... : DJ Anubis 00012 * Copyright....... : (C) 2001-2004 by DJ Anubis 00013 * Email .......... : labproject@free.fr, anubis@lab-project.net 00014 * 00015 * License : 00016 * Please read the license file in doc directory. 00017 * 1. Lab Public License. 00018 * File is Lab-Public.txt 00019 * You should have received a copy of the Lab Public License with this package. 00020 * If this is not the case, you can read it or download it at: 00021 * http://labproject.free.fr 00022 * 2. Q Public License. 00023 * File is QPL.txt 00024 * Conformant to Trolltech QPL license. 00025 * You should have received a copy of the Q Public License with this package. 00026 * If this is not the case, you can read it or download it at: 00027 * http://www.trolltech.com 00028 * 3. GNU General Public License. 00029 * File is COPYING 00030 * Reserved for free projects. 00031 * You should have received a copy of the General Public License with this package. 00032 * If this is not the case, you can read it or download it at: 00033 * http://www.trolltech.com 00034 * 4. Commercial license. 00035 * File is Lab-Commercial.txt 00036 * Recommanded if your code is not distributed under one of the 3 models above. 00037 * 00038 * Read the license FAQ in doc directory. File name is Lab-license-FAQ.txt 00039 * HTML versions are available under the License section in the manual. 00040 * 00041 */ 00042 00043 #ifndef QLABCATEGORYMANAGER_H 00044 #define QLABCATEGORYMANAGER_H 00045 00046 #include <qvariant.h> 00047 #include <qwidget.h> 00048 #include <qwidgetplugin.h> 00049 00050 class QVBoxLayout; 00051 class QHBoxLayout; 00052 class QGridLayout; 00053 class QLabel; 00054 class QlabCategoryList; 00055 class QGroupBox; 00056 class QPushButton; 00057 class QListViewItem ; 00058 00059 class QT_WIDGET_PLUGIN_EXPORT QlabCategoryManager : public QWidget 00060 { 00061 Q_OBJECT ; 00062 00063 Q_ENUMS( ActionCodes ) ; 00064 00065 Q_PROPERTY( QString type READ type WRITE setType 00066 DESIGNABLE true SCRIPTABLE true STORED true ) ; 00067 Q_PROPERTY( bool showActive READ showActive WRITE setShowActive 00068 DESIGNABLE true SCRIPTABLE true STORED true ) ; 00069 00070 public: 00071 QlabCategoryManager( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ) ; 00072 ~QlabCategoryManager() ; 00073 00080 enum ActionCodes { Selection, 00081 Creation, 00082 Modification, 00083 Inactivate, 00084 Reparent 00085 } ; 00086 00087 public slots: 00088 virtual void catChanged( int newCat ); 00089 virtual void canDelete( bool candel ); 00090 virtual QString type() const ; 00091 virtual void setType( const QString & tp ); 00092 virtual bool showActive() const ; 00093 virtual void setShowActive( bool act ); 00094 virtual void refresh(); 00095 00096 signals: 00097 void categoryChanged( int cat ); 00098 void requireDeleteAcq( int cat ); 00099 void freezeAction( bool freeze ) ; 00100 00101 protected: 00102 int state ; 00104 // Widget declarations. We don't have to deal with them. 00105 // Kept in protected state to allow inheritance. 00106 QLabel* currCat ; 00107 QlabCategoryList* categoryList ; 00108 QGroupBox* categoryGroupBox ; 00109 QPushButton* catNew ; 00110 QPushButton* catEdit ; 00111 QPushButton* catDel ; 00112 QPushButton* catReparent ; 00113 QGridLayout* QlabCategoryManagerLayout ; 00114 QHBoxLayout* categoryGroupBoxLayout ; 00115 00116 protected slots: 00117 virtual void languageChange() ; 00118 00119 private: 00120 virtual void init() ; 00121 bool delAllowed ; 00122 QListViewItem * actCat ; 00124 private slots: 00125 virtual void catAction() ; 00126 virtual void resetBtns() ; 00127 virtual void evalAction() ; 00128 virtaul void reparent() ; 00129 00130 }; 00131 00132 #endif // QLABCATEGORYMANAGER_H