00001 /* 00002 * Linux Advanced Business Enterprise Management System 00003 * 00004 * 00005 * File name....... : qlabcategorylist.h 00006 * File version.... : 1.2.3 00007 * Revision Date... : Wed Mar 10 2004 00008 * 00009 * File Description : Generic Category Lister 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 QLABCATEGORYLIST_H 00044 #define QLABCATEGORYLIST_H 00045 00046 #include <qvariant.h> 00047 #include <qwidgetplugin.h> 00048 #include <qlistview.h> 00049 00050 class QListViewItem ; 00051 class QSqlRecord ; 00052 00053 class QT_WIDGET_PLUGIN_EXPORT QlabCategoryList : public QListView 00054 { 00055 Q_OBJECT ; 00056 Q_PROPERTY( QString categoryType READ categoryType WRITE setCategoryType 00057 DESIGNABLE true SCRIPTABLE true STORED true ) ; 00058 Q_PROPERTY( bool showActive READ showActive WRITE setShowActive 00059 DESIGNABLE true SCRIPTABLE true STORED true ) ; 00060 00061 public: 00062 QlabCategoryList( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 00063 ~QlabCategoryList(); 00064 int currentCategory() ; 00065 00066 public slots : 00067 QString categoryType() const ; 00068 void setCategoryType( const QString & type ) ; 00069 bool showActive() const ; 00070 void setShowActive( bool act ) ; 00071 void refresh() ; 00072 bool deleteCurrent() ; 00073 void reparent( int source, int newParent ) ; 00074 QSqlRecord * create() ; 00075 QSqlRecord * update() ; 00076 uint validateChanges() ; 00077 00078 signals: 00082 void categoryIdChanged( int catid ) ; 00089 void categoryRemapped( int catid ) ; 00090 00091 protected: 00092 00093 protected slots: 00094 virtual void languageChange(); 00095 00096 private: 00097 void init(); 00098 00099 QString catType ; 00100 bool active ; 00101 bool inInit ; 00104 QSqlRecord * buffer ; 00105 int activeModule ; 00107 private slots : 00108 void categoryChanged( QListViewItem * item ) ; 00109 00110 } ; 00111 00112 #endif // QLABCATEGORYLIST_H