summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwmviewstyle.h
Unidiff
Diffstat (limited to 'pwmanager/pwmanager/pwmviewstyle.h') (more/less context) (show whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmviewstyle.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/pwmviewstyle.h b/pwmanager/pwmanager/pwmviewstyle.h
new file mode 100644
index 0000000..bf5ce91
--- a/dev/null
+++ b/pwmanager/pwmanager/pwmviewstyle.h
@@ -0,0 +1,108 @@
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/***************************************************************************
14 * copyright (C) 2004 by Ulf Schenk
15 * This file is originaly based on version 1.0.1 of pwmanager
16 * and was modified to run on embedded devices that run microkde
17 *
18 * $Id$
19 **************************************************************************/
20
21#ifndef PWMVIEWSTYLE_H
22#define PWMVIEWSTYLE_H
23
24#include <qwidget.h>
25#include <qsplitter.h>
26#include <qhbox.h>
27#include <qvbox.h>
28#include <qpushbutton.h>
29#include <qpopupmenu.h>
30#ifndef PWM_EMBEDDED
31#include <qtextedit.h>
32#else
33#include <qmultilineedit.h>
34#endif
35
36#include <qlabel.h>
37#include <qlistbox.h>
38#include <qcombobox.h>
39#include <qsize.h>
40
41class ListViewPwM;
42class PwMViewStyle_0;
43class PwMViewStyle_1;
44class PwMView;
45class CommentBox;
46
47class PwMViewStyle : public QWidget
48{
49 Q_OBJECT
50
51public:
52 enum style_t
53 {
54 style_notset= -1,
55 style_0 = 0,
56 style_1 = 1
57 };
58
59public:
60 PwMViewStyle(QWidget *parent = 0, const char *name = 0);
61 ~PwMViewStyle();
62
63 /** initialize a new style */
64 void initStyle(style_t style);
65 void initStyle(int style)
66 { initStyle(static_cast<style_t>(style)); }
67 /** returns the currently used style */
68 style_t getCurStyle()
69 { return curStyle; }
70 void setView(PwMView *view)
71 { v = view; }
72
73 /** returns the currently selected category */
74 QString getCurrentCategory();
75
76protected:
77 /** add Category to the view */
78 void addCategory(const QString &cat);
79 /** delete Category from view */
80 void delCategory(const QString &cat);
81 /** delete all categories from view */
82 void delAllCategories();
83 /** select the specified category */
84 void selectCategory(const QString &cat);
85 /** returns the number of categories in this view.
86 * This value dosn't say anything about the number of
87 * categories in the document.
88 */
89 int numCategories();
90 /** resize the view */
91 void resizeView(const QSize &size);
92
93private:
94 /** which style has the view?
95 * KListBox on the left,
96 * or QComboBox on the top?
97 */
98 style_t curStyle;
99
100 PwMViewStyle_0 *s0;
101 PwMViewStyle_1 *s1;
102 PwMView *v;
103
104protected:
105 ListViewPwM *lv;
106 CommentBox *commentBox;
107};
108#endif