00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
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
00105
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