kpilot/kpilot
memoWidget.h00001 #ifndef _KPILOT_MEMOWIDGET_H
00002 #define _KPILOT_MEMOWIDGET_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 #include "pilotComponent.h"
00032
00033 class KPilotInstaller;
00034 class QListBox;
00035 class QComboBox;
00036 class QPushButton;
00037 class KTextEdit;
00038
00039 class PilotMemo;
00040 class PilotListItem;
00041
00042 class MemoWidget : public PilotComponent
00043 {
00044 Q_OBJECT
00045
00046 public:
00047 MemoWidget(QWidget* parent, const QString& dbpath);
00048 virtual ~MemoWidget();
00049
00050
00051 void showComponent();
00052 void hideComponent();
00053 bool preHotSync(QString &);
00054 void postHotSync();
00055
00056
00057 bool saveAsXML(const QString &fileName,const QPtrList<PilotListItem> &menu_item );
00058 bool saveAsText(const QString &fileName,const QPtrList<PilotListItem> &menu_item );
00059
00060 typedef enum {
00061 MAX_MEMO_LEN = 8192
00062 } Constants ;
00063
00064 protected:
00065 void initializeCategories(PilotDatabase *);
00066 void initializeMemos(PilotDatabase *);
00067
00068 void saveChangedMemo();
00069
00070 bool addMemo(const QString &text, int category);
00071
00072 public slots:
00080 void slotShowMemo(int);
00081 void slotUpdateButtons();
00082
00083 void slotImportMemo();
00084 void slotExportMemo();
00085 void slotDeleteMemo();
00086 void slotAddMemo();
00087 void slotSetCategory(int);
00088
00089 protected:
00090 void showMemo(const PilotMemo *);
00091
00092
00093 private:
00094 void setupWidget();
00095 void updateWidget();
00096 void writeMemo(PilotMemo* which);
00097
00098 class Private;
00099
00100 QComboBox* fCatList;
00101
00102 KTextEdit* fTextWidget;
00103 Private *d;
00104 QListBox* fListBox;
00105
00106 QPushButton *fExportButton,*fDeleteButton;
00107
00108 int lastSelectedMemo;
00109 };
00110
00111
00112 #endif
|