summaryrefslogtreecommitdiff
path: root/libopie2/opiesecurity/multiauthplugininterface.h
Unidiff
Diffstat (limited to 'libopie2/opiesecurity/multiauthplugininterface.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiesecurity/multiauthplugininterface.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/libopie2/opiesecurity/multiauthplugininterface.h b/libopie2/opiesecurity/multiauthplugininterface.h
new file mode 100644
index 0000000..0035107
--- a/dev/null
+++ b/libopie2/opiesecurity/multiauthplugininterface.h
@@ -0,0 +1,109 @@
1/**
2 * \file multiauthplugininterface.h
3 * \brief Main public interface to Opie multiauth authentication plugins.
4 *
5 * This implementation was derived from the todolist plugin implementation.
6 * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr)
7 */
8/*
9 =. This file is part of the Opie Project
10 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
11 .>+-=
12 _;:, .> :=|. This library is free software; you can
13.> <`_, > . <= redistribute it and/or modify it under
14:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
15.="- .-=="i, .._ License as published by the Free Software
16 - . .-<_> .<> Foundation; either version 2 of the License,
17 ._= =} : or (at your option) any later version.
18 .%`+i> _;_.
19 .i_,=:_. -<s. This library is distributed in the hope that
20 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
21 : .. .:, . . . without even the implied warranty of
22 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
23 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
24..}^=.= = ; Library General Public License for more
25++= -. .` .: details.
26 : = ...= . :.=-
27 -. .:....=;==+<; You should have received a copy of the GNU
28 -_. . . )=. = Library General Public License along with
29 -- :-=` this library; see the file COPYING.LIB.
30 If not, write to the Free Software Foundation,
31 Inc., 59 Temple Place - Suite 330,
32 Boston, MA 02111-1307, USA.
33
34*/
35
36#ifndef MULTIAUTH_PLUGIN_INTERFACE
37#define MULTIAUTH_PLUGIN_INTERFACE
38
39#include <qpe/qcom.h>
40
41#include "multiauthconfigwidget.h"
42
43class QString;
44class QWidget;
45
46#ifndef IID_MultiauthPluginInterface
47/// Universally Unique Id of the interface (required by QCOM):
48/// {AD5BE8B1-8421-447b-9AED-250BE1CDA49c}
49#define IID_MultiauthPluginInterface QUuid(0xad5be8b1, 0x8421, 0x447b, 0x9a, 0xed, 0x25, 0x0b, 0xe1, 0xcd, 0xa4, 0x9c)
50#endif
51
52/// Base class for Opie multiauth plugins
53/**
54 * A MultiauthPluginObject is the base for all Multiauth Plugins.
55 * A plugin author needs to inherit this class and implement
56 * the pure virtual methods.
57 *
58 * \author Clement Seveillac (helped by Maximilian Reiß's Today framework)
59 */
60class MultiauthPluginObject {
61
62 public:
63
64 virtual ~MultiauthPluginObject() {};
65
66 /// The name of the plugin
67 /*
68 * \return The plugin should return its name here
69 */
70 virtual QString pluginName() const = 0;
71
72 /// Ask the plugin to launch one authentication attempt
73 virtual int authenticate() = 0;
74
75 /// Possible return codes for authenticate() function
76 enum authResult { Success = 0,
77 Failure = 1,
78 Skip = 2 };
79
80 /// Pointer to the (optional) plugin configuration widget
81 virtual MultiauthConfigWidget * configWidget(QWidget * parent) = 0;
82
83 /// (optional) plugin configuration tab icon
84 /**
85 * \return path to the image file (without the extension)
86 * from $OPIEDIR/pics
87 */
88 virtual QString pixmapNameConfig() const = 0;
89
90 /// Plugin icon, to be displayed in the plugin list configuration widget
91 /**
92 * \return path to the image file (without the extension)
93 * from $OPIEDIR/pics
94 */
95 virtual QString pixmapNameWidget() const = 0;
96
97};
98
99/// Interface for multiauth plugin classes.
100/*
101 * This is part of the QCOM works. See example plugins how to do it right.
102 * \see http://doc.trolltech.com/qtopia/html/pluginintro.html
103 */
104struct MultiauthPluginInterface : public QUnknownInterface {
105 /// return the MultiauthPluginObject implementation
106 virtual MultiauthPluginObject *plugin() = 0;
107};
108
109#endif