KVIrc  4.9.2
DeveloperAPIs
KviCryptController.h
Go to the documentation of this file.
1 #ifndef _KVI_CRYPTCONTROLLER_H_
2 #define _KVI_CRYPTCONTROLLER_H_
3 //=============================================================================
4 //
5 // File : KviCryptEngine.h
6 // Creation date : Fri Nov 03 2000 14:11:03 CEST by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "kvi_settings.h"
28 
29 #if defined(COMPILE_CRYPT_SUPPORT)
30 #include "KviCryptEngine.h"
32 #include "KviCryptEngineManager.h"
33 #include "KviHeapObject.h"
34 #include "KviWindowToolWidget.h"
35 #include "KviTalListWidget.h"
36 
37 #include <QWidget>
38 #include <QPushButton>
39 #include <QToolButton>
40 #include <QLabel>
41 #include <QLineEdit>
42 #include <QCheckBox>
43 #include <QTextEdit>
44 
45 class KviWindow;
46 
47 class KVIRC_API KviCryptSessionInfo : public KviHeapObject
48 {
49 public:
50  KviCryptEngine * m_pEngine;
51  QString m_szEngineName;
52  bool m_bDoEncrypt;
53  bool m_bDoDecrypt;
54 };
55 
56 class KVIRC_API KviEngineListBoxItem : public KviTalListWidgetText
57 {
58  friend class KviCryptController;
59 
60 public:
61  KviEngineListBoxItem(KviTalListWidget * lb, KviCryptEngineDescription * d, const char * modName);
62  ~KviEngineListBoxItem();
63 
64 public:
65  QString m_szName;
66  QString m_szAuthor;
67  QString m_szDescription;
68  QString m_szModuleName;
69  int m_iFlags;
70 };
71 
72 class KVIRC_API KviCryptController : public KviWindowToolWidget
73 {
74  Q_OBJECT
75 public:
76  KviCryptController(QWidget * pParent, KviWindowToolPageButton * pButton, KviWindow * pWnd, KviCryptSessionInfo * pInfo);
77  ~KviCryptController();
78 
79 protected:
80  KviWindow * m_pWindow;
81  KviTalListWidget * m_pListBox;
82  QPushButton * m_pOkButton;
83  QCheckBox * m_pEnableCheck;
84  QTextEdit * m_pDescriptionText;
85  QLabel * m_pAuthorLabel;
86  QCheckBox * m_pEnableEncrypt;
87  QLabel * m_pEncryptKeyLabel;
88  QLineEdit * m_pEncryptKeyEdit;
89  QCheckBox * m_pEncryptHexKeyCheck;
90  QCheckBox * m_pEnableDecrypt;
91  QLabel * m_pDecryptKeyLabel;
92  QLineEdit * m_pDecryptKeyEdit;
93  QCheckBox * m_pDecryptHexKeyCheck;
94  KviEngineListBoxItem * m_pLastItem;
95  KviCryptSessionInfo * m_pSessionInfo;
96 private slots:
97  void enableCheckToggled(bool bChecked);
98  void engineHighlighted(QListWidgetItem * pItem, QListWidgetItem *);
99  void okClicked();
100 
101 public:
102  KviCryptSessionInfo * getNewSessionInfo();
103  static KviCryptSessionInfo * allocateCryptSessionInfo();
104  static void destroyCryptSessionInfo(KviCryptSessionInfo ** ppInfo);
105 
106 private:
107  void fillEngineList();
108  void noEnginesAvailable();
109  void enableWidgets(bool bEnabled);
110  bool initializeEngine(KviCryptEngine * pEngine);
111 signals:
112  void done();
113 };
114 #endif //COMPILE_CRYPT_SUPPORT
115 
116 #endif
Definition: KviTalListWidget.h:35
Definition: KviHeapObject.h:124
#define KVIRC_API
Definition: kvi_settings.h:128
Definition: KviTalListWidget.h:64
Definition: KviWindowToolWidget.h:36
char s d
Definition: KviIrcNumericCodes.h:391
void done()
Definition: KviKvs.cpp:50
Definition: KviWindowToolWidget.h:47
Definition: KviCryptEngine.h:54
Base class for all windows in KVIrc.
Definition: KviWindow.h:74
Heap Object.
This file contains compile time settings.