Initial commit
[keepassx] / src / dialogs / EditEntryDlg.h
1 /***************************************************************************
2  *   Copyright (C) 2005-2007 by Tarek Saidi                                *
3  *   tarek.saidi@arcor.de                                                  *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; version 2 of the License.               *
8
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #ifndef EDITENTRYDLG_H
22 #define EDITENTRYDLG_H
23
24 #include "ui_EditEntryDlg.h"
25 #include "Kdb3Database.h"
26
27 class CEditEntryDlg : public QDialog, private Ui_EditEntryDialog
28 {
29         Q_OBJECT
30         public:
31                 CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent = 0, bool newEntry = FALSE);
32                 ~CEditEntryDlg();
33                 void InitGroupComboBox();
34                 static void saveAttachment(IEntryHandle* pEntry, QWidget* ParentWidget=NULL);
35                 
36                 IEntryHandle* entry;
37                 IDatabase* db;
38                 bool ModFlag;
39                 int GroupIndex;
40                 QList<IGroupHandle*> groups;
41                 QPixmap BannerPixmap;   
42         
43         private slots:
44                 void OnTitleTextChanged(const QString&);
45                 void OnPasswordwLostFocus();
46                 void OnPasswordwTextChanged();
47                 void OnPasswordTextChanged();
48                 void ChangeEchoMode();
49                 void OnButtonCancel();
50                 void OnNewAttachment();
51                 void OnDeleteAttachment();
52                 void OnSaveAttachment();
53                 void OnButtonGenPw();
54                 void OnCheckBoxExpiresNeverChanged(int state);
55                 void OnButtonIcons();
56                 void OnButtonOK();
57                 void OnExpirePreset(QAction* action);
58                 void OnCalendar(QAction* action);
59                 void OnClose();
60                 void OnCustomizeSequence();
61                 void OnSelectTarget();
62                 
63         private:
64                 virtual void paintEvent(QPaintEvent*);
65                 virtual void resizeEvent(QResizeEvent *);
66                 
67                 int IconIndex;
68                 bool pNewEntry;
69 };
70
71 #endif