Diffstat (limited to 'examples/simple-pim/simple.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | examples/simple-pim/simple.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/examples/simple-pim/simple.h b/examples/simple-pim/simple.h index bf9ede7..2a6e8ce 100644 --- a/examples/simple-pim/simple.h +++ b/examples/simple-pim/simple.h | |||
@@ -1,95 +1,99 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | * A Simple widget with a button to quit | 3 | * A Simple widget with a button to quit |
4 | * | 4 | * |
5 | */ | 5 | */ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * The below sequence is called a guard and guards | 8 | * The below sequence is called a guard and guards |
9 | * against multiple inclusion of header files | 9 | * against multiple inclusion of header files |
10 | * NOTE: you need to use unique names among the header files | 10 | * NOTE: you need to use unique names among the header files |
11 | */ | 11 | */ |
12 | #ifndef QUIET_SIMPLE_DEMO_H | 12 | #ifndef QUIET_SIMPLE_DEMO_H |
13 | #define QUIET_SIMPLE_DEMO_H | 13 | #define QUIET_SIMPLE_DEMO_H |
14 | 14 | ||
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | #include <qmainwindow.h> // from this class we will inherit | 18 | #include <qmainwindow.h> // from this class we will inherit |
19 | #include <qlistview.h> // A ListView for our PIM records | 19 | #include <qlistview.h> // A ListView for our PIM records |
20 | 20 | ||
21 | #include <opie/otodoaccess.h> | 21 | #include <opie2/otodoaccess.h> |
22 | #include <opie/odatebookaccess.h> | 22 | #include <opie2/odatebookaccess.h> |
23 | 23 | ||
24 | class QPushButton; // forward declaration to not include the header. This can save time when compiling | 24 | class QPushButton; // forward declaration to not include the header. This can save time when compiling |
25 | class QAction; | 25 | class QAction; |
26 | class PIMListView; | 26 | class PIMListView; |
27 | class QDate; | 27 | class QDate; |
28 | class QCopChannel; | 28 | class QCopChannel; |
29 | namespace Opie{ | ||
30 | namespace Ui { | ||
29 | class OWait; | 31 | class OWait; |
30 | class OTabWidget; | 32 | class OTabWidget; |
33 | } | ||
34 | } | ||
31 | 35 | ||
32 | /* | 36 | /* |
33 | * A mainwindow is a special QWidget it helps layouting | 37 | * A mainwindow is a special QWidget it helps layouting |
34 | * toolbar, statusbar, menubar. Got dockable areas | 38 | * toolbar, statusbar, menubar. Got dockable areas |
35 | * So in one sentence it is a MainWindow :) | 39 | * So in one sentence it is a MainWindow :) |
36 | */ | 40 | */ |
37 | class MainWindow : public QMainWindow { | 41 | class MainWindow : public QMainWindow { |
38 | Q_OBJECT | 42 | Q_OBJECT |
39 | public: | 43 | public: |
40 | static QString appName() { return QString::fromLatin1("simple-pim"); } | 44 | static QString appName() { return QString::fromLatin1("simple-pim"); } |
41 | MainWindow( QWidget* parent, const char* name, WFlags fl ); | 45 | MainWindow( QWidget* parent, const char* name, WFlags fl ); |
42 | ~MainWindow(); | 46 | ~MainWindow(); |
43 | 47 | ||
44 | public slots: | 48 | public slots: |
45 | void setDocument( const QString& ); | 49 | void setDocument( const QString& ); |
46 | private slots: | 50 | private slots: |
47 | void slotDesktopReceive( const QCString&, const QByteArray& ); | 51 | void slotDesktopReceive( const QCString&, const QByteArray& ); |
48 | void slotLoad(); | 52 | void slotLoad(); |
49 | void slotLoadForDay(int, int, int ); | 53 | void slotLoadForDay(int, int, int ); |
50 | void slotLoadForDay(const QDate&); | 54 | void slotLoadForDay(const QDate&); |
51 | void slotShow(); | 55 | void slotShow(); |
52 | void slotDate(); | 56 | void slotDate(); |
53 | void slotShowRecord( const OPimRecord& ); | 57 | void slotShowRecord( const Opie::OPimRecord& ); |
54 | 58 | ||
55 | private: | 59 | private: |
56 | void initUI(); | 60 | void initUI(); |
57 | QAction *m_fire; | 61 | QAction *m_fire; |
58 | QAction *m_dateAction; | 62 | QAction *m_dateAction; |
59 | OTabWidget* m_tab; | 63 | Opie::Ui::OTabWidget* m_tab; |
60 | 64 | ||
61 | OTodoAccess m_tb; | 65 | Opie::OPimTodoAccess m_tb; |
62 | ODateBookAccess m_db; | 66 | Opie::ODateBookAccess m_db; |
63 | PIMListView *m_todoView; | 67 | PIMListView *m_todoView; |
64 | PIMListView *m_dateView; | 68 | PIMListView *m_dateView; |
65 | 69 | ||
66 | int m_synced; // a counter for synced objects.. | 70 | int m_synced; // a counter for synced objects.. |
67 | QCopChannel *m_desktopChannel; | 71 | QCopChannel *m_desktopChannel; |
68 | OWait *m_loading; | 72 | Opie::Ui::OWait *m_loading; |
69 | }; | 73 | }; |
70 | 74 | ||
71 | /* | 75 | /* |
72 | * Instead of the simple QWidgets we will design | 76 | * Instead of the simple QWidgets we will design |
73 | * a new widget based on a QListView | 77 | * a new widget based on a QListView |
74 | * it should show either Todos or EffectiveEvents | 78 | * it should show either Todos or EffectiveEvents |
75 | */ | 79 | */ |
76 | class PIMListView : public QListView { | 80 | class PIMListView : public QListView { |
77 | Q_OBJECT | 81 | Q_OBJECT |
78 | public: | 82 | public: |
79 | PIMListView( QWidget* parent, const char* name, WFlags fl= 0 ); | 83 | PIMListView( QWidget* parent, const char* name, WFlags fl= 0 ); |
80 | ~PIMListView(); | 84 | ~PIMListView(); |
81 | 85 | ||
82 | 86 | ||
83 | void set( OTodoAccess::List ); | 87 | void set( Opie::OPimTodoAccess::List ); |
84 | void set( const OEffectiveEvent::ValueList& ); | 88 | void set( const Opie::OEffectiveEvent::ValueList& ); |
85 | void showCurrentRecord(); | 89 | void showCurrentRecord(); |
86 | 90 | ||
87 | signals: | 91 | signals: |
88 | void showRecord( const OPimRecord& ); | 92 | void showRecord( const Opie::OPimRecord& ); |
89 | 93 | ||
90 | private: | 94 | private: |
91 | static QString makeString( const OEffectiveEvent& ev ); | 95 | static QString makeString( const Opie::OEffectiveEvent& ev ); |
92 | 96 | ||
93 | }; | 97 | }; |
94 | 98 | ||
95 | #endif | 99 | #endif |