kpilot/kpilot
dbviewerWidget.h00001 #ifndef _KPILOT_DBVIEWERWIDGET_H
00002 #define _KPILOT_DBVIEWERWIDGET_H
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 #include "pilotComponent.h"
00034
00035 class KListBox;
00036 class KTextEdit;
00037 class KPushButton;
00038 class KComboBox;
00039 class PilotLocalDatabase;
00040 class PilotRecord;
00041 class KListView;
00042
00043 class GenericDBWidget : public PilotComponent
00044 {
00045 Q_OBJECT
00046
00047 public:
00048 GenericDBWidget(QWidget* parent, const QString& dbpath);
00049 virtual ~GenericDBWidget();
00050
00051
00052 void showComponent();
00053 void hideComponent();
00054
00055 QString getCurrentDB() const { return currentDB; }
00056 protected:
00057 void setupWidget();
00058
00059 protected slots:
00060 void slotSelected(const QString &dbname);
00061 void slotDBType(int mode);
00062 void reset();
00063 void slotAddRecord();
00064 void slotEditRecord();
00065 bool slotEditRecord(QListViewItem*);
00066 void slotDeleteRecord();
00067 void slotShowAppInfo();
00068 void slotShowDBInfo();
00069 void enableWidgets(bool enable);
00070 void writeRecord(PilotRecord*r);
00071
00072 private:
00073 KListBox*fDBList;
00074 KComboBox*fDBType;
00075 KTextEdit*fDBInfo;
00076 KPushButton*fDBInfoButton, *fAppInfoButton;
00077 KListView*fRecordList;
00078 KPushButton*fAddRecord, *fEditRecord, *fDeleteRecord;
00079
00080 enum eDBType {
00081 eDatabase,
00082 eApplication
00083 } currentDBtype;
00084
00085 PilotLocalDatabase*fDB;
00086 QString currentDB;
00087 QPtrList<PilotRecord> fRecList;
00088 };
00089
00090
00091 #endif
|