Diffstat (limited to 'pwmanager/pwmanager/pwmviewstyle_1.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/pwmviewstyle_1.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/pwmviewstyle_1.h b/pwmanager/pwmanager/pwmviewstyle_1.h new file mode 100644 index 0000000..a50f587 --- a/dev/null +++ b/pwmanager/pwmanager/pwmviewstyle_1.h | |||
@@ -0,0 +1,107 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * copyright (C) 2004 by Michael Buesch * | ||
4 | * email: mbuesch@freenet.de * | ||
5 | * * | ||
6 | * This program is free software; you can redistribute it and/or modify * | ||
7 | * it under the terms of the GNU General Public License version 2 * | ||
8 | * as published by the Free Software Foundation. * | ||
9 | * * | ||
10 | ***************************************************************************/ | ||
11 | |||
12 | /*************************************************************************** | ||
13 | * copyright (C) 2004 by Ulf Schenk | ||
14 | * This file is originaly based on version 1.0.1 of pwmanager | ||
15 | * and was modified to run on embedded devices that run microkde | ||
16 | * | ||
17 | * $Id$ | ||
18 | **************************************************************************/ | ||
19 | |||
20 | #ifndef PWMVIEWSTYLE_1_H | ||
21 | #define PWMVIEWSTYLE_1_H | ||
22 | |||
23 | #include <qvbox.h> | ||
24 | |||
25 | #ifndef PWM_EMBEDDED | ||
26 | #include <qtextedit.h> | ||
27 | #include <qsplitter.h> | ||
28 | #else | ||
29 | #include <qmultilineedit.h> | ||
30 | #include <KDGanttMinimizeSplitter.h> | ||
31 | #endif | ||
32 | |||
33 | #include <qlabel.h> | ||
34 | #include <qlistbox.h> | ||
35 | #include <qpopupmenu.h> | ||
36 | |||
37 | class PwMView; | ||
38 | class ListViewPwM; | ||
39 | class CommentBox; | ||
40 | |||
41 | class PwMViewStyle_1 : public QObject | ||
42 | { | ||
43 | Q_OBJECT | ||
44 | public: | ||
45 | PwMViewStyle_1(PwMView *view); | ||
46 | ~PwMViewStyle_1(); | ||
47 | |||
48 | ListViewPwM * getLv() | ||
49 | { return lv; } | ||
50 | CommentBox * getCommentBox() | ||
51 | { return commentBox; } | ||
52 | |||
53 | /** returns the currently selected category */ | ||
54 | QString getCurrentCategory() | ||
55 | { return categoriesList->currentText(); } | ||
56 | /** add Category to the view */ | ||
57 | void addCategory(const QString &cat) | ||
58 | { categoriesList->insertItem(cat); } | ||
59 | /** delete Category from view */ | ||
60 | void delCategory(const QString &cat); | ||
61 | /** delete all categories from view */ | ||
62 | void delAllCategories() | ||
63 | { categoriesList->clear(); } | ||
64 | /** select the specified category */ | ||
65 | void selectCategory(const QString &cat); | ||
66 | /** returns the number of categories in this view. | ||
67 | * This value dosn't say anything about the number of | ||
68 | * categories in the document. | ||
69 | */ | ||
70 | int numCategories() | ||
71 | { return categoriesList->count(); } | ||
72 | /** resize the view */ | ||
73 | void resize(const QSize &size) | ||
74 | { splitter->resize(size); } | ||
75 | |||
76 | protected slots: | ||
77 | /** user clicked right button in category list */ | ||
78 | void catRightClick(QListBoxItem *item, const QPoint &point); | ||
79 | |||
80 | protected: | ||
81 | /** main list view */ | ||
82 | ListViewPwM *lv; | ||
83 | #ifndef PWM_EMBEDDED | ||
84 | /** main splitter widget */ | ||
85 | QSplitter *splitter; | ||
86 | /** commentTextEdit splitter */ | ||
87 | QSplitter *splitter2; | ||
88 | #else | ||
89 | /** main splitter widget */ | ||
90 | KDGanttMinimizeSplitter *splitter; | ||
91 | /** commentTextEdit splitter */ | ||
92 | KDGanttMinimizeSplitter *splitter2; | ||
93 | #endif | ||
94 | |||
95 | /** categories list-box */ | ||
96 | QListBox *categoriesList; | ||
97 | /** title string for the categories combo or list box */ | ||
98 | QLabel *categoriesTitle; | ||
99 | /** hbox1 for widget style */ | ||
100 | QVBox *vbox1; | ||
101 | /** text-edit to display the comment */ | ||
102 | CommentBox *commentBox; | ||
103 | /** category list context menu */ | ||
104 | QPopupMenu *catCtxMenu; | ||
105 | }; | ||
106 | |||
107 | #endif | ||