-rw-r--r-- | libopie2/opiesecurity/multiauthcommon.cpp | 7 | ||||
-rw-r--r-- | libopie2/opiesecurity/multiauthcommon.h | 13 | ||||
-rw-r--r-- | libopie2/opiesecurity/multiauthconfigwidget.h | 10 | ||||
-rw-r--r-- | libopie2/opiesecurity/multiauthmainwindow.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiesecurity/multiauthmainwindow.h | 10 | ||||
-rw-r--r-- | libopie2/opiesecurity/multiauthplugininterface.h | 6 | ||||
-rw-r--r-- | libopie2/opiesecurity/opiesecurity.pro | 6 |
7 files changed, 57 insertions, 3 deletions
diff --git a/libopie2/opiesecurity/multiauthcommon.cpp b/libopie2/opiesecurity/multiauthcommon.cpp index b72b9b1..d8e26d5 100644 --- a/libopie2/opiesecurity/multiauthcommon.cpp +++ b/libopie2/opiesecurity/multiauthcommon.cpp | |||
@@ -13,12 +13,14 @@ | |||
13 | #include <qdir.h> | 13 | #include <qdir.h> |
14 | 14 | ||
15 | /* UNIX */ | 15 | /* UNIX */ |
16 | #include <unistd.h> | 16 | #include <unistd.h> |
17 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
18 | 18 | ||
19 | namespace Opie { | ||
20 | namespace Security { | ||
19 | 21 | ||
20 | SecOwnerDlg::SecOwnerDlg( QWidget *parent, const char * name, Contact c, | 22 | SecOwnerDlg::SecOwnerDlg( QWidget *parent, const char * name, Contact c, |
21 | bool modal, bool fullscreen = FALSE ) | 23 | bool modal, bool fullscreen = FALSE ) |
22 | : QDialog( parent, name, modal, | 24 | : QDialog( parent, name, modal, |
23 | fullscreen ? | 25 | fullscreen ? |
24 | WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop : 0 ) | 26 | WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop : 0 ) |
@@ -50,12 +52,13 @@ bool SecOwnerDlg::eventFilter(QObject *o, QEvent *e) | |||
50 | return QWidget::eventFilter(o, e); | 52 | return QWidget::eventFilter(o, e); |
51 | } | 53 | } |
52 | 54 | ||
53 | void SecOwnerDlg::mousePressEvent( QMouseEvent * ) { accept(); } | 55 | void SecOwnerDlg::mousePressEvent( QMouseEvent * ) { accept(); } |
54 | 56 | ||
55 | 57 | ||
58 | namespace Internal { | ||
56 | /// run plugins until we reach nbSuccessMin successes | 59 | /// run plugins until we reach nbSuccessMin successes |
57 | int runPlugins() { | 60 | int runPlugins() { |
58 | 61 | ||
59 | SecOwnerDlg *oi = 0; | 62 | SecOwnerDlg *oi = 0; |
60 | // see if there is contact information. | 63 | // see if there is contact information. |
61 | QString vfilename = Global::applicationFileName("addressbook", | 64 | QString vfilename = Global::applicationFileName("addressbook", |
@@ -174,6 +177,10 @@ int runPlugins() { | |||
174 | delete lib; | 177 | delete lib; |
175 | } // end if plugin recognized | 178 | } // end if plugin recognized |
176 | } //end for | 179 | } //end for |
177 | if(oi) delete oi; | 180 | if(oi) delete oi; |
178 | return 1; | 181 | return 1; |
179 | } | 182 | } |
183 | |||
184 | } | ||
185 | } | ||
186 | } | ||
diff --git a/libopie2/opiesecurity/multiauthcommon.h b/libopie2/opiesecurity/multiauthcommon.h index 6d6d5d1..46beab0 100644 --- a/libopie2/opiesecurity/multiauthcommon.h +++ b/libopie2/opiesecurity/multiauthcommon.h | |||
@@ -38,12 +38,16 @@ | |||
38 | /* OwnerDialog stuff */ | 38 | /* OwnerDialog stuff */ |
39 | #include <qpe/global.h> | 39 | #include <qpe/global.h> |
40 | #include <qpe/contact.h> | 40 | #include <qpe/contact.h> |
41 | #include <qtextview.h> | 41 | #include <qtextview.h> |
42 | #include <qdialog.h> | 42 | #include <qdialog.h> |
43 | 43 | ||
44 | |||
45 | namespace Opie { | ||
46 | namespace Security { | ||
47 | |||
44 | class SecOwnerDlg : public QDialog | 48 | class SecOwnerDlg : public QDialog |
45 | { | 49 | { |
46 | Q_OBJECT | 50 | Q_OBJECT |
47 | public: | 51 | public: |
48 | 52 | ||
49 | SecOwnerDlg( QWidget *parent, const char * name, Contact c, | 53 | SecOwnerDlg( QWidget *parent, const char * name, Contact c, |
@@ -52,11 +56,20 @@ class SecOwnerDlg : public QDialog | |||
52 | void resizeEvent( QResizeEvent * ); | 56 | void resizeEvent( QResizeEvent * ); |
53 | bool eventFilter(QObject *o, QEvent *e); | 57 | bool eventFilter(QObject *o, QEvent *e); |
54 | void mousePressEvent( QMouseEvent * ); | 58 | void mousePressEvent( QMouseEvent * ); |
55 | 59 | ||
56 | private: | 60 | private: |
57 | QTextView *tv; | 61 | QTextView *tv; |
62 | |||
63 | private: | ||
64 | struct Private; | ||
65 | Private *d; | ||
58 | }; | 66 | }; |
59 | 67 | ||
68 | namespace Internal { | ||
60 | int runPlugins(); | 69 | int runPlugins(); |
70 | } | ||
71 | |||
72 | } | ||
73 | } | ||
61 | 74 | ||
62 | #endif // MULTIAUTHCOMMON_H | 75 | #endif // MULTIAUTHCOMMON_H |
diff --git a/libopie2/opiesecurity/multiauthconfigwidget.h b/libopie2/opiesecurity/multiauthconfigwidget.h index cd6f047..2ed8fc0 100644 --- a/libopie2/opiesecurity/multiauthconfigwidget.h +++ b/libopie2/opiesecurity/multiauthconfigwidget.h | |||
@@ -34,12 +34,15 @@ | |||
34 | #ifndef MULTIAUTHCONFIGWIDGET_H | 34 | #ifndef MULTIAUTHCONFIGWIDGET_H |
35 | #define MULTIAUTHCONFIGWIDGET_H | 35 | #define MULTIAUTHCONFIGWIDGET_H |
36 | 36 | ||
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include <qobject.h> | 38 | #include <qobject.h> |
39 | 39 | ||
40 | namespace Opie { | ||
41 | namespace Security { | ||
42 | |||
40 | /// Base class of all Opie multiauth config widgets | 43 | /// Base class of all Opie multiauth config widgets |
41 | /** | 44 | /** |
42 | * A base class for all Opie Multiauth Config Widgets. | 45 | * A base class for all Opie Multiauth Config Widgets. |
43 | * This will let a Opie multiauth plugin to add the possibility of configuration. | 46 | * This will let a Opie multiauth plugin to add the possibility of configuration. |
44 | * Plugins need to inherit from this class and need to implement | 47 | * Plugins need to inherit from this class and need to implement |
45 | * the pure virtual method to control configuration. | 48 | * the pure virtual method to control configuration. |
@@ -60,9 +63,16 @@ class MultiauthConfigWidget : public QWidget { | |||
60 | /// Method to reimplement, supposed to save the plugin configuration | 63 | /// Method to reimplement, supposed to save the plugin configuration |
61 | /** | 64 | /** |
62 | * Plugins need to reimplement this in the config widget | 65 | * Plugins need to reimplement this in the config widget |
63 | * Used when the config dialog is closed to write config stuff | 66 | * Used when the config dialog is closed to write config stuff |
64 | */ | 67 | */ |
65 | virtual void writeConfig() = 0; | 68 | virtual void writeConfig() = 0; |
69 | |||
70 | private: | ||
71 | struct Private; | ||
72 | Private *d; | ||
66 | }; | 73 | }; |
67 | 74 | ||
75 | } | ||
76 | } | ||
77 | |||
68 | #endif // MULTIAUTHCONFIGWIDGET_H | 78 | #endif // MULTIAUTHCONFIGWIDGET_H |
diff --git a/libopie2/opiesecurity/multiauthmainwindow.cpp b/libopie2/opiesecurity/multiauthmainwindow.cpp index 2be3473..c6229c7 100644 --- a/libopie2/opiesecurity/multiauthmainwindow.cpp +++ b/libopie2/opiesecurity/multiauthmainwindow.cpp | |||
@@ -1,11 +1,14 @@ | |||
1 | #include "multiauthmainwindow.h" | 1 | #include "multiauthmainwindow.h" |
2 | 2 | ||
3 | #include "multiauthcommon.h" | 3 | #include "multiauthcommon.h" |
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | 5 | ||
6 | namespace Opie { | ||
7 | namespace Security { | ||
8 | |||
6 | /// Initializes widgets according to allowBypass and explanScreens config | 9 | /// Initializes widgets according to allowBypass and explanScreens config |
7 | MultiauthMainWindow::MultiauthMainWindow() | 10 | MultiauthMainWindow::MultiauthMainWindow() |
8 | : QDialog(0, "main Opie multiauth modal dialog", TRUE, | 11 | : QDialog(0, "main Opie multiauth modal dialog", TRUE, |
9 | Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop) | 12 | Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop) |
10 | 13 | ||
11 | { | 14 | { |
@@ -72,13 +75,13 @@ MultiauthMainWindow::MultiauthMainWindow() | |||
72 | /// nothing to do | 75 | /// nothing to do |
73 | MultiauthMainWindow::~MultiauthMainWindow() { | 76 | MultiauthMainWindow::~MultiauthMainWindow() { |
74 | } | 77 | } |
75 | 78 | ||
76 | /// launch the authentication | 79 | /// launch the authentication |
77 | void MultiauthMainWindow::proceed() { | 80 | void MultiauthMainWindow::proceed() { |
78 | int result = runPlugins(); | 81 | int result = Internal::runPlugins(); |
79 | 82 | ||
80 | 83 | ||
81 | if ( (result == 0) && !explanScreens ) | 84 | if ( (result == 0) && !explanScreens ) |
82 | { | 85 | { |
83 | // the authentication has succeeded, we can exit directly | 86 | // the authentication has succeeded, we can exit directly |
84 | // this will work if we haven't been called by the constructor of MultiauthMainWindow | 87 | // this will work if we haven't been called by the constructor of MultiauthMainWindow |
@@ -124,6 +127,9 @@ void MultiauthMainWindow::proceed() { | |||
124 | * (through this function) authentication has already been succeeded.. | 127 | * (through this function) authentication has already been succeeded.. |
125 | * \todo try to avoid this hack? | 128 | * \todo try to avoid this hack? |
126 | */ | 129 | */ |
127 | bool MultiauthMainWindow::isAlreadyDone() { | 130 | bool MultiauthMainWindow::isAlreadyDone() { |
128 | return alreadyDone; | 131 | return alreadyDone; |
129 | } | 132 | } |
133 | |||
134 | } | ||
135 | } | ||
diff --git a/libopie2/opiesecurity/multiauthmainwindow.h b/libopie2/opiesecurity/multiauthmainwindow.h index d5f53c6..626b8b3 100644 --- a/libopie2/opiesecurity/multiauthmainwindow.h +++ b/libopie2/opiesecurity/multiauthmainwindow.h | |||
@@ -38,12 +38,16 @@ | |||
38 | 38 | ||
39 | #include <qdialog.h> | 39 | #include <qdialog.h> |
40 | #include <qlayout.h> | 40 | #include <qlayout.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qlabel.h> | 42 | #include <qlabel.h> |
43 | 43 | ||
44 | |||
45 | namespace Opie { | ||
46 | namespace Security { | ||
47 | |||
44 | /// Multiauth main window | 48 | /// Multiauth main window |
45 | /** | 49 | /** |
46 | * This QDialog window displays some information and an exit button, | 50 | * This QDialog window displays some information and an exit button, |
47 | * and completely hides the desktop, preventing user interactions | 51 | * and completely hides the desktop, preventing user interactions |
48 | * with it. | 52 | * with it. |
49 | */ | 53 | */ |
@@ -65,10 +69,16 @@ class MultiauthMainWindow : public QDialog { | |||
65 | bool allowBypass; | 69 | bool allowBypass; |
66 | /// true when the authentication has been done successfully | 70 | /// true when the authentication has been done successfully |
67 | bool alreadyDone; | 71 | bool alreadyDone; |
68 | 72 | ||
69 | private slots: | 73 | private slots: |
70 | void proceed(); | 74 | void proceed(); |
75 | private: | ||
76 | struct Private; | ||
77 | Private *d; | ||
71 | }; | 78 | }; |
72 | 79 | ||
80 | } | ||
81 | } | ||
82 | |||
73 | #endif // MULTIAUTHMAINWINDOW_H | 83 | #endif // MULTIAUTHMAINWINDOW_H |
74 | 84 | ||
diff --git a/libopie2/opiesecurity/multiauthplugininterface.h b/libopie2/opiesecurity/multiauthplugininterface.h index 0035107..5998a18 100644 --- a/libopie2/opiesecurity/multiauthplugininterface.h +++ b/libopie2/opiesecurity/multiauthplugininterface.h | |||
@@ -40,12 +40,15 @@ | |||
40 | 40 | ||
41 | #include "multiauthconfigwidget.h" | 41 | #include "multiauthconfigwidget.h" |
42 | 42 | ||
43 | class QString; | 43 | class QString; |
44 | class QWidget; | 44 | class QWidget; |
45 | 45 | ||
46 | namespace Opie { | ||
47 | namespace Security { | ||
48 | |||
46 | #ifndef IID_MultiauthPluginInterface | 49 | #ifndef IID_MultiauthPluginInterface |
47 | /// Universally Unique Id of the interface (required by QCOM): | 50 | /// Universally Unique Id of the interface (required by QCOM): |
48 | /// {AD5BE8B1-8421-447b-9AED-250BE1CDA49c} | 51 | /// {AD5BE8B1-8421-447b-9AED-250BE1CDA49c} |
49 | #define IID_MultiauthPluginInterface QUuid(0xad5be8b1, 0x8421, 0x447b, 0x9a, 0xed, 0x25, 0x0b, 0xe1, 0xcd, 0xa4, 0x9c) | 52 | #define IID_MultiauthPluginInterface QUuid(0xad5be8b1, 0x8421, 0x447b, 0x9a, 0xed, 0x25, 0x0b, 0xe1, 0xcd, 0xa4, 0x9c) |
50 | #endif | 53 | #endif |
51 | 54 | ||
@@ -103,7 +106,10 @@ class MultiauthPluginObject { | |||
103 | */ | 106 | */ |
104 | struct MultiauthPluginInterface : public QUnknownInterface { | 107 | struct MultiauthPluginInterface : public QUnknownInterface { |
105 | /// return the MultiauthPluginObject implementation | 108 | /// return the MultiauthPluginObject implementation |
106 | virtual MultiauthPluginObject *plugin() = 0; | 109 | virtual MultiauthPluginObject *plugin() = 0; |
107 | }; | 110 | }; |
108 | 111 | ||
112 | } | ||
113 | } | ||
114 | |||
109 | #endif | 115 | #endif |
diff --git a/libopie2/opiesecurity/opiesecurity.pro b/libopie2/opiesecurity/opiesecurity.pro index 8cb4821..8535785 100644 --- a/libopie2/opiesecurity/opiesecurity.pro +++ b/libopie2/opiesecurity/opiesecurity.pro | |||
@@ -1,15 +1,17 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = multiauthcommon.h \ | 4 | HEADERS = multiauthcommon.h \ |
5 | multiauthmainwindow.h \ | 5 | multiauthmainwindow.h \ |
6 | multiauthconfigwidget.h \ | 6 | multiauthconfigwidget.h \ |
7 | multiauthplugininterface.h | 7 | multiauthplugininterface.h \ |
8 | multiauthpassword.h | ||
8 | SOURCES = multiauthcommon.cpp \ | 9 | SOURCES = multiauthcommon.cpp \ |
9 | multiauthmainwindow.cpp | 10 | multiauthmainwindow.cpp \ |
11 | multiauthpassword.cpp | ||
10 | TARGET = opiesecurity2 | 12 | TARGET = opiesecurity2 |
11 | VERSION = 0.0.2 | 13 | VERSION = 0.0.2 |
12 | INCLUDEPATH += $(OPIEDIR)/include | 14 | INCLUDEPATH += $(OPIEDIR)/include |
13 | DEPENDPATH += $(OPIEDIR)/include | 15 | DEPENDPATH += $(OPIEDIR)/include |
14 | 16 | ||
15 | include ( $(OPIEDIR)/include.pro ) | 17 | include ( $(OPIEDIR)/include.pro ) |