summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/addentrywndimpl.h
Unidiff
Diffstat (limited to 'pwmanager/pwmanager/addentrywndimpl.h') (more/less context) (show whitespace changes)
-rw-r--r--pwmanager/pwmanager/addentrywndimpl.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/addentrywndimpl.h b/pwmanager/pwmanager/addentrywndimpl.h
new file mode 100644
index 0000000..c0bfcee
--- a/dev/null
+++ b/pwmanager/pwmanager/addentrywndimpl.h
@@ -0,0 +1,114 @@
1/***************************************************************************
2 * *
3 * copyright (C) 2003, 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 __ADDENTRYWNDIMPL_H
21#define __ADDENTRYWNDIMPL_H
22
23#include "addentrywnd.h"
24
25#include <qlineedit.h>
26#ifndef PWM_EMBEDDED
27#include <qtextedit.h>
28#else
29#include <qmultilineedit.h>
30#endif
31
32#include <qcombobox.h>
33#include <qpushbutton.h>
34
35class PwGenWndImpl;
36
37/** "add/edit" Window */
38class AddEntryWndImpl : public addEntryWnd
39{
40 Q_OBJECT
41public:
42 AddEntryWndImpl();
43 ~AddEntryWndImpl();
44
45 /* get... functions */
46 QString getDescription()
47 { return descLineEdit->text(); }
48 QString getCategory()
49 { return categoryComboBox->currentText(); }
50 QString getUsername()
51 { return usernameLineEdit->text(); }
52 QString getPassword()
53 { return pwLineEdit->text(); }
54 QString getUrl()
55 { return urlLineEdit->text(); }
56 QString getLauncher()
57 { return launcherLineEdit->text(); }
58 QString getComment();
59
60 /* set... functions */
61 void setDescription(const QString &desc)
62 { descLineEdit->setText(desc); }
63 void setCurrCategory(const QString &cat);
64 void addCategory(const QString &cat)
65 { categoryComboBox->insertItem(cat); }
66 void setUsername(const QString &name)
67 { usernameLineEdit->setText(name); }
68 void setPassword(const QString &pw)
69 { pwLineEdit->setText(pw); }
70 void setUrl(const QString &url)
71 { urlLineEdit->setText(url); }
72 void setLauncher(const QString launcher)
73 { launcherLineEdit->setText(launcher); }
74 void setComment(const QString &comm);
75
76 /** are we using an advanced comment */
77 bool isAdvancedComment()
78 { return useAdvComment; }
79
80public slots:
81 /** OK button pressed */
82 void okButton_slot();
83 /** cancel button pressed */
84 void cancelButton_slot();
85 /** Reveal button pressed */
86 void revealButton_slot();
87 /** Generate button pressed */
88 void generateButton_slot();
89 /** advanced comment button pressed */
90 void advancedCommentButton_slot(bool on);
91 /** edit advanced comment button pressed */
92 void editAdvCommentButton_slot();
93
94protected:
95 void switchComment(bool toAdvanced);
96
97protected:
98 QPushButton *editAdvCommentButton;
99#ifndef PWM_EMBEDDED
100 QTextEdit *commentTextEdit;
101#else
102 QMultiLineEdit * commentTextEdit;
103#endif
104 /** saved data from normal comment text edit box */
105 QString savedCommentText;
106 /** use an advanced comment? */
107 bool useAdvComment;
108 /** data of advanced comment (if available) */
109 QString advCommentDta;
110 /** password generation object */
111 PwGenWndImpl *pwGen;
112};
113
114#endif