43 files changed, 4197 insertions, 0 deletions
diff --git a/noncore/securityplugins/blueping/.cvsignore b/noncore/securityplugins/blueping/.cvsignore new file mode 100644 index 0000000..a4e0e29 --- a/dev/null +++ b/noncore/securityplugins/blueping/.cvsignore | |||
@@ -0,0 +1,3 @@ | |||
1 | .moc | ||
2 | .obj | ||
3 | Makefile | ||
diff --git a/noncore/securityplugins/blueping/Makefile b/noncore/securityplugins/blueping/Makefile new file mode 100644 index 0000000..990a4e0 --- a/dev/null +++ b/noncore/securityplugins/blueping/Makefile | |||
@@ -0,0 +1,204 @@ | |||
1 | ############################################################################# | ||
2 | # Makefile for building: libmultiauthbluepingplugin.so.1.0.0 | ||
3 | # Generated by qmake (1.05a) (Qt 3.1.2) on: Mon Jun 14 11:00:20 2004 | ||
4 | # Project: bluepingplugin.pro | ||
5 | # Template: lib | ||
6 | # Command: $(QMAKE) -o Makefile bluepingplugin.pro | ||
7 | ############################################################################# | ||
8 | |||
9 | ####### Compiler, tools and options | ||
10 | |||
11 | CC = $(CCACHE) $(DISTCC) gcc | ||
12 | CXX = $(CCACHE) $(DISTCC) g++ | ||
13 | LEX = flex | ||
14 | YACC = yacc | ||
15 | CFLAGS = -pipe $(CFLAGS_EXTRA) -Wall -W -g -fPIC -DQT_COMPONENT_DEBUG=2 -DQT_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION -DOPIE_SOUND_FRAGMENT_SHIFT=16 | ||
16 | CXXFLAGS = -pipe $(CFLAGS_EXTRA) -DQWS -fno-exceptions -fno-rtti $(CXXFLAGS_EXTRA) -Wall -W -g -fPIC -DQT_COMPONENT_DEBUG=2 -DQT_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION -DOPIE_SOUND_FRAGMENT_SHIFT=16 | ||
17 | LEXFLAGS = | ||
18 | YACCFLAGS= -d | ||
19 | INCPATH = -I/opt/opie/mkspecs/qws/linux-generic-g++ -I. -I$(OPIEDIR)/include -I$(QTDIR)/include -I.moc/$(PLATFORM)/ | ||
20 | LINK = g++ | ||
21 | LFLAGS = $(LFLAGS_EXTRA) -Wl,-rpath-link,$(OPIEDIR)/lib -shared -Wl,-soname,libmultiauthbluepingplugin.so.1 -Wl,-rpath,/opt/opie/plugins/security | ||
22 | LIBS = $(SUBLIBS) -Wl,-rpath,$(QTDIR)/lib -L$(QTDIR)/lib $(LIBS_EXTRA) -lqpe -lopieui2 -lopiecore2 -L$(OPIEDIR)/lib -lqte | ||
23 | AR = ar cqs | ||
24 | RANLIB = | ||
25 | MOC = $(QTDIR)/bin/moc | ||
26 | UIC = $(QTDIR)/bin/uic | ||
27 | QMAKE = qmake | ||
28 | TAR = tar -cf | ||
29 | GZIP = gzip -9f | ||
30 | COPY = cp -f | ||
31 | COPY_FILE= $(COPY) -p | ||
32 | COPY_DIR = $(COPY) -pR | ||
33 | DEL_FILE = rm -f | ||
34 | SYMLINK = ln -sf | ||
35 | DEL_DIR = rmdir | ||
36 | MOVE = mv -f | ||
37 | PRO = bluepingplugin.pro | ||
38 | CHK_DIR_EXISTS= | ||
39 | MKDIR = | ||
40 | |||
41 | ####### Output directory | ||
42 | |||
43 | OBJECTS_DIR = .obj/$(PLATFORM)/ | ||
44 | |||
45 | ####### Files | ||
46 | |||
47 | HEADERS = bluepingplugin.h \ | ||
48 | bluepingpluginimpl.h | ||
49 | SOURCES = bluepingplugin.cpp \ | ||
50 | bluepingpluginimpl.cpp | ||
51 | OBJECTS = .obj/$(PLATFORM)/bluepingplugin.o \ | ||
52 | .obj/$(PLATFORM)/bluepingpluginimpl.o | ||
53 | FORMS = | ||
54 | UICDECLS = | ||
55 | UICIMPLS = | ||
56 | SRCMOC = .moc/$(PLATFORM)/moc_bluepingplugin.cpp | ||
57 | OBJMOC = .obj/$(PLATFORM)/moc_bluepingplugin.o | ||
58 | DIST = ../../../gen.pro \ | ||
59 | ../../../include.pro \ | ||
60 | bluepingplugin.pro | ||
61 | QMAKE_TARGET = multiauthbluepingplugin | ||
62 | DESTDIR = $(OPIEDIR)/plugins/security/ | ||
63 | TARGET = libmultiauthbluepingplugin.so.1.0.0 | ||
64 | TARGETA= $(OPIEDIR)/plugins/security/libmultiauthbluepingplugin.a | ||
65 | TARGETD= libmultiauthbluepingplugin.so.1.0.0 | ||
66 | TARGET0= libmultiauthbluepingplugin.so | ||
67 | TARGET1= libmultiauthbluepingplugin.so.1 | ||
68 | TARGET2= libmultiauthbluepingplugin.so.1.0 | ||
69 | |||
70 | first: all | ||
71 | ####### Implicit rules | ||
72 | |||
73 | .SUFFIXES: .c .cpp .cc .cxx .C | ||
74 | |||
75 | .cpp.o: | ||
76 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
77 | |||
78 | .cc.o: | ||
79 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
80 | |||
81 | .cxx.o: | ||
82 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
83 | |||
84 | .C.o: | ||
85 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
86 | |||
87 | .c.o: | ||
88 | $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< | ||
89 | |||
90 | ####### Build rules | ||
91 | |||
92 | all: Makefile $(OPIEDIR)/plugins/security/$(TARGET) | ||
93 | |||
94 | $(OPIEDIR)/plugins/security/$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) | ||
95 | test -d $(OPIEDIR)/plugins/security/ || mkdir -p $(OPIEDIR)/plugins/security/ | ||
96 | -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) | ||
97 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) | ||
98 | -ln -s $(TARGET) $(TARGET0) | ||
99 | -ln -s $(TARGET) $(TARGET1) | ||
100 | -ln -s $(TARGET) $(TARGET2) | ||
101 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET) | ||
102 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET0) | ||
103 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET1) | ||
104 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET2) | ||
105 | -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) $(OPIEDIR)/plugins/security/ | ||
106 | |||
107 | |||
108 | |||
109 | staticlib: $(TARGETA) | ||
110 | |||
111 | $(TARGETA): $(UICDECLS) $(OBJECTS) $(OBJMOC) | ||
112 | -$(DEL_FILE) $(TARGETA) | ||
113 | $(AR) $(TARGETA) $(OBJECTS) $(OBJMOC) | ||
114 | |||
115 | mocables: $(SRCMOC) | ||
116 | |||
117 | $(MOC): | ||
118 | ( cd $(QTDIR)/src/moc ; $(MAKE) ) | ||
119 | |||
120 | Makefile: bluepingplugin.pro /opt/opie/mkspecs/qws/linux-generic-g++/qmake.conf ../../../gen.pro \ | ||
121 | ../../../include.pro | ||
122 | $(QMAKE) -o Makefile bluepingplugin.pro | ||
123 | qmake: | ||
124 | @$(QMAKE) -o Makefile bluepingplugin.pro | ||
125 | |||
126 | dist: | ||
127 | @mkdir -p .obj/$(PLATFORM)/multiauthbluepingplugin && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .obj/$(PLATFORM)/multiauthbluepingplugin/ && ( cd `dirname .obj/$(PLATFORM)/multiauthbluepingplugin` && $(TAR) multiauthbluepingplugin.tar multiauthbluepingplugin && $(GZIP) multiauthbluepingplugin.tar ) && $(MOVE) `dirname .obj/$(PLATFORM)/multiauthbluepingplugin`/multiauthbluepingplugin.tar.gz . && $(DEL_FILE) -r .obj/$(PLATFORM)/multiauthbluepingplugin | ||
128 | |||
129 | mocclean: | ||
130 | -$(DEL_FILE) $(OBJMOC) | ||
131 | -$(DEL_FILE) $(SRCMOC) | ||
132 | |||
133 | uiclean: | ||
134 | |||
135 | yaccclean: | ||
136 | lexclean: | ||
137 | clean: mocclean | ||
138 | -$(DEL_FILE) $(OBJECTS) | ||
139 | -$(DEL_FILE) *~ core *.core | ||
140 | |||
141 | |||
142 | ####### Sub-libraries | ||
143 | |||
144 | distclean: clean | ||
145 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET) $(TARGET) | ||
146 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET0) $(OPIEDIR)/plugins/security/$(TARGET1) $(OPIEDIR)/plugins/security/$(TARGET2) $(TARGETA) | ||
147 | |||
148 | |||
149 | lupdate: | ||
150 | lupdate -noobsolete $(PRO) | ||
151 | |||
152 | lrelease: | ||
153 | lrelease $(PRO) | ||
154 | |||
155 | ipk: | ||
156 | tmp=`mktemp -d /tmp/ipkg-opie.XXXXXXXXXX` && ( $(MAKE) INSTALL_ROOT="" install && ipkg-build ; rm -rf ; ) | ||
157 | |||
158 | opie-lupdate: | ||
159 | opie-lupdate $(PRO) | ||
160 | |||
161 | opie-lrelease: | ||
162 | opie-lrelease $(PRO) | ||
163 | |||
164 | messages: | ||
165 | xgettext -C -n -ktr -kQT_TRANSLATE_NOOP bluepingplugin.h bluepingpluginimpl.h bluepingplugin.cpp bluepingpluginimpl.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-tr.po' && xgettext -C -n -a bluepingplugin.h bluepingpluginimpl.h bluepingplugin.cpp bluepingpluginimpl.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-allstrings.po' | ||
166 | |||
167 | FORCE: | ||
168 | |||
169 | ####### Compile | ||
170 | |||
171 | .obj/$(PLATFORM)/bluepingplugin.o: bluepingplugin.cpp bluepingplugin.h | ||
172 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/bluepingplugin.o bluepingplugin.cpp | ||
173 | |||
174 | .obj/$(PLATFORM)/bluepingpluginimpl.o: bluepingpluginimpl.cpp bluepingpluginimpl.h \ | ||
175 | bluepingplugin.h | ||
176 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/bluepingpluginimpl.o bluepingpluginimpl.cpp | ||
177 | |||
178 | .obj/$(PLATFORM)/moc_bluepingplugin.o: .moc/$(PLATFORM)/moc_bluepingplugin.cpp bluepingplugin.h | ||
179 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/moc_bluepingplugin.o .moc/$(PLATFORM)/moc_bluepingplugin.cpp | ||
180 | |||
181 | .moc/x86-linux/moc_bluepingplugin.cpp: $(MOC) bluepingplugin.h | ||
182 | $(MOC) bluepingplugin.h -o .moc/x86-linux/moc_bluepingplugin.cpp | ||
183 | |||
184 | ####### Install | ||
185 | |||
186 | install_target: | ||
187 | @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" || $(MKDIR) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" | ||
188 | -$(COPY) "$(OPIEDIR)/plugins/security/$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET)" | ||
189 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET0)" | ||
190 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET1)" | ||
191 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET2)" | ||
192 | |||
193 | uninstall_target: | ||
194 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET)" | ||
195 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET0)" | ||
196 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET1)" | ||
197 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET2)" | ||
198 | -$(DEL_DIR) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" | ||
199 | |||
200 | |||
201 | install: all install_target | ||
202 | |||
203 | uninstall: uninstall_target | ||
204 | |||
diff --git a/noncore/securityplugins/blueping/bluepingplugin.control b/noncore/securityplugins/blueping/bluepingplugin.control new file mode 100644 index 0000000..9c5ec66 --- a/dev/null +++ b/noncore/securityplugins/blueping/bluepingplugin.control | |||
@@ -0,0 +1,12 @@ | |||
1 | Package: opie-multiauth-bluepingplugin | ||
2 | Files: plugins/security/libmultiauthbluepingplugin.so* pics/security/bluepingplugin.png | ||
3 | Priority: optional | ||
4 | Section: opie/settings | ||
5 | Maintainer: Clement Seveillac <clement@nist.gov> | ||
6 | Architecture: arm | ||
7 | Version: 0.0.2.5 | ||
8 | Depends: libopiecore2, opie-security | ||
9 | Description: Blueping plugin for opie-security authentication. | ||
10 | This is a bluetooth-based authentication plugin (you need | ||
11 | to have another Bluetooth device around, the more secure the | ||
12 | bonding they made, the more secure the authentication) | ||
diff --git a/noncore/securityplugins/blueping/bluepingplugin.cpp b/noncore/securityplugins/blueping/bluepingplugin.cpp new file mode 100644 index 0000000..af0448b --- a/dev/null +++ b/noncore/securityplugins/blueping/bluepingplugin.cpp | |||
@@ -0,0 +1,198 @@ | |||
1 | #include "bluepingplugin.h" | ||
2 | |||
3 | #include <opie2/oapplication.h> | ||
4 | #include <opie2/odebug.h> | ||
5 | #include <opie2/odevice.h> | ||
6 | |||
7 | #include <qdialog.h> | ||
8 | #include <qlayout.h> | ||
9 | #include <qhbox.h> | ||
10 | #include <qlabel.h> | ||
11 | #include <qpushbutton.h> | ||
12 | #include <qtimer.h> | ||
13 | |||
14 | using namespace Opie::Core; | ||
15 | |||
16 | /// creates and initializes the m_config Config object | ||
17 | BluepingPlugin::BluepingPlugin() : MultiauthPluginObject(), m_ping(0) { | ||
18 | m_config = new Config("Security"); | ||
19 | m_config->setGroup("BluepingPlugin"); | ||
20 | bluetoothAlreadyRestarted = false; | ||
21 | } | ||
22 | |||
23 | /// deletes the m_config Config object and noticeW if necessary | ||
24 | BluepingPlugin::~BluepingPlugin() { | ||
25 | delete m_config; | ||
26 | if (m_ping != 0) | ||
27 | delete m_ping; | ||
28 | } | ||
29 | |||
30 | /// Simply return its name (Blueping plugin) | ||
31 | QString BluepingPlugin::pluginName() const { | ||
32 | return "Blueping plugin"; | ||
33 | } | ||
34 | |||
35 | /// no configuration widget for the moment | ||
36 | MultiauthConfigWidget * BluepingPlugin::configWidget(QWidget * parent) { | ||
37 | return 0l; | ||
38 | } | ||
39 | QString BluepingPlugin::pixmapNameWidget() const { | ||
40 | return "security/bluepingplugin"; | ||
41 | } | ||
42 | QString BluepingPlugin::pixmapNameConfig() const { | ||
43 | return 0l; | ||
44 | } | ||
45 | |||
46 | /// Emit the MultiauthPluginObject::Success emitCode | ||
47 | void BluepingPlugin::success() { | ||
48 | emit emitCode(MultiauthPluginObject::Success); | ||
49 | } | ||
50 | |||
51 | /// Emit the MultiauthPluginObject::Failure emitCode | ||
52 | void BluepingPlugin::failure() { | ||
53 | emit emitCode(MultiauthPluginObject::Failure); | ||
54 | } | ||
55 | |||
56 | /// Emit the MultiauthPluginObject::Skip emitCode | ||
57 | void BluepingPlugin::skip() { | ||
58 | emit emitCode(MultiauthPluginObject::Skip); | ||
59 | } | ||
60 | |||
61 | /// do the actual ping | ||
62 | void BluepingPlugin::ping() { | ||
63 | m_ping = new OProcess(); | ||
64 | odebug << "pinging device: " << macToPing << oendl; | ||
65 | *m_ping << "l2ping" << "-c 1" << macToPing; | ||
66 | |||
67 | // starting to ping in the background | ||
68 | /// \todo as soon as ping is launched, check RSSI (signal strength) and check | ||
69 | /// it's high enough, meaning the device is close enough? | ||
70 | /// \todo make it optionally pollable, so don't finish the ping and call | ||
71 | /// Opie suspend if l2ping timeouts? | ||
72 | if ( !m_ping->start() ) { | ||
73 | oerr << "could not start l2ping" << oendl; | ||
74 | this->skip(); | ||
75 | } | ||
76 | QObject::connect(m_ping, SIGNAL(processExited(Opie::Core::OProcess*)), | ||
77 | this, SLOT(pingFinished(Opie::Core::OProcess*)) ); | ||
78 | } | ||
79 | |||
80 | /// Deals with m_ping result | ||
81 | void BluepingPlugin::pingFinished(OProcess * ping) { | ||
82 | if ( ping->normalExit() && (ping->exitStatus() == 0) ) | ||
83 | { | ||
84 | odebug << "Successful Bluetooth ping!" << oendl; | ||
85 | success(); | ||
86 | } | ||
87 | else | ||
88 | { | ||
89 | odebug << "Failed Bluetooth ping..." << oendl; | ||
90 | failure(); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | /// Make one authentication attempt with this plugin | ||
95 | /** | ||
96 | * (very simple "success" / "failure" buttons in a dialog) | ||
97 | * \return The outcome code of this authentication | ||
98 | */ | ||
99 | int BluepingPlugin::authenticate() { | ||
100 | |||
101 | Config cfg("Security"); | ||
102 | cfg.setGroup("BluepingPlugin"); | ||
103 | macToPing = cfg.readEntry("mac"); | ||
104 | if (!macToPing.isEmpty()) | ||
105 | { | ||
106 | /* Standard, inescapable authentication dialog | ||
107 | */ | ||
108 | QDialog bluepingDialog(0, | ||
109 | "Blueping dialog", | ||
110 | TRUE, | ||
111 | Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop); | ||
112 | |||
113 | QRect desk = oApp->desktop()->geometry(); | ||
114 | bluepingDialog.setGeometry( 0, 0, desk.width(), desk.height() ); | ||
115 | |||
116 | // Creation of the particular widgets of our Blueping user interface | ||
117 | QVBoxLayout *layout = new QVBoxLayout(&bluepingDialog); | ||
118 | layout->setSpacing(11); | ||
119 | layout->setMargin(11); | ||
120 | layout->setAlignment( Qt::AlignTop ); | ||
121 | |||
122 | QLabel title("<center><h1>\"Blueping\" <br />plugin</h1></center>", &bluepingDialog); | ||
123 | QLabel subTitle("<center><h2>Trying to reach your configured bluetooth device...</h2></center>", &bluepingDialog); | ||
124 | QLabel subTitle2("<center>You can skip this step and use another authentication way with the following button</center>", &bluepingDialog); | ||
125 | QPushButton pbSkip("Skip", &bluepingDialog); | ||
126 | layout->addWidget(&title); | ||
127 | layout->addWidget(&subTitle); | ||
128 | layout->addWidget(&subTitle2); | ||
129 | layout->addWidget(&pbSkip, 0, Qt::AlignHCenter); | ||
130 | |||
131 | // connect the skip button to the skip signal emitting function | ||
132 | QObject::connect(&pbSkip, SIGNAL(clicked()), this, SLOT(skip())); | ||
133 | // connect the signal emitting functions to the bluepingDialog done(int) finishing function | ||
134 | QObject::connect(this, SIGNAL(emitCode(int)), &bluepingDialog, SLOT(done(int))); | ||
135 | |||
136 | if (!bluetoothAlreadyRestarted) | ||
137 | { | ||
138 | // we have just started or resumed the device, so Bluetooth has to be (re)started | ||
139 | OProcess killB; | ||
140 | killB << "killall" << "hciattach"; | ||
141 | odebug << "killing Bluetooth..." << oendl; | ||
142 | if ( !killB.start(OProcess::Block) ) { | ||
143 | oerr << "could not kill bluetooth" << oendl; | ||
144 | } | ||
145 | |||
146 | OProcess startB; | ||
147 | switch ( ODevice::inst()->model() ) { | ||
148 | case Model_iPAQ_H39xx: | ||
149 | startB << "/sbin/hciattach" << "/dev/tts/1" << "bcsp" << "921600"; | ||
150 | break; | ||
151 | |||
152 | case Model_iPAQ_H5xxx: | ||
153 | startB << "/sbin/hciattach" << "/dev/tts/1" << "any" << "921600"; | ||
154 | break; | ||
155 | |||
156 | default: | ||
157 | startB << "/sbin/hciattach" << "/dev/ttySB0" << "bcsp" << "230400"; | ||
158 | break; | ||
159 | } // end switch on device models | ||
160 | |||
161 | if ( !startB.start(OProcess::Block) ) { | ||
162 | oerr << "could not (re)start bluetooth" << oendl; | ||
163 | return MultiauthPluginObject::Skip; | ||
164 | } | ||
165 | else | ||
166 | { | ||
167 | if ( startB.normalExit() && (startB.exitStatus() == 0) ) | ||
168 | { | ||
169 | odebug << "hciattach exited normally."<< oendl; | ||
170 | bluetoothAlreadyRestarted = true; | ||
171 | // 500 ms timer, so l2ping won't try to find a route before bluetooth has \em really started | ||
172 | QTimer::singleShot( 500, this, SLOT(ping()) ); | ||
173 | } | ||
174 | else | ||
175 | { | ||
176 | owarn << "hciattach exited anormally (error code: " << startB.exitStatus() << ")" << oendl; | ||
177 | } // end if startBluetooth exit status == 0 | ||
178 | } // end if startBluetooth started | ||
179 | } | ||
180 | else | ||
181 | { | ||
182 | // we don't need to wait, since bluetooth has been started long enough ago | ||
183 | ping(); | ||
184 | } // end if bluetooth not restarted | ||
185 | |||
186 | |||
187 | // start the dialog event loop, while the ping is starting (or will start soon) in the background | ||
188 | return bluepingDialog.exec(); | ||
189 | |||
190 | |||
191 | } | ||
192 | else | ||
193 | { | ||
194 | owarn << "No Bluetooth device has been set!" << oendl; | ||
195 | owarn << "We will consider it as a successful authentication though." << oendl; | ||
196 | return MultiauthPluginObject::Success; | ||
197 | } // end if mac defined | ||
198 | } | ||
diff --git a/noncore/securityplugins/blueping/bluepingplugin.h b/noncore/securityplugins/blueping/bluepingplugin.h new file mode 100644 index 0000000..c122471 --- a/dev/null +++ b/noncore/securityplugins/blueping/bluepingplugin.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /** | ||
2 | * \file bluepingplugin.h | ||
3 | * \brief Standard Opie multiauth plugin definition | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef BLUEPING_PLUGIN_H | ||
35 | #define BLUEPING_PLUGIN_H | ||
36 | |||
37 | #include <opie2/multiauthplugininterface.h> | ||
38 | |||
39 | #include <opie2/oprocess.h> | ||
40 | |||
41 | #include <qobject.h> | ||
42 | #include <qstring.h> | ||
43 | #include <qpe/config.h> | ||
44 | |||
45 | /// Multi-authentication bluetooth plugin, which tries to ping a specific MAC address. | ||
46 | /** | ||
47 | * The plugin itself, implementing the main authenticate() function. | ||
48 | */ | ||
49 | class BluepingPlugin : public QObject, public MultiauthPluginObject { | ||
50 | |||
51 | Q_OBJECT | ||
52 | |||
53 | public: | ||
54 | BluepingPlugin(); | ||
55 | virtual ~BluepingPlugin(); | ||
56 | int authenticate(); | ||
57 | MultiauthConfigWidget * configWidget(QWidget * parent); | ||
58 | QString pixmapNameConfig() const; | ||
59 | QString pixmapNameWidget() const; | ||
60 | QString pluginName() const; | ||
61 | |||
62 | signals: | ||
63 | /// Signal carrying the result code of this plugin | ||
64 | void emitCode(int resultCode); | ||
65 | |||
66 | private slots: | ||
67 | void success(); | ||
68 | void failure(); | ||
69 | void skip(); | ||
70 | void ping(); | ||
71 | void pingFinished(Opie::Core::OProcess * ping); | ||
72 | |||
73 | private: | ||
74 | Opie::Core::OProcess *m_ping; | ||
75 | Config * m_config; | ||
76 | bool bluetoothAlreadyRestarted; | ||
77 | QString macToPing; | ||
78 | |||
79 | }; | ||
80 | |||
81 | #endif | ||
diff --git a/noncore/securityplugins/blueping/bluepingplugin.pro b/noncore/securityplugins/blueping/bluepingplugin.pro new file mode 100644 index 0000000..1b92c16 --- a/dev/null +++ b/noncore/securityplugins/blueping/bluepingplugin.pro | |||
@@ -0,0 +1,18 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on | ||
3 | |||
4 | HEADERS = bluepingplugin.h bluepingpluginimpl.h | ||
5 | |||
6 | SOURCES = bluepingplugin.cpp bluepingpluginimpl.cpp | ||
7 | |||
8 | |||
9 | INCLUDEPATH+= $(OPIEDIR)/include | ||
10 | DEPENDPATH+= | ||
11 | |||
12 | LIBS += -lqpe -lopieui2 -lopiecore2 | ||
13 | |||
14 | DESTDIR = $(OPIEDIR)/plugins/security | ||
15 | TARGET = multiauthbluepingplugin | ||
16 | |||
17 | include ( $(OPIEDIR)/include.pro ) | ||
18 | |||
diff --git a/noncore/securityplugins/blueping/bluepingpluginimpl.cpp b/noncore/securityplugins/blueping/bluepingpluginimpl.cpp new file mode 100644 index 0000000..f7b1bfc --- a/dev/null +++ b/noncore/securityplugins/blueping/bluepingpluginimpl.cpp | |||
@@ -0,0 +1,28 @@ | |||
1 | #include "bluepingpluginimpl.h" | ||
2 | |||
3 | BluepingPluginImpl::BluepingPluginImpl() { | ||
4 | bluepingPlugin = new BluepingPlugin(); | ||
5 | } | ||
6 | |||
7 | BluepingPluginImpl::~BluepingPluginImpl() { | ||
8 | delete bluepingPlugin; | ||
9 | } | ||
10 | |||
11 | MultiauthPluginObject* BluepingPluginImpl::plugin() { | ||
12 | return bluepingPlugin; | ||
13 | } | ||
14 | |||
15 | Q_EXPORT_INTERFACE() { | ||
16 | Q_CREATE_INSTANCE( BluepingPluginImpl ) | ||
17 | } | ||
18 | |||
19 | QRESULT BluepingPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { | ||
20 | *iface = 0; | ||
21 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MultiauthPluginInterface ) ) { | ||
22 | *iface = this, (*iface)->addRef(); | ||
23 | } else { | ||
24 | return QE_NOINTERFACE; | ||
25 | } | ||
26 | return QS_OK; | ||
27 | |||
28 | } | ||
diff --git a/noncore/securityplugins/blueping/bluepingpluginimpl.h b/noncore/securityplugins/blueping/bluepingpluginimpl.h new file mode 100644 index 0000000..2fd023a --- a/dev/null +++ b/noncore/securityplugins/blueping/bluepingpluginimpl.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /** | ||
2 | * \file bluepingpluginimpl.h | ||
3 | * \brief Standard Opie multiauth plugin interface definition | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef BLUEPING_PLUGIN_IMPL_H | ||
35 | #define BLUEPING_PLUGIN_IMPL_H | ||
36 | |||
37 | #include "bluepingplugin.h" | ||
38 | |||
39 | /// Standard multiauth plugin class | ||
40 | class BluepingPluginImpl : public MultiauthPluginInterface{ | ||
41 | |||
42 | public: | ||
43 | BluepingPluginImpl(); | ||
44 | virtual ~BluepingPluginImpl(); | ||
45 | |||
46 | QRESULT queryInterface( const QUuid &, QUnknownInterface** ); | ||
47 | /// defines standard addRef() and release() functions | ||
48 | Q_REFCOUNT; | ||
49 | |||
50 | virtual MultiauthPluginObject *plugin(); | ||
51 | |||
52 | private: | ||
53 | /// the plugin itself | ||
54 | BluepingPlugin *bluepingPlugin; | ||
55 | ulong ref; | ||
56 | }; | ||
57 | |||
58 | #endif | ||
diff --git a/noncore/securityplugins/blueping/config.in b/noncore/securityplugins/blueping/config.in new file mode 100644 index 0000000..ec17c33 --- a/dev/null +++ b/noncore/securityplugins/blueping/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config MULTIAUTH_BLUEPING | ||
2 | boolean "opie-multiauth-blueping (blueping authentication plugin for opie-multiauth testing)" | ||
3 | default "y" | ||
4 | depends SECURITY | ||
diff --git a/noncore/securityplugins/dummy/.cvsignore b/noncore/securityplugins/dummy/.cvsignore new file mode 100644 index 0000000..a4e0e29 --- a/dev/null +++ b/noncore/securityplugins/dummy/.cvsignore | |||
@@ -0,0 +1,3 @@ | |||
1 | .moc | ||
2 | .obj | ||
3 | Makefile | ||
diff --git a/noncore/securityplugins/dummy/Makefile b/noncore/securityplugins/dummy/Makefile new file mode 100644 index 0000000..f6a1f9f --- a/dev/null +++ b/noncore/securityplugins/dummy/Makefile | |||
@@ -0,0 +1,204 @@ | |||
1 | ############################################################################# | ||
2 | # Makefile for building: libmultiauthdummyplugin.so.1.0.0 | ||
3 | # Generated by qmake (1.05a) (Qt 3.1.2) on: Mon Jun 14 11:00:19 2004 | ||
4 | # Project: dummyplugin.pro | ||
5 | # Template: lib | ||
6 | # Command: $(QMAKE) -o Makefile dummyplugin.pro | ||
7 | ############################################################################# | ||
8 | |||
9 | ####### Compiler, tools and options | ||
10 | |||
11 | CC = $(CCACHE) $(DISTCC) gcc | ||
12 | CXX = $(CCACHE) $(DISTCC) g++ | ||
13 | LEX = flex | ||
14 | YACC = yacc | ||
15 | CFLAGS = -pipe $(CFLAGS_EXTRA) -Wall -W -g -fPIC -DQT_COMPONENT_DEBUG=2 -DQT_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION -DOPIE_SOUND_FRAGMENT_SHIFT=16 | ||
16 | CXXFLAGS = -pipe $(CFLAGS_EXTRA) -DQWS -fno-exceptions -fno-rtti $(CXXFLAGS_EXTRA) -Wall -W -g -fPIC -DQT_COMPONENT_DEBUG=2 -DQT_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION -DOPIE_SOUND_FRAGMENT_SHIFT=16 | ||
17 | LEXFLAGS = | ||
18 | YACCFLAGS= -d | ||
19 | INCPATH = -I/opt/opie/mkspecs/qws/linux-generic-g++ -I. -I$(OPIEDIR)/include -I$(QTDIR)/include -I.moc/$(PLATFORM)/ | ||
20 | LINK = g++ | ||
21 | LFLAGS = $(LFLAGS_EXTRA) -Wl,-rpath-link,$(OPIEDIR)/lib -shared -Wl,-soname,libmultiauthdummyplugin.so.1 -Wl,-rpath,/opt/opie/plugins/security | ||
22 | LIBS = $(SUBLIBS) -Wl,-rpath,$(QTDIR)/lib -L$(QTDIR)/lib $(LIBS_EXTRA) -lqpe -lopieui2 -L$(OPIEDIR)/lib -lqte | ||
23 | AR = ar cqs | ||
24 | RANLIB = | ||
25 | MOC = $(QTDIR)/bin/moc | ||
26 | UIC = $(QTDIR)/bin/uic | ||
27 | QMAKE = qmake | ||
28 | TAR = tar -cf | ||
29 | GZIP = gzip -9f | ||
30 | COPY = cp -f | ||
31 | COPY_FILE= $(COPY) -p | ||
32 | COPY_DIR = $(COPY) -pR | ||
33 | DEL_FILE = rm -f | ||
34 | SYMLINK = ln -sf | ||
35 | DEL_DIR = rmdir | ||
36 | MOVE = mv -f | ||
37 | PRO = dummyplugin.pro | ||
38 | CHK_DIR_EXISTS= | ||
39 | MKDIR = | ||
40 | |||
41 | ####### Output directory | ||
42 | |||
43 | OBJECTS_DIR = .obj/$(PLATFORM)/ | ||
44 | |||
45 | ####### Files | ||
46 | |||
47 | HEADERS = dummyplugin.h \ | ||
48 | dummypluginimpl.h | ||
49 | SOURCES = dummyplugin.cpp \ | ||
50 | dummypluginimpl.cpp | ||
51 | OBJECTS = .obj/$(PLATFORM)/dummyplugin.o \ | ||
52 | .obj/$(PLATFORM)/dummypluginimpl.o | ||
53 | FORMS = | ||
54 | UICDECLS = | ||
55 | UICIMPLS = | ||
56 | SRCMOC = .moc/$(PLATFORM)/moc_dummyplugin.cpp | ||
57 | OBJMOC = .obj/$(PLATFORM)/moc_dummyplugin.o | ||
58 | DIST = ../../../gen.pro \ | ||
59 | ../../../include.pro \ | ||
60 | dummyplugin.pro | ||
61 | QMAKE_TARGET = multiauthdummyplugin | ||
62 | DESTDIR = $(OPIEDIR)/plugins/security/ | ||
63 | TARGET = libmultiauthdummyplugin.so.1.0.0 | ||
64 | TARGETA= $(OPIEDIR)/plugins/security/libmultiauthdummyplugin.a | ||
65 | TARGETD= libmultiauthdummyplugin.so.1.0.0 | ||
66 | TARGET0= libmultiauthdummyplugin.so | ||
67 | TARGET1= libmultiauthdummyplugin.so.1 | ||
68 | TARGET2= libmultiauthdummyplugin.so.1.0 | ||
69 | |||
70 | first: all | ||
71 | ####### Implicit rules | ||
72 | |||
73 | .SUFFIXES: .c .cpp .cc .cxx .C | ||
74 | |||
75 | .cpp.o: | ||
76 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
77 | |||
78 | .cc.o: | ||
79 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
80 | |||
81 | .cxx.o: | ||
82 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
83 | |||
84 | .C.o: | ||
85 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
86 | |||
87 | .c.o: | ||
88 | $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< | ||
89 | |||
90 | ####### Build rules | ||
91 | |||
92 | all: Makefile $(OPIEDIR)/plugins/security/$(TARGET) | ||
93 | |||
94 | $(OPIEDIR)/plugins/security/$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) | ||
95 | test -d $(OPIEDIR)/plugins/security/ || mkdir -p $(OPIEDIR)/plugins/security/ | ||
96 | -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) | ||
97 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) | ||
98 | -ln -s $(TARGET) $(TARGET0) | ||
99 | -ln -s $(TARGET) $(TARGET1) | ||
100 | -ln -s $(TARGET) $(TARGET2) | ||
101 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET) | ||
102 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET0) | ||
103 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET1) | ||
104 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET2) | ||
105 | -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) $(OPIEDIR)/plugins/security/ | ||
106 | |||
107 | |||
108 | |||
109 | staticlib: $(TARGETA) | ||
110 | |||
111 | $(TARGETA): $(UICDECLS) $(OBJECTS) $(OBJMOC) | ||
112 | -$(DEL_FILE) $(TARGETA) | ||
113 | $(AR) $(TARGETA) $(OBJECTS) $(OBJMOC) | ||
114 | |||
115 | mocables: $(SRCMOC) | ||
116 | |||
117 | $(MOC): | ||
118 | ( cd $(QTDIR)/src/moc ; $(MAKE) ) | ||
119 | |||
120 | Makefile: dummyplugin.pro /opt/opie/mkspecs/qws/linux-generic-g++/qmake.conf ../../../gen.pro \ | ||
121 | ../../../include.pro | ||
122 | $(QMAKE) -o Makefile dummyplugin.pro | ||
123 | qmake: | ||
124 | @$(QMAKE) -o Makefile dummyplugin.pro | ||
125 | |||
126 | dist: | ||
127 | @mkdir -p .obj/$(PLATFORM)/multiauthdummyplugin && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .obj/$(PLATFORM)/multiauthdummyplugin/ && ( cd `dirname .obj/$(PLATFORM)/multiauthdummyplugin` && $(TAR) multiauthdummyplugin.tar multiauthdummyplugin && $(GZIP) multiauthdummyplugin.tar ) && $(MOVE) `dirname .obj/$(PLATFORM)/multiauthdummyplugin`/multiauthdummyplugin.tar.gz . && $(DEL_FILE) -r .obj/$(PLATFORM)/multiauthdummyplugin | ||
128 | |||
129 | mocclean: | ||
130 | -$(DEL_FILE) $(OBJMOC) | ||
131 | -$(DEL_FILE) $(SRCMOC) | ||
132 | |||
133 | uiclean: | ||
134 | |||
135 | yaccclean: | ||
136 | lexclean: | ||
137 | clean: mocclean | ||
138 | -$(DEL_FILE) $(OBJECTS) | ||
139 | -$(DEL_FILE) *~ core *.core | ||
140 | |||
141 | |||
142 | ####### Sub-libraries | ||
143 | |||
144 | distclean: clean | ||
145 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET) $(TARGET) | ||
146 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET0) $(OPIEDIR)/plugins/security/$(TARGET1) $(OPIEDIR)/plugins/security/$(TARGET2) $(TARGETA) | ||
147 | |||
148 | |||
149 | lupdate: | ||
150 | lupdate -noobsolete $(PRO) | ||
151 | |||
152 | lrelease: | ||
153 | lrelease $(PRO) | ||
154 | |||
155 | ipk: | ||
156 | tmp=`mktemp -d /tmp/ipkg-opie.XXXXXXXXXX` && ( $(MAKE) INSTALL_ROOT="" install && ipkg-build ; rm -rf ; ) | ||
157 | |||
158 | opie-lupdate: | ||
159 | opie-lupdate $(PRO) | ||
160 | |||
161 | opie-lrelease: | ||
162 | opie-lrelease $(PRO) | ||
163 | |||
164 | messages: | ||
165 | xgettext -C -n -ktr -kQT_TRANSLATE_NOOP dummyplugin.h dummypluginimpl.h dummyplugin.cpp dummypluginimpl.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-tr.po' && xgettext -C -n -a dummyplugin.h dummypluginimpl.h dummyplugin.cpp dummypluginimpl.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-allstrings.po' | ||
166 | |||
167 | FORCE: | ||
168 | |||
169 | ####### Compile | ||
170 | |||
171 | .obj/$(PLATFORM)/dummyplugin.o: dummyplugin.cpp dummyplugin.h | ||
172 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/dummyplugin.o dummyplugin.cpp | ||
173 | |||
174 | .obj/$(PLATFORM)/dummypluginimpl.o: dummypluginimpl.cpp dummypluginimpl.h \ | ||
175 | dummyplugin.h | ||
176 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/dummypluginimpl.o dummypluginimpl.cpp | ||
177 | |||
178 | .obj/$(PLATFORM)/moc_dummyplugin.o: .moc/$(PLATFORM)/moc_dummyplugin.cpp dummyplugin.h | ||
179 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/moc_dummyplugin.o .moc/$(PLATFORM)/moc_dummyplugin.cpp | ||
180 | |||
181 | .moc/x86-linux/moc_dummyplugin.cpp: $(MOC) dummyplugin.h | ||
182 | $(MOC) dummyplugin.h -o .moc/x86-linux/moc_dummyplugin.cpp | ||
183 | |||
184 | ####### Install | ||
185 | |||
186 | install_target: | ||
187 | @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" || $(MKDIR) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" | ||
188 | -$(COPY) "$(OPIEDIR)/plugins/security/$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET)" | ||
189 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET0)" | ||
190 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET1)" | ||
191 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET2)" | ||
192 | |||
193 | uninstall_target: | ||
194 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET)" | ||
195 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET0)" | ||
196 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET1)" | ||
197 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET2)" | ||
198 | -$(DEL_DIR) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" | ||
199 | |||
200 | |||
201 | install: all install_target | ||
202 | |||
203 | uninstall: uninstall_target | ||
204 | |||
diff --git a/noncore/securityplugins/dummy/config.in b/noncore/securityplugins/dummy/config.in new file mode 100644 index 0000000..2053eef --- a/dev/null +++ b/noncore/securityplugins/dummy/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config MULTIAUTH_DUMMY | ||
2 | boolean "opie-multiauth-dummy (dummy authentication plugin for opie-multiauth testing)" | ||
3 | default "y" | ||
4 | depends SECURITY | ||
diff --git a/noncore/securityplugins/dummy/dummyplugin.control b/noncore/securityplugins/dummy/dummyplugin.control new file mode 100644 index 0000000..1bd9700 --- a/dev/null +++ b/noncore/securityplugins/dummy/dummyplugin.control | |||
@@ -0,0 +1,11 @@ | |||
1 | Package: opie-multiauth-dummyplugin | ||
2 | Files: plugins/security/libmultiauthdummyplugin.so* pics/security/dummyplugin.png | ||
3 | Priority: optional | ||
4 | Section: opie/settings | ||
5 | Maintainer: Clement Seveillac <clement@nist.gov> | ||
6 | Architecture: arm | ||
7 | Version: 0.0.2.3 | ||
8 | Depends: opie-security | ||
9 | Description: Dummy plugin for opie-security authentication. | ||
10 | This is a very simple authentication plugin (you just have | ||
11 | to press a button basically), for demonstration purpose. | ||
diff --git a/noncore/securityplugins/dummy/dummyplugin.cpp b/noncore/securityplugins/dummy/dummyplugin.cpp new file mode 100644 index 0000000..0d19e43 --- a/dev/null +++ b/noncore/securityplugins/dummy/dummyplugin.cpp | |||
@@ -0,0 +1,92 @@ | |||
1 | #include "dummyplugin.h" | ||
2 | |||
3 | #include <opie2/oapplication.h> | ||
4 | |||
5 | #include <qdialog.h> | ||
6 | #include <qlayout.h> | ||
7 | #include <qlabel.h> | ||
8 | #include <qpushbutton.h> | ||
9 | |||
10 | /// Simply return its name (Dummy plugin) | ||
11 | QString DummyPlugin::pluginName() const { | ||
12 | return "Dummy plugin"; | ||
13 | } | ||
14 | |||
15 | /// no configuration widget for the moment | ||
16 | MultiauthConfigWidget * DummyPlugin::configWidget(QWidget * parent) { | ||
17 | return 0l; | ||
18 | } | ||
19 | QString DummyPlugin::pixmapNameWidget() const { | ||
20 | return "security/dummyplugin"; | ||
21 | } | ||
22 | QString DummyPlugin::pixmapNameConfig() const { | ||
23 | return 0l; | ||
24 | } | ||
25 | |||
26 | /// Emit the MultiauthPluginObject::Success emitCode | ||
27 | void DummyPlugin::success() { | ||
28 | emit emitCode(MultiauthPluginObject::Success); | ||
29 | } | ||
30 | |||
31 | /// Emit the MultiauthPluginObject::Failure emitCode | ||
32 | void DummyPlugin::failure() { | ||
33 | emit emitCode(MultiauthPluginObject::Failure); | ||
34 | } | ||
35 | |||
36 | /// Emit the MultiauthPluginObject::Skip emitCode | ||
37 | void DummyPlugin::skip() { | ||
38 | emit emitCode(MultiauthPluginObject::Skip); | ||
39 | } | ||
40 | |||
41 | /// Make one authentication attempt with this plugin | ||
42 | /** | ||
43 | * (very simple "success" / "failure" buttons in a dialog) | ||
44 | * \return The outcome code of this authentication | ||
45 | */ | ||
46 | int DummyPlugin::authenticate() { | ||
47 | |||
48 | /* Standard, inescapable authentication dialog | ||
49 | */ | ||
50 | QDialog dummyDialog(0, | ||
51 | "Dummy dialog", | ||
52 | TRUE, | ||
53 | Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop); | ||
54 | |||
55 | QRect desk = oApp->desktop()->geometry(); | ||
56 | dummyDialog.setGeometry( 0, 0, desk.width(), desk.height() ); | ||
57 | |||
58 | /* Creation of the particular widgets of our Dummy user interface | ||
59 | * Note: we have to resize the VBox to the QDialog size, since it's not | ||
60 | * done automatically. | ||
61 | */ | ||
62 | QVBoxLayout layout(&dummyDialog); | ||
63 | layout.setSpacing(11); | ||
64 | layout.setMargin(11); | ||
65 | layout.setAlignment( Qt::AlignTop ); | ||
66 | |||
67 | QLabel title("<center><h1>" + tr("\"Dummy\" <br />demonstration plugin") + "</h1></center>", &dummyDialog); | ||
68 | QLabel subTitle("<center><h2>" +tr("You can simulate the following outcomes:") + "</h2></center>", &dummyDialog); | ||
69 | layout.addWidget(&title); | ||
70 | layout.addWidget(&subTitle); | ||
71 | |||
72 | QHBoxLayout hl(&layout); | ||
73 | QPushButton pbSuccess("Success", &dummyDialog); | ||
74 | QPushButton pbSkip("Skip", &dummyDialog); | ||
75 | QPushButton pbFailure("Failure", &dummyDialog); | ||
76 | hl.addWidget(&pbSuccess, 0, Qt::AlignHCenter); | ||
77 | hl.addWidget(&pbSkip, 0, Qt::AlignHCenter); | ||
78 | hl.addWidget(&pbFailure, 0, Qt::AlignHCenter); | ||
79 | |||
80 | /* Linking our pushbuttons to exit functions | ||
81 | * (each result button here has a corresponding slot) | ||
82 | */ | ||
83 | QObject::connect(&pbSuccess, SIGNAL(clicked()), this, SLOT(success())); | ||
84 | QObject::connect(&pbFailure, SIGNAL(clicked()), this, SLOT(failure())); | ||
85 | QObject::connect(&pbSkip, SIGNAL(clicked()), this, SLOT(skip())); | ||
86 | |||
87 | /* The value of the signal these three slots will emit corresponds to | ||
88 | * the different values we want to return | ||
89 | */ | ||
90 | QObject::connect(this, SIGNAL(emitCode(int)), &dummyDialog, SLOT(done(int))); | ||
91 | return dummyDialog.exec(); | ||
92 | } | ||
diff --git a/noncore/securityplugins/dummy/dummyplugin.h b/noncore/securityplugins/dummy/dummyplugin.h new file mode 100644 index 0000000..9680dff --- a/dev/null +++ b/noncore/securityplugins/dummy/dummyplugin.h | |||
@@ -0,0 +1,66 @@ | |||
1 | /** | ||
2 | * \file dummyplugin.h | ||
3 | * \brief Standard Opie multiauth plugin definition | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef DUMMY_PLUGIN_H | ||
35 | #define DUMMY_PLUGIN_H | ||
36 | |||
37 | #include <qobject.h> | ||
38 | #include <qstring.h> | ||
39 | #include <opie2/multiauthplugininterface.h> | ||
40 | |||
41 | /// Multi-authentication example plugin, implementing a trivial 'yes/no' verification. | ||
42 | /** | ||
43 | * The plugin itself, implementing the main authenticate() function. | ||
44 | */ | ||
45 | class DummyPlugin : public QObject, public MultiauthPluginObject { | ||
46 | |||
47 | Q_OBJECT | ||
48 | |||
49 | public: | ||
50 | int authenticate(); | ||
51 | MultiauthConfigWidget * configWidget(QWidget * parent); | ||
52 | QString pixmapNameConfig() const; | ||
53 | QString pixmapNameWidget() const; | ||
54 | QString pluginName() const; | ||
55 | |||
56 | signals: | ||
57 | /// Signal carrying the result code of this plugin | ||
58 | void emitCode(int resultCode); | ||
59 | |||
60 | private slots: | ||
61 | void success(); | ||
62 | void failure(); | ||
63 | void skip(); | ||
64 | }; | ||
65 | |||
66 | #endif | ||
diff --git a/noncore/securityplugins/dummy/dummyplugin.pro b/noncore/securityplugins/dummy/dummyplugin.pro new file mode 100644 index 0000000..bb9971c --- a/dev/null +++ b/noncore/securityplugins/dummy/dummyplugin.pro | |||
@@ -0,0 +1,19 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on | ||
3 | CONFIG -= moc | ||
4 | |||
5 | HEADERS = dummyplugin.h dummypluginimpl.h | ||
6 | |||
7 | SOURCES = dummyplugin.cpp dummypluginimpl.cpp | ||
8 | |||
9 | |||
10 | INCLUDEPATH+= $(OPIEDIR)/include | ||
11 | DEPENDPATH+= | ||
12 | |||
13 | LIBS += -lqpe -lopieui2 | ||
14 | |||
15 | DESTDIR = $(OPIEDIR)/plugins/security | ||
16 | TARGET = multiauthdummyplugin | ||
17 | |||
18 | include ( $(OPIEDIR)/include.pro ) | ||
19 | |||
diff --git a/noncore/securityplugins/dummy/dummypluginimpl.cpp b/noncore/securityplugins/dummy/dummypluginimpl.cpp new file mode 100644 index 0000000..518996c --- a/dev/null +++ b/noncore/securityplugins/dummy/dummypluginimpl.cpp | |||
@@ -0,0 +1,28 @@ | |||
1 | #include "dummypluginimpl.h" | ||
2 | |||
3 | DummyPluginImpl::DummyPluginImpl() { | ||
4 | dummyPlugin = new DummyPlugin(); | ||
5 | } | ||
6 | |||
7 | DummyPluginImpl::~DummyPluginImpl() { | ||
8 | delete dummyPlugin; | ||
9 | } | ||
10 | |||
11 | MultiauthPluginObject* DummyPluginImpl::plugin() { | ||
12 | return dummyPlugin; | ||
13 | } | ||
14 | |||
15 | Q_EXPORT_INTERFACE() { | ||
16 | Q_CREATE_INSTANCE( DummyPluginImpl ) | ||
17 | } | ||
18 | |||
19 | QRESULT DummyPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { | ||
20 | *iface = 0; | ||
21 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MultiauthPluginInterface ) ) { | ||
22 | *iface = this, (*iface)->addRef(); | ||
23 | } else { | ||
24 | return QE_NOINTERFACE; | ||
25 | } | ||
26 | return QS_OK; | ||
27 | |||
28 | } | ||
diff --git a/noncore/securityplugins/dummy/dummypluginimpl.h b/noncore/securityplugins/dummy/dummypluginimpl.h new file mode 100644 index 0000000..49a18cd --- a/dev/null +++ b/noncore/securityplugins/dummy/dummypluginimpl.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /** | ||
2 | * \file dummypluginimpl.h | ||
3 | * \brief Standard Opie multiauth plugin interface definition | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef DUMMY_PLUGIN_IMPL_H | ||
35 | #define DUMMY_PLUGIN_IMPL_H | ||
36 | |||
37 | #include "dummyplugin.h" | ||
38 | |||
39 | /// Standard multiauth plugin class | ||
40 | class DummyPluginImpl : public MultiauthPluginInterface{ | ||
41 | |||
42 | public: | ||
43 | DummyPluginImpl(); | ||
44 | virtual ~DummyPluginImpl(); | ||
45 | |||
46 | QRESULT queryInterface( const QUuid &, QUnknownInterface** ); | ||
47 | /// defines standard addRef() and release() functions | ||
48 | Q_REFCOUNT; | ||
49 | |||
50 | virtual MultiauthPluginObject *plugin(); | ||
51 | |||
52 | private: | ||
53 | /// the plugin itself | ||
54 | DummyPlugin *dummyPlugin; | ||
55 | ulong ref; | ||
56 | }; | ||
57 | |||
58 | #endif | ||
diff --git a/noncore/securityplugins/notice/.cvsignore b/noncore/securityplugins/notice/.cvsignore new file mode 100644 index 0000000..a4e0e29 --- a/dev/null +++ b/noncore/securityplugins/notice/.cvsignore | |||
@@ -0,0 +1,3 @@ | |||
1 | .moc | ||
2 | .obj | ||
3 | Makefile | ||
diff --git a/noncore/securityplugins/notice/Makefile b/noncore/securityplugins/notice/Makefile new file mode 100644 index 0000000..6303951 --- a/dev/null +++ b/noncore/securityplugins/notice/Makefile | |||
@@ -0,0 +1,212 @@ | |||
1 | ############################################################################# | ||
2 | # Makefile for building: libmultiauthnoticeplugin.so.1.0.0 | ||
3 | # Generated by qmake (1.05a) (Qt 3.1.2) on: Mon Jun 14 11:00:20 2004 | ||
4 | # Project: noticeplugin.pro | ||
5 | # Template: lib | ||
6 | # Command: $(QMAKE) -o Makefile noticeplugin.pro | ||
7 | ############################################################################# | ||
8 | |||
9 | ####### Compiler, tools and options | ||
10 | |||
11 | CC = $(CCACHE) $(DISTCC) gcc | ||
12 | CXX = $(CCACHE) $(DISTCC) g++ | ||
13 | LEX = flex | ||
14 | YACC = yacc | ||
15 | CFLAGS = -pipe $(CFLAGS_EXTRA) -Wall -W -g -fPIC -DQT_COMPONENT_DEBUG=2 -DQT_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION -DOPIE_SOUND_FRAGMENT_SHIFT=16 | ||
16 | CXXFLAGS = -pipe $(CFLAGS_EXTRA) -DQWS -fno-exceptions -fno-rtti $(CXXFLAGS_EXTRA) -Wall -W -g -fPIC -DQT_COMPONENT_DEBUG=2 -DQT_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION -DOPIE_SOUND_FRAGMENT_SHIFT=16 | ||
17 | LEXFLAGS = | ||
18 | YACCFLAGS= -d | ||
19 | INCPATH = -I/opt/opie/mkspecs/qws/linux-generic-g++ -I. -I$(OPIEDIR)/include -I$(QTDIR)/include -I.moc/$(PLATFORM)/ | ||
20 | LINK = g++ | ||
21 | LFLAGS = $(LFLAGS_EXTRA) -Wl,-rpath-link,$(OPIEDIR)/lib -shared -Wl,-soname,libmultiauthnoticeplugin.so.1 -Wl,-rpath,/opt/opie/plugins/security | ||
22 | LIBS = $(SUBLIBS) -Wl,-rpath,$(QTDIR)/lib -L$(QTDIR)/lib $(LIBS_EXTRA) -lqpe -lopieui2 -L$(OPIEDIR)/lib -lqte | ||
23 | AR = ar cqs | ||
24 | RANLIB = | ||
25 | MOC = $(QTDIR)/bin/moc | ||
26 | UIC = $(QTDIR)/bin/uic | ||
27 | QMAKE = qmake | ||
28 | TAR = tar -cf | ||
29 | GZIP = gzip -9f | ||
30 | COPY = cp -f | ||
31 | COPY_FILE= $(COPY) -p | ||
32 | COPY_DIR = $(COPY) -pR | ||
33 | DEL_FILE = rm -f | ||
34 | SYMLINK = ln -sf | ||
35 | DEL_DIR = rmdir | ||
36 | MOVE = mv -f | ||
37 | PRO = noticeplugin.pro | ||
38 | CHK_DIR_EXISTS= | ||
39 | MKDIR = | ||
40 | |||
41 | ####### Output directory | ||
42 | |||
43 | OBJECTS_DIR = .obj/$(PLATFORM)/ | ||
44 | |||
45 | ####### Files | ||
46 | |||
47 | HEADERS = noticeplugin.h \ | ||
48 | noticepluginimpl.h \ | ||
49 | noticeConfigWidget.h | ||
50 | SOURCES = noticeplugin.cpp \ | ||
51 | noticepluginimpl.cpp \ | ||
52 | noticeConfigWidget.cpp | ||
53 | OBJECTS = .obj/$(PLATFORM)/noticeplugin.o \ | ||
54 | .obj/$(PLATFORM)/noticepluginimpl.o \ | ||
55 | .obj/$(PLATFORM)/noticeConfigWidget.o | ||
56 | FORMS = | ||
57 | UICDECLS = | ||
58 | UICIMPLS = | ||
59 | SRCMOC = .moc/$(PLATFORM)/moc_noticeConfigWidget.cpp | ||
60 | OBJMOC = .obj/$(PLATFORM)/moc_noticeConfigWidget.o | ||
61 | DIST = ../../../gen.pro \ | ||
62 | ../../../include.pro \ | ||
63 | noticeplugin.pro | ||
64 | QMAKE_TARGET = multiauthnoticeplugin | ||
65 | DESTDIR = $(OPIEDIR)/plugins/security/ | ||
66 | TARGET = libmultiauthnoticeplugin.so.1.0.0 | ||
67 | TARGETA= $(OPIEDIR)/plugins/security/libmultiauthnoticeplugin.a | ||
68 | TARGETD= libmultiauthnoticeplugin.so.1.0.0 | ||
69 | TARGET0= libmultiauthnoticeplugin.so | ||
70 | TARGET1= libmultiauthnoticeplugin.so.1 | ||
71 | TARGET2= libmultiauthnoticeplugin.so.1.0 | ||
72 | |||
73 | first: all | ||
74 | ####### Implicit rules | ||
75 | |||
76 | .SUFFIXES: .c .cpp .cc .cxx .C | ||
77 | |||
78 | .cpp.o: | ||
79 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
80 | |||
81 | .cc.o: | ||
82 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
83 | |||
84 | .cxx.o: | ||
85 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
86 | |||
87 | .C.o: | ||
88 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
89 | |||
90 | .c.o: | ||
91 | $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< | ||
92 | |||
93 | ####### Build rules | ||
94 | |||
95 | all: Makefile $(OPIEDIR)/plugins/security/$(TARGET) | ||
96 | |||
97 | $(OPIEDIR)/plugins/security/$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) | ||
98 | test -d $(OPIEDIR)/plugins/security/ || mkdir -p $(OPIEDIR)/plugins/security/ | ||
99 | -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) | ||
100 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) | ||
101 | -ln -s $(TARGET) $(TARGET0) | ||
102 | -ln -s $(TARGET) $(TARGET1) | ||
103 | -ln -s $(TARGET) $(TARGET2) | ||
104 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET) | ||
105 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET0) | ||
106 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET1) | ||
107 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET2) | ||
108 | -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) $(OPIEDIR)/plugins/security/ | ||
109 | |||
110 | |||
111 | |||
112 | staticlib: $(TARGETA) | ||
113 | |||
114 | $(TARGETA): $(UICDECLS) $(OBJECTS) $(OBJMOC) | ||
115 | -$(DEL_FILE) $(TARGETA) | ||
116 | $(AR) $(TARGETA) $(OBJECTS) $(OBJMOC) | ||
117 | |||
118 | mocables: $(SRCMOC) | ||
119 | |||
120 | $(MOC): | ||
121 | ( cd $(QTDIR)/src/moc ; $(MAKE) ) | ||
122 | |||
123 | Makefile: noticeplugin.pro /opt/opie/mkspecs/qws/linux-generic-g++/qmake.conf ../../../gen.pro \ | ||
124 | ../../../include.pro | ||
125 | $(QMAKE) -o Makefile noticeplugin.pro | ||
126 | qmake: | ||
127 | @$(QMAKE) -o Makefile noticeplugin.pro | ||
128 | |||
129 | dist: | ||
130 | @mkdir -p .obj/$(PLATFORM)/multiauthnoticeplugin && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .obj/$(PLATFORM)/multiauthnoticeplugin/ && ( cd `dirname .obj/$(PLATFORM)/multiauthnoticeplugin` && $(TAR) multiauthnoticeplugin.tar multiauthnoticeplugin && $(GZIP) multiauthnoticeplugin.tar ) && $(MOVE) `dirname .obj/$(PLATFORM)/multiauthnoticeplugin`/multiauthnoticeplugin.tar.gz . && $(DEL_FILE) -r .obj/$(PLATFORM)/multiauthnoticeplugin | ||
131 | |||
132 | mocclean: | ||
133 | -$(DEL_FILE) $(OBJMOC) | ||
134 | -$(DEL_FILE) $(SRCMOC) | ||
135 | |||
136 | uiclean: | ||
137 | |||
138 | yaccclean: | ||
139 | lexclean: | ||
140 | clean: mocclean | ||
141 | -$(DEL_FILE) $(OBJECTS) | ||
142 | -$(DEL_FILE) *~ core *.core | ||
143 | |||
144 | |||
145 | ####### Sub-libraries | ||
146 | |||
147 | distclean: clean | ||
148 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET) $(TARGET) | ||
149 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET0) $(OPIEDIR)/plugins/security/$(TARGET1) $(OPIEDIR)/plugins/security/$(TARGET2) $(TARGETA) | ||
150 | |||
151 | |||
152 | lupdate: | ||
153 | lupdate -noobsolete $(PRO) | ||
154 | |||
155 | lrelease: | ||
156 | lrelease $(PRO) | ||
157 | |||
158 | ipk: | ||
159 | tmp=`mktemp -d /tmp/ipkg-opie.XXXXXXXXXX` && ( $(MAKE) INSTALL_ROOT="" install && ipkg-build ; rm -rf ; ) | ||
160 | |||
161 | opie-lupdate: | ||
162 | opie-lupdate $(PRO) | ||
163 | |||
164 | opie-lrelease: | ||
165 | opie-lrelease $(PRO) | ||
166 | |||
167 | messages: | ||
168 | xgettext -C -n -ktr -kQT_TRANSLATE_NOOP noticeplugin.h noticepluginimpl.h noticeConfigWidget.h noticeplugin.cpp noticepluginimpl.cpp noticeConfigWidget.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-tr.po' && xgettext -C -n -a noticeplugin.h noticepluginimpl.h noticeConfigWidget.h noticeplugin.cpp noticepluginimpl.cpp noticeConfigWidget.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-allstrings.po' | ||
169 | |||
170 | FORCE: | ||
171 | |||
172 | ####### Compile | ||
173 | |||
174 | .obj/$(PLATFORM)/noticeplugin.o: noticeplugin.cpp noticeplugin.h \ | ||
175 | noticeConfigWidget.h | ||
176 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/noticeplugin.o noticeplugin.cpp | ||
177 | |||
178 | .obj/$(PLATFORM)/noticepluginimpl.o: noticepluginimpl.cpp noticepluginimpl.h \ | ||
179 | noticeplugin.h \ | ||
180 | noticeConfigWidget.h | ||
181 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/noticepluginimpl.o noticepluginimpl.cpp | ||
182 | |||
183 | .obj/$(PLATFORM)/noticeConfigWidget.o: noticeConfigWidget.cpp noticeConfigWidget.h | ||
184 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/noticeConfigWidget.o noticeConfigWidget.cpp | ||
185 | |||
186 | .obj/$(PLATFORM)/moc_noticeConfigWidget.o: .moc/$(PLATFORM)/moc_noticeConfigWidget.cpp noticeConfigWidget.h | ||
187 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/moc_noticeConfigWidget.o .moc/$(PLATFORM)/moc_noticeConfigWidget.cpp | ||
188 | |||
189 | .moc/x86-linux/moc_noticeConfigWidget.cpp: $(MOC) noticeConfigWidget.h | ||
190 | $(MOC) noticeConfigWidget.h -o .moc/x86-linux/moc_noticeConfigWidget.cpp | ||
191 | |||
192 | ####### Install | ||
193 | |||
194 | install_target: | ||
195 | @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" || $(MKDIR) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" | ||
196 | -$(COPY) "$(OPIEDIR)/plugins/security/$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET)" | ||
197 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET0)" | ||
198 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET1)" | ||
199 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET2)" | ||
200 | |||
201 | uninstall_target: | ||
202 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET)" | ||
203 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET0)" | ||
204 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET1)" | ||
205 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET2)" | ||
206 | -$(DEL_DIR) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" | ||
207 | |||
208 | |||
209 | install: all install_target | ||
210 | |||
211 | uninstall: uninstall_target | ||
212 | |||
diff --git a/noncore/securityplugins/notice/config.in b/noncore/securityplugins/notice/config.in new file mode 100644 index 0000000..bfc649e --- a/dev/null +++ b/noncore/securityplugins/notice/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config MULTIAUTH_NOTICE | ||
2 | boolean "opie-multiauth-notice (Notice plugin for opie-multiauth)" | ||
3 | default "y" | ||
4 | depends SECURITY | ||
diff --git a/noncore/securityplugins/notice/notice.control b/noncore/securityplugins/notice/notice.control new file mode 100644 index 0000000..890e0c9 --- a/dev/null +++ b/noncore/securityplugins/notice/notice.control | |||
@@ -0,0 +1,11 @@ | |||
1 | Package: opie-multiauth-noticeplugin | ||
2 | Files: plugins/security/libmultiauthnoticeplugin.so* pics/security/noticeplugin.png pics/security/noticeplugin_small.png | ||
3 | Priority: optional | ||
4 | Section: opie/settings | ||
5 | Maintainer: Clement Seveillac <clement@nist.gov> | ||
6 | Architecture: arm | ||
7 | Version: 0.0.1.6 | ||
8 | Depends: opie-security | ||
9 | Description: Notice plugin for opie-security authentication. | ||
10 | It allows you to display, for example, a notice from your legal departement. | ||
11 | |||
diff --git a/noncore/securityplugins/notice/noticeConfigWidget.cpp b/noncore/securityplugins/notice/noticeConfigWidget.cpp new file mode 100644 index 0000000..e2c2d83 --- a/dev/null +++ b/noncore/securityplugins/notice/noticeConfigWidget.cpp | |||
@@ -0,0 +1,81 @@ | |||
1 | #include "noticeConfigWidget.h" | ||
2 | |||
3 | #include <opie2/odebug.h> | ||
4 | |||
5 | #include <qwidget.h> | ||
6 | #include <qlayout.h> | ||
7 | #include <qlabel.h> | ||
8 | #include <qregexp.h> | ||
9 | #include <qgroupbox.h> | ||
10 | |||
11 | /// constructs the widget, filling the noticeMLE QMultiLineEdit with the "noticeText" entry | ||
12 | NoticeConfigWidget::NoticeConfigWidget(QWidget* parent = 0, const char* name = "Notice configuration widget") : MultiauthConfigWidget(parent, name) | ||
13 | { | ||
14 | QVBoxLayout *baseLayout = new QVBoxLayout( this); | ||
15 | baseLayout->setSpacing(11); | ||
16 | baseLayout->setMargin(6); | ||
17 | baseLayout->setAlignment( Qt::AlignTop ); | ||
18 | |||
19 | QGroupBox *configBox = new QGroupBox(0, Qt::Vertical, tr("Set the message the user must accept"), this); | ||
20 | baseLayout->addWidget(configBox); | ||
21 | QVBoxLayout *boxLayout = new QVBoxLayout( configBox->layout() ); | ||
22 | |||
23 | QLabel * comment1 = new QLabel("<p><em>" + tr("You may want to consult your legal department for proper wording here.") + "</em></p>", configBox); | ||
24 | boxLayout->addWidget(comment1); | ||
25 | |||
26 | // Set the multilineedit box text to getNoticeText() | ||
27 | noticeMLE = new QMultiLineEdit(configBox, "notice text"); | ||
28 | noticeMLE->setWordWrap(QMultiLineEdit::WidgetWidth); | ||
29 | noticeMLE->setFocus(); | ||
30 | noticeMLE->setText(getNoticeText()); | ||
31 | boxLayout->addWidget(noticeMLE); | ||
32 | |||
33 | resetNoticeButton = new QPushButton( tr("Reset notice to default"), configBox, "reset Notice Button" ); | ||
34 | connect(resetNoticeButton, SIGNAL( clicked() ), this, SLOT( resetNotice() )); | ||
35 | boxLayout->addWidget(resetNoticeButton, 0, Qt::AlignHCenter); | ||
36 | |||
37 | QLabel * comment2 = new QLabel("<p>" + tr("Note: you can use HTML tags to improve its layout (example: text between <em> and </em> will be <em>emphasized</em>)") + "</p>", configBox); | ||
38 | boxLayout->addWidget(comment2); | ||
39 | |||
40 | } | ||
41 | |||
42 | /// nothing to do | ||
43 | NoticeConfigWidget::~NoticeConfigWidget() | ||
44 | {} | ||
45 | |||
46 | /// write the notice text in the multiauth.conf Config file | ||
47 | void NoticeConfigWidget::writeConfig() | ||
48 | { | ||
49 | if ( noticeMLE->edited() ) { | ||
50 | odebug << "writing new notice text in Security.conf" << oendl; | ||
51 | setNoticeText(noticeMLE->text()); | ||
52 | } | ||
53 | } | ||
54 | |||
55 | /// reset the notice text to the hard-coded example defaultNoticeText | ||
56 | void NoticeConfigWidget::resetNotice() | ||
57 | { | ||
58 | noticeMLE->setText(defaultNoticeText); | ||
59 | } | ||
60 | |||
61 | /// get the notice text from the config file (with true new lines) | ||
62 | /** | ||
63 | * if no text has been defined yet returns defaultNoticeText | ||
64 | */ | ||
65 | QString NoticeConfigWidget::getNoticeText() { | ||
66 | m_config = new Config("Security"); | ||
67 | m_config->setGroup("NoticePlugin"); | ||
68 | // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp | ||
69 | QString noticeText = m_config->readEntry("noticeText", defaultNoticeText).replace( QRegExp("\\\\n"), "\n" ); | ||
70 | delete m_config; | ||
71 | return noticeText; | ||
72 | } | ||
73 | |||
74 | /// set the notice text in our m_config config file (escaping new lines) | ||
75 | void NoticeConfigWidget::setNoticeText(QString noticeText) { | ||
76 | m_config = new Config("Security"); | ||
77 | m_config->setGroup("NoticePlugin"); | ||
78 | // since Config files do not allow true newlines, we replace them with litteral "\n" | ||
79 | m_config->writeEntry("noticeText", noticeText.replace( QRegExp("\n"), "\\n" )); | ||
80 | delete m_config; | ||
81 | } | ||
diff --git a/noncore/securityplugins/notice/noticeConfigWidget.h b/noncore/securityplugins/notice/noticeConfigWidget.h new file mode 100644 index 0000000..69f15bf --- a/dev/null +++ b/noncore/securityplugins/notice/noticeConfigWidget.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /** | ||
2 | * \file noticeConfigWidget.h | ||
3 | * \brief Notice plugin configuration widget | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef NOTICECONFIGWIDGET_H | ||
35 | #define NOTICECONFIGWIDGET_H | ||
36 | |||
37 | #include <qpushbutton.h> | ||
38 | #include <qmultilineedit.h> | ||
39 | #include <qpe/config.h> | ||
40 | |||
41 | #include <opie2/multiauthconfigwidget.h> | ||
42 | |||
43 | static char defaultNoticeText [] = "<h2>NOTICE TO USERS</h2>\n" | ||
44 | "<p>This is a private computer system and is the property of " | ||
45 | "the company XXX / Mr or Ms X. It is for authorized " | ||
46 | "use only. Users have no expectation of privacy.</p>\n" | ||
47 | "<p><strong>Unauthorized or improper use of this system may result in " | ||
48 | "disciplinary action and civil and criminal penalties. <em>By continuing to use " | ||
49 | "this system you indicate your awareness of and consent to these " | ||
50 | "terms. LOG OFF IMMEDIATELY if you do not agree to them.</em></strong></p>"; | ||
51 | |||
52 | class NoticeConfigWidget : public MultiauthConfigWidget { | ||
53 | |||
54 | Q_OBJECT | ||
55 | |||
56 | public: | ||
57 | NoticeConfigWidget(QWidget* parent, const char* name); | ||
58 | virtual ~NoticeConfigWidget(); | ||
59 | virtual void writeConfig(); | ||
60 | private: | ||
61 | QMultiLineEdit * noticeMLE; | ||
62 | QPushButton * resetNoticeButton; | ||
63 | private slots: | ||
64 | void resetNotice(); | ||
65 | private: | ||
66 | Config * m_config; | ||
67 | QString getNoticeText(); | ||
68 | void setNoticeText(QString noticeText); | ||
69 | }; | ||
70 | |||
71 | #endif // NOTICECONFIGWIDGET_H | ||
diff --git a/noncore/securityplugins/notice/noticeplugin.cpp b/noncore/securityplugins/notice/noticeplugin.cpp new file mode 100644 index 0000000..f7d41ab --- a/dev/null +++ b/noncore/securityplugins/notice/noticeplugin.cpp | |||
@@ -0,0 +1,83 @@ | |||
1 | #include "noticeplugin.h" | ||
2 | |||
3 | #include <opie2/oapplication.h> | ||
4 | |||
5 | #include <qmessagebox.h> | ||
6 | #include <qregexp.h> | ||
7 | |||
8 | /// creates and initializes the m_config Config object | ||
9 | NoticePlugin::NoticePlugin() : MultiauthPluginObject(), noticeW(0) { | ||
10 | m_config = new Config("Security"); | ||
11 | m_config->setGroup("NoticePlugin"); | ||
12 | } | ||
13 | |||
14 | /// deletes the m_config Config object and noticeW if necessary | ||
15 | NoticePlugin::~NoticePlugin() { | ||
16 | delete m_config; | ||
17 | if (noticeW != 0) | ||
18 | delete noticeW; | ||
19 | } | ||
20 | |||
21 | /// Simply return its name (Notice plugin) | ||
22 | QString NoticePlugin::pluginName() const { | ||
23 | return "Notice plugin"; | ||
24 | } | ||
25 | |||
26 | /// return the Notice widget configuration widget | ||
27 | /** | ||
28 | * \return noticeW, the NoticeConfigWidget | ||
29 | */ | ||
30 | MultiauthConfigWidget * NoticePlugin::configWidget(QWidget * parent) { | ||
31 | if (noticeW == 0) | ||
32 | noticeW = new NoticeConfigWidget(parent, "Notice configuration widget"); | ||
33 | return noticeW; | ||
34 | } | ||
35 | |||
36 | /// return the path of the small tab icon | ||
37 | QString NoticePlugin::pixmapNameConfig() const { | ||
38 | return "security/noticeplugin_small"; | ||
39 | } | ||
40 | |||
41 | /// return the path of the big icon for the active/order checklist | ||
42 | QString NoticePlugin::pixmapNameWidget() const { | ||
43 | return "security/noticeplugin"; | ||
44 | } | ||
45 | |||
46 | /// Displays the configured message and an 'Accept' button | ||
47 | /** | ||
48 | * \return the outcome code of this authentication (can be only success) | ||
49 | */ | ||
50 | int NoticePlugin::authenticate() { | ||
51 | QMessageBox noticeDialog("Notice plugin", | ||
52 | getNoticeText(), | ||
53 | QMessageBox::Warning, | ||
54 | QMessageBox::Yes, | ||
55 | 0, | ||
56 | 0, | ||
57 | 0, | ||
58 | "notice plugin dialog", | ||
59 | true, | ||
60 | Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop); | ||
61 | |||
62 | noticeDialog.setButtonText(QMessageBox::Yes, "I accept"); | ||
63 | |||
64 | QRect desk = oApp->desktop()->geometry(); | ||
65 | noticeDialog.setGeometry( 0, 0, desk.width(), desk.height() ); | ||
66 | |||
67 | switch (noticeDialog.exec()) | ||
68 | { | ||
69 | case QMessageBox::Yes: | ||
70 | return MultiauthPluginObject::Success; | ||
71 | } | ||
72 | return 255; //should not be returned anyway | ||
73 | } | ||
74 | |||
75 | /// get the notice text from our m_config config file (with true new lines) | ||
76 | /** | ||
77 | * if no text has been defined yet returns defaultNoticeText | ||
78 | */ | ||
79 | QString NoticePlugin::getNoticeText() { | ||
80 | // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp | ||
81 | return m_config->readEntry("noticeText", defaultNoticeText).replace( QRegExp("\\\\n"), "\n" ); | ||
82 | } | ||
83 | |||
diff --git a/noncore/securityplugins/notice/noticeplugin.h b/noncore/securityplugins/notice/noticeplugin.h new file mode 100644 index 0000000..e01cb93 --- a/dev/null +++ b/noncore/securityplugins/notice/noticeplugin.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /** | ||
2 | * \file noticeplugin.h | ||
3 | * \brief Standard Opie multiauth plugin definition | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef NOTICE_PLUGIN_H | ||
35 | #define NOTICE_PLUGIN_H | ||
36 | |||
37 | #include <qstring.h> | ||
38 | #include <qpe/config.h> | ||
39 | #include <opie2/multiauthplugininterface.h> | ||
40 | #include "noticeConfigWidget.h" | ||
41 | |||
42 | /// Multi-authentication plugin, having the user accept a (legal, etc.) notice text. | ||
43 | /** | ||
44 | * The plugin itself, implementing the main authenticate() function. | ||
45 | */ | ||
46 | class NoticePlugin : public MultiauthPluginObject { | ||
47 | |||
48 | public: | ||
49 | NoticePlugin(); | ||
50 | virtual ~NoticePlugin(); | ||
51 | int authenticate(); | ||
52 | MultiauthConfigWidget * configWidget(QWidget * parent); | ||
53 | QString pixmapNameConfig() const; | ||
54 | QString pixmapNameWidget() const; | ||
55 | QString pluginName() const; | ||
56 | private: | ||
57 | NoticeConfigWidget * noticeW; | ||
58 | Config * m_config; | ||
59 | QString getNoticeText(); | ||
60 | }; | ||
61 | |||
62 | #endif | ||
diff --git a/noncore/securityplugins/notice/noticeplugin.pro b/noncore/securityplugins/notice/noticeplugin.pro new file mode 100644 index 0000000..51532a2 --- a/dev/null +++ b/noncore/securityplugins/notice/noticeplugin.pro | |||
@@ -0,0 +1,17 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on | ||
3 | |||
4 | HEADERS = noticeplugin.h noticepluginimpl.h noticeConfigWidget.h | ||
5 | |||
6 | SOURCES = noticeplugin.cpp noticepluginimpl.cpp noticeConfigWidget.cpp | ||
7 | |||
8 | |||
9 | INCLUDEPATH+= $(OPIEDIR)/include | ||
10 | DEPENDPATH+= | ||
11 | |||
12 | LIBS += -lqpe -lopieui2 | ||
13 | |||
14 | DESTDIR = $(OPIEDIR)/plugins/security | ||
15 | TARGET = multiauthnoticeplugin | ||
16 | |||
17 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/noncore/securityplugins/notice/noticepluginimpl.cpp b/noncore/securityplugins/notice/noticepluginimpl.cpp new file mode 100644 index 0000000..34e3cfc --- a/dev/null +++ b/noncore/securityplugins/notice/noticepluginimpl.cpp | |||
@@ -0,0 +1,28 @@ | |||
1 | #include "noticepluginimpl.h" | ||
2 | |||
3 | NoticePluginImpl::NoticePluginImpl() { | ||
4 | noticePlugin = new NoticePlugin(); | ||
5 | } | ||
6 | |||
7 | NoticePluginImpl::~NoticePluginImpl() { | ||
8 | delete noticePlugin; | ||
9 | } | ||
10 | |||
11 | MultiauthPluginObject* NoticePluginImpl::plugin() { | ||
12 | return noticePlugin; | ||
13 | } | ||
14 | |||
15 | Q_EXPORT_INTERFACE() { | ||
16 | Q_CREATE_INSTANCE( NoticePluginImpl ) | ||
17 | } | ||
18 | |||
19 | QRESULT NoticePluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { | ||
20 | *iface = 0; | ||
21 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MultiauthPluginInterface ) ) { | ||
22 | *iface = this, (*iface)->addRef(); | ||
23 | } else { | ||
24 | return QE_NOINTERFACE; | ||
25 | } | ||
26 | return QS_OK; | ||
27 | |||
28 | } | ||
diff --git a/noncore/securityplugins/notice/noticepluginimpl.h b/noncore/securityplugins/notice/noticepluginimpl.h new file mode 100644 index 0000000..b2a1140 --- a/dev/null +++ b/noncore/securityplugins/notice/noticepluginimpl.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /** | ||
2 | * \file noticepluginimpl.h | ||
3 | * \brief Standard Opie multiauth plugin definition | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef NOTICE_PLUGIN_IMPL | ||
35 | #define NOTICE_PLUGIN_IMPL | ||
36 | |||
37 | #include "noticeplugin.h" | ||
38 | |||
39 | /** | ||
40 | * \brief Standard multiauth plugin class | ||
41 | */ | ||
42 | class NoticePluginImpl : public MultiauthPluginInterface{ | ||
43 | |||
44 | public: | ||
45 | NoticePluginImpl(); | ||
46 | virtual ~NoticePluginImpl(); | ||
47 | |||
48 | QRESULT queryInterface( const QUuid &, QUnknownInterface** ); | ||
49 | /// defines standard addRef() and release() functions | ||
50 | Q_REFCOUNT; | ||
51 | |||
52 | virtual MultiauthPluginObject *plugin(); | ||
53 | |||
54 | private: | ||
55 | /// the plugin itself | ||
56 | NoticePlugin *noticePlugin; | ||
57 | ulong ref; | ||
58 | }; | ||
59 | |||
60 | #endif | ||
61 | |||
diff --git a/noncore/securityplugins/pin/.cvsignore b/noncore/securityplugins/pin/.cvsignore new file mode 100644 index 0000000..2fc28bd --- a/dev/null +++ b/noncore/securityplugins/pin/.cvsignore | |||
@@ -0,0 +1,4 @@ | |||
1 | *.moc | ||
2 | Makefile | ||
3 | pinDialogBase.cpp | ||
4 | pinDialogBase.h | ||
diff --git a/noncore/securityplugins/pin/Makefile b/noncore/securityplugins/pin/Makefile new file mode 100644 index 0000000..8c6a231 --- a/dev/null +++ b/noncore/securityplugins/pin/Makefile | |||
@@ -0,0 +1,237 @@ | |||
1 | ############################################################################# | ||
2 | # Makefile for building: libmultiauthpinplugin.so.0.0.2 | ||
3 | # Generated by qmake (1.05a) (Qt 3.1.2) on: Mon Jun 14 11:00:20 2004 | ||
4 | # Project: pinplugin.pro | ||
5 | # Template: lib | ||
6 | # Command: $(QMAKE) -o Makefile pinplugin.pro | ||
7 | ############################################################################# | ||
8 | |||
9 | ####### Compiler, tools and options | ||
10 | |||
11 | CC = $(CCACHE) $(DISTCC) gcc | ||
12 | CXX = $(CCACHE) $(DISTCC) g++ | ||
13 | LEX = flex | ||
14 | YACC = yacc | ||
15 | CFLAGS = -pipe $(CFLAGS_EXTRA) -Wall -W -g -fPIC -DQT_COMPONENT_DEBUG=2 -DQT_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION -DOPIE_SOUND_FRAGMENT_SHIFT=16 | ||
16 | CXXFLAGS = -pipe $(CFLAGS_EXTRA) -DQWS -fno-exceptions -fno-rtti $(CXXFLAGS_EXTRA) -Wall -W -g -fPIC -DQT_COMPONENT_DEBUG=2 -DQT_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION -DOPIE_SOUND_FRAGMENT_SHIFT=16 | ||
17 | LEXFLAGS = | ||
18 | YACCFLAGS= -d | ||
19 | INCPATH = -I/opt/opie/mkspecs/qws/linux-generic-g++ -I. -I$(OPIEDIR)/include -I$(QTDIR)/include -I.moc/$(PLATFORM)/ | ||
20 | LINK = g++ | ||
21 | LFLAGS = $(LFLAGS_EXTRA) -Wl,-rpath-link,$(OPIEDIR)/lib -shared -Wl,-soname,libmultiauthpinplugin.so.0 -Wl,-rpath,/opt/opie/plugins/security | ||
22 | LIBS = $(SUBLIBS) -Wl,-rpath,$(QTDIR)/lib -L$(QTDIR)/lib $(LIBS_EXTRA) -lqpe -lopieui2 -L$(OPIEDIR)/lib -lqte | ||
23 | AR = ar cqs | ||
24 | RANLIB = | ||
25 | MOC = $(QTDIR)/bin/moc | ||
26 | UIC = $(QTDIR)/bin/uic | ||
27 | QMAKE = qmake | ||
28 | TAR = tar -cf | ||
29 | GZIP = gzip -9f | ||
30 | COPY = cp -f | ||
31 | COPY_FILE= $(COPY) -p | ||
32 | COPY_DIR = $(COPY) -pR | ||
33 | DEL_FILE = rm -f | ||
34 | SYMLINK = ln -sf | ||
35 | DEL_DIR = rmdir | ||
36 | MOVE = mv -f | ||
37 | PRO = pinplugin.pro | ||
38 | CHK_DIR_EXISTS= | ||
39 | MKDIR = | ||
40 | |||
41 | ####### Output directory | ||
42 | |||
43 | OBJECTS_DIR = .obj/$(PLATFORM)/ | ||
44 | |||
45 | ####### Files | ||
46 | |||
47 | HEADERS = pin.h \ | ||
48 | pinpluginimpl.h \ | ||
49 | pinConfigWidget.h | ||
50 | SOURCES = pin.cpp \ | ||
51 | pinpluginimpl.cpp \ | ||
52 | pinConfigWidget.cpp | ||
53 | OBJECTS = .obj/$(PLATFORM)/pin.o \ | ||
54 | .obj/$(PLATFORM)/pinpluginimpl.o \ | ||
55 | .obj/$(PLATFORM)/pinConfigWidget.o \ | ||
56 | .obj/$(PLATFORM)/pinDialogBase.o | ||
57 | FORMS = pinDialogBase.ui | ||
58 | UICDECLS = pinDialogBase.h | ||
59 | UICIMPLS = pinDialogBase.cpp | ||
60 | SRCMOC = .moc/$(PLATFORM)/moc_pin.cpp \ | ||
61 | .moc/$(PLATFORM)/moc_pinDialogBase.cpp \ | ||
62 | .moc/$(PLATFORM)/pin.moc | ||
63 | OBJMOC = .obj/$(PLATFORM)/moc_pin.o \ | ||
64 | .obj/$(PLATFORM)/moc_pinDialogBase.o | ||
65 | DIST = ../../../gen.pro \ | ||
66 | ../../../include.pro \ | ||
67 | pinplugin.pro | ||
68 | QMAKE_TARGET = multiauthpinplugin | ||
69 | DESTDIR = $(OPIEDIR)/plugins/security/ | ||
70 | TARGET = libmultiauthpinplugin.so.0.0.2 | ||
71 | TARGETA= $(OPIEDIR)/plugins/security/libmultiauthpinplugin.a | ||
72 | TARGETD= libmultiauthpinplugin.so.0.0.2 | ||
73 | TARGET0= libmultiauthpinplugin.so | ||
74 | TARGET1= libmultiauthpinplugin.so.0 | ||
75 | TARGET2= libmultiauthpinplugin.so.0.0 | ||
76 | |||
77 | first: all | ||
78 | ####### Implicit rules | ||
79 | |||
80 | .SUFFIXES: .c .cpp .cc .cxx .C | ||
81 | |||
82 | .cpp.o: | ||
83 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
84 | |||
85 | .cc.o: | ||
86 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
87 | |||
88 | .cxx.o: | ||
89 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
90 | |||
91 | .C.o: | ||
92 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | ||
93 | |||
94 | .c.o: | ||
95 | $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< | ||
96 | |||
97 | ####### Build rules | ||
98 | |||
99 | all: Makefile $(OPIEDIR)/plugins/security/$(TARGET) | ||
100 | |||
101 | $(OPIEDIR)/plugins/security/$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) | ||
102 | test -d $(OPIEDIR)/plugins/security/ || mkdir -p $(OPIEDIR)/plugins/security/ | ||
103 | -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) | ||
104 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) | ||
105 | -ln -s $(TARGET) $(TARGET0) | ||
106 | -ln -s $(TARGET) $(TARGET1) | ||
107 | -ln -s $(TARGET) $(TARGET2) | ||
108 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET) | ||
109 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET0) | ||
110 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET1) | ||
111 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET2) | ||
112 | -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) $(OPIEDIR)/plugins/security/ | ||
113 | |||
114 | |||
115 | |||
116 | staticlib: $(TARGETA) | ||
117 | |||
118 | $(TARGETA): $(UICDECLS) $(OBJECTS) $(OBJMOC) | ||
119 | -$(DEL_FILE) $(TARGETA) | ||
120 | $(AR) $(TARGETA) $(OBJECTS) $(OBJMOC) | ||
121 | |||
122 | mocables: $(SRCMOC) | ||
123 | |||
124 | $(MOC): | ||
125 | ( cd $(QTDIR)/src/moc ; $(MAKE) ) | ||
126 | |||
127 | Makefile: pinplugin.pro /opt/opie/mkspecs/qws/linux-generic-g++/qmake.conf ../../../gen.pro \ | ||
128 | ../../../include.pro | ||
129 | $(QMAKE) -o Makefile pinplugin.pro | ||
130 | qmake: | ||
131 | @$(QMAKE) -o Makefile pinplugin.pro | ||
132 | |||
133 | dist: | ||
134 | @mkdir -p .obj/$(PLATFORM)/multiauthpinplugin && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .obj/$(PLATFORM)/multiauthpinplugin/ && ( cd `dirname .obj/$(PLATFORM)/multiauthpinplugin` && $(TAR) multiauthpinplugin.tar multiauthpinplugin && $(GZIP) multiauthpinplugin.tar ) && $(MOVE) `dirname .obj/$(PLATFORM)/multiauthpinplugin`/multiauthpinplugin.tar.gz . && $(DEL_FILE) -r .obj/$(PLATFORM)/multiauthpinplugin | ||
135 | |||
136 | mocclean: | ||
137 | -$(DEL_FILE) $(OBJMOC) | ||
138 | -$(DEL_FILE) $(SRCMOC) | ||
139 | |||
140 | uiclean: | ||
141 | -$(DEL_FILE) $(UICIMPLS) $(UICDECLS) | ||
142 | |||
143 | yaccclean: | ||
144 | lexclean: | ||
145 | clean: mocclean uiclean | ||
146 | -$(DEL_FILE) $(OBJECTS) | ||
147 | -$(DEL_FILE) *~ core *.core | ||
148 | |||
149 | |||
150 | ####### Sub-libraries | ||
151 | |||
152 | distclean: clean | ||
153 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET) $(TARGET) | ||
154 | -$(DEL_FILE) $(OPIEDIR)/plugins/security/$(TARGET0) $(OPIEDIR)/plugins/security/$(TARGET1) $(OPIEDIR)/plugins/security/$(TARGET2) $(TARGETA) | ||
155 | |||
156 | |||
157 | lupdate: | ||
158 | lupdate -noobsolete $(PRO) | ||
159 | |||
160 | lrelease: | ||
161 | lrelease $(PRO) | ||
162 | |||
163 | ipk: | ||
164 | tmp=`mktemp -d /tmp/ipkg-opie.XXXXXXXXXX` && ( $(MAKE) INSTALL_ROOT="" install && ipkg-build ; rm -rf ; ) | ||
165 | |||
166 | opie-lupdate: | ||
167 | opie-lupdate $(PRO) | ||
168 | |||
169 | opie-lrelease: | ||
170 | opie-lrelease $(PRO) | ||
171 | |||
172 | messages: | ||
173 | xgettext -C -n -ktr -kQT_TRANSLATE_NOOP pin.h pinpluginimpl.h pinConfigWidget.h pin.cpp pinpluginimpl.cpp pinConfigWidget.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-tr.po' && xgettext -C -n -a pin.h pinpluginimpl.h pinConfigWidget.h pin.cpp pinpluginimpl.cpp pinConfigWidget.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-allstrings.po' | ||
174 | |||
175 | FORCE: | ||
176 | |||
177 | ####### Compile | ||
178 | |||
179 | .obj/$(PLATFORM)/pin.o: pin.cpp pin.h \ | ||
180 | pinDialogBase.h \ | ||
181 | pinConfigWidget.h \ | ||
182 | .moc/$(PLATFORM)/pin.moc | ||
183 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/pin.o pin.cpp | ||
184 | |||
185 | .obj/$(PLATFORM)/pinpluginimpl.o: pinpluginimpl.cpp pinpluginimpl.h \ | ||
186 | pin.h \ | ||
187 | pinConfigWidget.h | ||
188 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/pinpluginimpl.o pinpluginimpl.cpp | ||
189 | |||
190 | .obj/$(PLATFORM)/pinConfigWidget.o: pinConfigWidget.cpp pinConfigWidget.h | ||
191 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/pinConfigWidget.o pinConfigWidget.cpp | ||
192 | |||
193 | pinDialogBase.h: pinDialogBase.ui | ||
194 | $(UIC) pinDialogBase.ui -o pinDialogBase.h | ||
195 | |||
196 | pinDialogBase.cpp: pinDialogBase.h pinDialogBase.ui | ||
197 | $(UIC) pinDialogBase.ui -i pinDialogBase.h -o pinDialogBase.cpp | ||
198 | |||
199 | .obj/$(PLATFORM)/pinDialogBase.o: pinDialogBase.cpp pinDialogBase.h | ||
200 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/pinDialogBase.o pinDialogBase.cpp | ||
201 | |||
202 | .obj/$(PLATFORM)/moc_pin.o: .moc/$(PLATFORM)/moc_pin.cpp pin.h pinConfigWidget.h | ||
203 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/moc_pin.o .moc/$(PLATFORM)/moc_pin.cpp | ||
204 | |||
205 | .obj/$(PLATFORM)/moc_pinDialogBase.o: .moc/$(PLATFORM)/moc_pinDialogBase.cpp pinDialogBase.h | ||
206 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/moc_pinDialogBase.o .moc/$(PLATFORM)/moc_pinDialogBase.cpp | ||
207 | |||
208 | .moc/x86-linux/moc_pin.cpp: $(MOC) pin.h | ||
209 | $(MOC) pin.h -o .moc/x86-linux/moc_pin.cpp | ||
210 | |||
211 | .moc/x86-linux/pin.moc: $(MOC) pin.cpp | ||
212 | $(MOC) pin.cpp -o .moc/x86-linux/pin.moc | ||
213 | |||
214 | .moc/x86-linux/moc_pinDialogBase.cpp: $(MOC) pinDialogBase.h | ||
215 | $(MOC) pinDialogBase.h -o .moc/x86-linux/moc_pinDialogBase.cpp | ||
216 | |||
217 | ####### Install | ||
218 | |||
219 | install_target: | ||
220 | @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" || $(MKDIR) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" | ||
221 | -$(COPY) "$(OPIEDIR)/plugins/security/$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET)" | ||
222 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET0)" | ||
223 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET1)" | ||
224 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET2)" | ||
225 | |||
226 | uninstall_target: | ||
227 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET)" | ||
228 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET0)" | ||
229 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET1)" | ||
230 | -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/lib/$(TARGET2)" | ||
231 | -$(DEL_DIR) "$(INSTALL_ROOT)$(OPIEDIR)/lib/" | ||
232 | |||
233 | |||
234 | install: all install_target | ||
235 | |||
236 | uninstall: uninstall_target | ||
237 | |||
diff --git a/noncore/securityplugins/pin/config.in b/noncore/securityplugins/pin/config.in new file mode 100644 index 0000000..d255038 --- a/dev/null +++ b/noncore/securityplugins/pin/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config MULTIAUTH_PIN | ||
2 | boolean "opie-multiauth-pin (PIN authentication plugin for opie-multiauth)" | ||
3 | default "y" | ||
4 | depends SECURITY | ||
diff --git a/noncore/securityplugins/pin/pin.control b/noncore/securityplugins/pin/pin.control new file mode 100644 index 0000000..158e20d --- a/dev/null +++ b/noncore/securityplugins/pin/pin.control | |||
@@ -0,0 +1,12 @@ | |||
1 | Package: opie-multiauth-pinplugin | ||
2 | Files: plugins/security/libmultiauthpinplugin.so* pics/security/pinplugin.png | ||
3 | Priority: optional | ||
4 | Section: opie/settings | ||
5 | Maintainer: Clement Seveillac <clement@nist.gov> | ||
6 | Architecture: arm | ||
7 | Version: 0.0.2.6 | ||
8 | Depends: opie-security | ||
9 | Description: PIN plugin for opie-security authentication. | ||
10 | It implements the same kind of widgets as opie-security package, | ||
11 | but this implementation can be used along with other authentication | ||
12 | methods in the Opie Multi-Authentication Framework. | ||
diff --git a/noncore/securityplugins/pin/pin.cpp b/noncore/securityplugins/pin/pin.cpp new file mode 100644 index 0000000..37dc5be --- a/dev/null +++ b/noncore/securityplugins/pin/pin.cpp | |||
@@ -0,0 +1,342 @@ | |||
1 | /** | ||
2 | * \note Taken from opie-security and libqpe password.cpp, and modified for Opie multiauth by Clement Seveillac | ||
3 | */ | ||
4 | /********************************************************************** | ||
5 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
6 | ** | ||
7 | ** This file is part of the Qtopia Environment. | ||
8 | ** | ||
9 | ** This file may be distributed and/or modified under the terms of the | ||
10 | ** GNU General Public License version 2 as published by the Free Software | ||
11 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
12 | ** packaging of this file. | ||
13 | ** | ||
14 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
15 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
16 | ** | ||
17 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
18 | ** | ||
19 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
20 | ** not clear to you. | ||
21 | ** | ||
22 | **********************************************************************/ | ||
23 | |||
24 | #include "pin.h" | ||
25 | #include "pinDialogBase.h" | ||
26 | #include "pinConfigWidget.h" | ||
27 | /* OPIE */ | ||
28 | #include <opie2/odebug.h> | ||
29 | #include <opie2/oapplication.h> | ||
30 | /* QT */ | ||
31 | #include <qpe/config.h> | ||
32 | #include <qlabel.h> | ||
33 | #include <qlineedit.h> | ||
34 | #include <qtextview.h> | ||
35 | #include <qstring.h> | ||
36 | #include <qdialog.h> | ||
37 | /* UNIX */ | ||
38 | #include <unistd.h> | ||
39 | #include <stdlib.h> | ||
40 | #include <time.h> | ||
41 | |||
42 | extern "C" char *crypt(const char *key, const char *salt); | ||
43 | |||
44 | /// set to TRUE when we press the 'Skip' button | ||
45 | bool isSkip = FALSE; | ||
46 | |||
47 | /// PIN input graphical widget. | ||
48 | /** | ||
49 | * Inherits the PinDialogBase class defined originally in pinDialogBase.ui interface file. | ||
50 | * \sa PinDlg and PinDialog (the class generated from the .ui file) | ||
51 | * It comes from the original PIN locking code in Opie : | ||
52 | * \sa http://dudu.dyn.2-h.org/opiedoxydoc/library_2password_8cpp-source.html | ||
53 | */ | ||
54 | class PinDialog : public PinDialogBase | ||
55 | { | ||
56 | Q_OBJECT | ||
57 | |||
58 | public: | ||
59 | PinDialog( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | ||
60 | ~PinDialog(); | ||
61 | |||
62 | void clear(); | ||
63 | void setPrompt( const QString& ); | ||
64 | |||
65 | signals: | ||
66 | /// emitted when we press the Enter button | ||
67 | void passwordEntered( const QString& ); | ||
68 | /// emitted when we press the Skip button | ||
69 | void skip(); | ||
70 | |||
71 | protected: | ||
72 | bool eventFilter( QObject*, QEvent* ); | ||
73 | |||
74 | private: | ||
75 | void input( QString ); | ||
76 | friend class PinPlugin; | ||
77 | QString text; | ||
78 | }; | ||
79 | |||
80 | |||
81 | /// Constructs a PinDialog widget, and initializes things | ||
82 | PinDialog::PinDialog( QWidget* parent, const char* name, WFlags fl ) | ||
83 | : PinDialogBase( parent, name, fl ) | ||
84 | { | ||
85 | QRect desk = oApp->desktop()->geometry(); | ||
86 | |||
87 | if ( desk.width() < 220 ) { | ||
88 | QFont f( font() ); | ||
89 | f.setPointSize( 18 ); | ||
90 | setFont( f ); | ||
91 | f.setPointSize( 12 ); | ||
92 | prompt->setFont( f ); | ||
93 | } | ||
94 | |||
95 | button_0->installEventFilter( this ); | ||
96 | button_1->installEventFilter( this ); | ||
97 | button_2->installEventFilter( this ); | ||
98 | button_3->installEventFilter( this ); | ||
99 | button_4->installEventFilter( this ); | ||
100 | button_5->installEventFilter( this ); | ||
101 | button_6->installEventFilter( this ); | ||
102 | button_7->installEventFilter( this ); | ||
103 | button_8->installEventFilter( this ); | ||
104 | button_9->installEventFilter( this ); | ||
105 | button_Skip->installEventFilter( this ); | ||
106 | button_OK->installEventFilter( this ); | ||
107 | setFocus(); | ||
108 | } | ||
109 | |||
110 | /// nothing to do | ||
111 | PinDialog::~PinDialog() | ||
112 | { | ||
113 | // no need to delete child widgets, Qt does it all for us | ||
114 | } | ||
115 | |||
116 | /// Record the pressed numbers, and the Skip and Enter commands | ||
117 | bool PinDialog::eventFilter( QObject*o, QEvent*e ) | ||
118 | { | ||
119 | if ( e->type() == QEvent::MouseButtonRelease ) { | ||
120 | if ( o == button_OK ) { | ||
121 | emit passwordEntered( text ); | ||
122 | } | ||
123 | else if ( o == button_Skip ) { | ||
124 | isSkip = TRUE; | ||
125 | emit skip(); | ||
126 | } | ||
127 | else { | ||
128 | QLabel *l = (QLabel*)o; | ||
129 | input(l->text()); | ||
130 | } | ||
131 | } | ||
132 | return FALSE; | ||
133 | } | ||
134 | |||
135 | void PinDialog::input( QString c ) | ||
136 | { | ||
137 | text += c; | ||
138 | display->setText( text ); | ||
139 | } | ||
140 | |||
141 | void PinDialog::setPrompt( const QString& s ) | ||
142 | { | ||
143 | prompt->setText( s ); | ||
144 | } | ||
145 | |||
146 | void PinDialog::clear() | ||
147 | { | ||
148 | text = ""; | ||
149 | input(""); | ||
150 | } | ||
151 | |||
152 | /// PIN dialog | ||
153 | /** | ||
154 | * Dialog containing the PinDialog widget (which asks for a PIN) and interfacing with its I/O. | ||
155 | * \sa PinDialog | ||
156 | */ | ||
157 | class PinDlg : public QDialog | ||
158 | { | ||
159 | public: | ||
160 | PinDlg( QWidget *parent, const char * name, bool modal, bool fullscreen = FALSE ) | ||
161 | : QDialog( parent, name, modal, fullscreen ? WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop : 0 ), | ||
162 | modl(modal) | ||
163 | { | ||
164 | pinD = new PinDialog( this ); | ||
165 | |||
166 | if ( fullscreen ) { | ||
167 | QRect desk = oApp->desktop()->geometry(); | ||
168 | setGeometry( 0, 0, desk.width(), desk.height() ); | ||
169 | } | ||
170 | |||
171 | connect( pinD, SIGNAL(passwordEntered(const QString&)), | ||
172 | this, SLOT(accept()) ); | ||
173 | connect( pinD, SIGNAL(skip()), this, SLOT(accept()) ); | ||
174 | } | ||
175 | |||
176 | void resizeEvent( QResizeEvent * ) | ||
177 | { | ||
178 | pinD->resize( size() ); | ||
179 | } | ||
180 | |||
181 | void reset() | ||
182 | { | ||
183 | pinD->clear(); | ||
184 | } | ||
185 | |||
186 | /// Slot receiving the Skip or Enter commands, and closing the QDialog | ||
187 | void accept() | ||
188 | { | ||
189 | if ( !modl ) | ||
190 | oApp->exit_loop(); | ||
191 | QDialog::accept(); | ||
192 | } | ||
193 | |||
194 | PinDialog *pinD; | ||
195 | bool modl; | ||
196 | }; | ||
197 | |||
198 | /// generate a fairly random salt and return the PIN hashed by crypt() | ||
199 | QString PinPlugin::encrypt(const QString& pin) | ||
200 | { | ||
201 | // the salt must begin by "$1$" if we want crypt() to use MD5 | ||
202 | char salt[] = "$1$........"; | ||
203 | const char *const seedchars = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; | ||
204 | // initialize the random generator | ||
205 | srandom(time(0)); | ||
206 | int i; | ||
207 | for(i = 0; i < 8; i++) | ||
208 | { | ||
209 | // initialize the salt with random() | ||
210 | salt[i+3] = seedchars[random() % 64]; | ||
211 | } | ||
212 | return QString::fromLatin1(crypt(pin.latin1(),salt)); | ||
213 | } | ||
214 | |||
215 | /// verify a PIN against its crypt() hash | ||
216 | /** | ||
217 | * \return true if the \a pin matches its \a hash | ||
218 | */ | ||
219 | bool PinPlugin::verify(const QString& pin, const QString& hash) | ||
220 | { | ||
221 | // the hash, which contains the salt (8 chars after "$1$"), can be given as the salt | ||
222 | return hash.compare( QString::fromLatin1(crypt( pin.latin1(), hash.latin1() )) ) == 0 ? true : false; | ||
223 | } | ||
224 | |||
225 | /// Displays a PinDialog and returns the typed in PIN | ||
226 | /** | ||
227 | * The returned value is QString::null if the user cancels the operation, | ||
228 | * or the empty string if the user enters no password (but confirms the | ||
229 | * dialog). | ||
230 | */ | ||
231 | QString PinPlugin::getPIN( const QString& prompt ) | ||
232 | { | ||
233 | PinDlg pd(0,0,TRUE); | ||
234 | pd.pinD->setPrompt( prompt ); | ||
235 | |||
236 | pd.showMaximized(); | ||
237 | int r = pd.exec(); | ||
238 | |||
239 | if ( r == QDialog::Accepted ) { | ||
240 | if (pd.pinD->text.isEmpty()) | ||
241 | return ""; | ||
242 | else | ||
243 | return pd.pinD->text; | ||
244 | } | ||
245 | else | ||
246 | return QString::null; | ||
247 | } | ||
248 | |||
249 | /// Displays the PIN dialog and returns a hash of the typed in PIN | ||
250 | /** | ||
251 | * \return the hashed ( =one-way encrypted) PIN typed in by the user | ||
252 | * \param prompt the prompt to display in the PinDialog | ||
253 | */ | ||
254 | QString PinPlugin::getCryptedPIN( const QString& prompt ) | ||
255 | { | ||
256 | return encrypt(getPIN(prompt)); | ||
257 | } | ||
258 | |||
259 | /// Displays the PIN dialog, asks 2 times for a new PIN, saves it if entered two times | ||
260 | /** | ||
261 | * writes nothing if we enter nothing the first time | ||
262 | */ | ||
263 | void PinPlugin::changePIN() | ||
264 | { | ||
265 | QString new1, new2; | ||
266 | do { | ||
267 | new1 = getPIN(QObject::tr("Enter new PIN")); | ||
268 | if ( new1.isNull() ) | ||
269 | return; | ||
270 | new2 = getPIN(QObject::tr("Re-enter new PIN")); | ||
271 | } while (new1 != new2); | ||
272 | |||
273 | odebug << "writing new PIN hash in Security.conf" << oendl; | ||
274 | Config cfg("Security"); | ||
275 | cfg.setGroup("PinPlugin"); | ||
276 | cfg.writeEntry("hashedPIN", encrypt(new1)); | ||
277 | } | ||
278 | |||
279 | /// Removes the PIN hashed value in the config file | ||
280 | void PinPlugin::clearPIN() | ||
281 | { | ||
282 | Config cfg("Security"); | ||
283 | cfg.setGroup("PinPlugin"); | ||
284 | cfg.removeEntry("hashedPIN"); | ||
285 | } | ||
286 | |||
287 | /// Prompt, fullscreen, for the user's PIN and compare it to the stored one. | ||
288 | /** | ||
289 | * \return the result code, as a MultiauthPluginObject::authResult object | ||
290 | */ | ||
291 | int PinPlugin::authenticate() | ||
292 | { | ||
293 | // reset skip (if we ran Pin two times in a row, skipping the first time, it must be put to 0 again) | ||
294 | isSkip = FALSE; | ||
295 | // fetch value in config | ||
296 | Config cfg("Security"); | ||
297 | cfg.setGroup("PinPlugin"); | ||
298 | QString hashedPin = cfg.readEntry("hashedPIN"); | ||
299 | if (!hashedPin.isEmpty()) | ||
300 | { | ||
301 | // prompt for the PIN in a fullscreen modal dialog | ||
302 | PinDlg pd(0,0,TRUE,TRUE); | ||
303 | pd.reset(); | ||
304 | pd.exec(); | ||
305 | |||
306 | // analyse the result | ||
307 | if (isSkip == TRUE) | ||
308 | return MultiauthPluginObject::Skip; | ||
309 | else if (verify(pd.pinD->text, hashedPin)) | ||
310 | return MultiauthPluginObject::Success; | ||
311 | else | ||
312 | return MultiauthPluginObject::Failure; | ||
313 | } | ||
314 | owarn << "No PIN has been defined! We consider it as a successful authentication though." << oendl; | ||
315 | return MultiauthPluginObject::Success; | ||
316 | } | ||
317 | |||
318 | /// Simply returns the plugin name (PIN plugin) | ||
319 | QString PinPlugin::pluginName() const { | ||
320 | return "PIN Plugin"; | ||
321 | } | ||
322 | |||
323 | QString PinPlugin::pixmapNameWidget() const { | ||
324 | return "security/pinplugin"; | ||
325 | } | ||
326 | |||
327 | QString PinPlugin::pixmapNameConfig() const { | ||
328 | return "security/pinplugin"; | ||
329 | } | ||
330 | |||
331 | /// returns a PinConfigWidget | ||
332 | MultiauthConfigWidget * PinPlugin::configWidget(QWidget * parent) { | ||
333 | PinConfigWidget * pinw = new PinConfigWidget(parent, "PIN configuration widget"); | ||
334 | |||
335 | connect(pinw->changePIN, SIGNAL( clicked() ), this, SLOT( changePIN() )); | ||
336 | connect(pinw->clearPIN, SIGNAL( clicked() ), this, SLOT( clearPIN() )); | ||
337 | |||
338 | return pinw; | ||
339 | } | ||
340 | |||
341 | #include "pin.moc" | ||
342 | |||
diff --git a/noncore/securityplugins/pin/pin.h b/noncore/securityplugins/pin/pin.h new file mode 100644 index 0000000..6cd328a --- a/dev/null +++ b/noncore/securityplugins/pin/pin.h | |||
@@ -0,0 +1,68 @@ | |||
1 | /** | ||
2 | * \file pin.h | ||
3 | * \brief Standard Opie multiauth plugin definition | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef PIN_H | ||
35 | #define PIN_H | ||
36 | |||
37 | #include <qobject.h> | ||
38 | #include <qstring.h> | ||
39 | #include <opie2/multiauthplugininterface.h> | ||
40 | #include "pinConfigWidget.h" | ||
41 | |||
42 | /// Multi-authentication plugin, implementing a PIN verification. | ||
43 | /** | ||
44 | * The plugin itself, implementing the main authenticate() function. | ||
45 | */ | ||
46 | class PinPlugin : public QObject, public MultiauthPluginObject { | ||
47 | |||
48 | Q_OBJECT | ||
49 | |||
50 | public: | ||
51 | int authenticate(); | ||
52 | MultiauthConfigWidget * configWidget(QWidget * parent); | ||
53 | QString pixmapNameConfig() const; | ||
54 | QString pixmapNameWidget() const; | ||
55 | QString pluginName() const; | ||
56 | |||
57 | private slots: | ||
58 | QString getPIN( const QString& prompt ); | ||
59 | QString getCryptedPIN( const QString& prompt ); | ||
60 | void changePIN(); | ||
61 | void clearPIN(); | ||
62 | |||
63 | private: | ||
64 | QString encrypt(const QString& pin); | ||
65 | bool verify(const QString& pin, const QString& hash); | ||
66 | }; | ||
67 | |||
68 | #endif // PIN_H | ||
diff --git a/noncore/securityplugins/pin/pinConfigWidget.cpp b/noncore/securityplugins/pin/pinConfigWidget.cpp new file mode 100644 index 0000000..53e1a20 --- a/dev/null +++ b/noncore/securityplugins/pin/pinConfigWidget.cpp | |||
@@ -0,0 +1,39 @@ | |||
1 | #include <qwidget.h> | ||
2 | #include <qlayout.h> | ||
3 | #include <qlabel.h> | ||
4 | #include <qgroupbox.h> | ||
5 | |||
6 | #include "pinConfigWidget.h" | ||
7 | |||
8 | PinConfigWidget::PinConfigWidget(QWidget* parent = 0, const char* name = "PIN configuration widget") | ||
9 | : MultiauthConfigWidget(parent, name) | ||
10 | { | ||
11 | QVBoxLayout * baseLayout = new QVBoxLayout( this); | ||
12 | baseLayout->setSpacing(11); | ||
13 | baseLayout->setMargin(11); | ||
14 | baseLayout->setAlignment( Qt::AlignTop ); | ||
15 | |||
16 | QGroupBox * configBox = new QGroupBox(0, Qt::Vertical, tr("Configure your PIN here"), this); | ||
17 | baseLayout->addWidget(configBox); | ||
18 | QVBoxLayout *boxLayout = new QVBoxLayout( configBox->layout() ); | ||
19 | |||
20 | QLabel * description = new QLabel("<p>" + tr("PIN protection provides a minimal level of protection from casual access to this device.") + "</p>", configBox); | ||
21 | boxLayout->addWidget(description); | ||
22 | |||
23 | QHBoxLayout * buttonLayout = new QHBoxLayout(); | ||
24 | buttonLayout->setSpacing(6); | ||
25 | changePIN = new QPushButton( tr("Change PIN"), configBox, "changePIN" ); | ||
26 | clearPIN = new QPushButton( tr("Clear PIN"), configBox, "clearPIN" ); | ||
27 | buttonLayout->addWidget(changePIN); | ||
28 | buttonLayout->addWidget(clearPIN); | ||
29 | boxLayout->addLayout(buttonLayout); | ||
30 | |||
31 | } | ||
32 | |||
33 | /// nothing to do | ||
34 | PinConfigWidget::~PinConfigWidget() | ||
35 | {} | ||
36 | |||
37 | /// does nothing since the config file update is already done in changePIN or clearPIN | ||
38 | void PinConfigWidget::writeConfig() | ||
39 | {} | ||
diff --git a/noncore/securityplugins/pin/pinConfigWidget.h b/noncore/securityplugins/pin/pinConfigWidget.h new file mode 100644 index 0000000..3242ad0 --- a/dev/null +++ b/noncore/securityplugins/pin/pinConfigWidget.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /** | ||
2 | * \file pinConfigWidget.h | ||
3 | * \brief PIN plugin configuration widget | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef PINCONFIGWIDGET_H | ||
35 | #define PINCONFIGWIDGET_H | ||
36 | #include <qpushbutton.h> | ||
37 | |||
38 | #include <opie2/multiauthconfigwidget.h> | ||
39 | |||
40 | class PinConfigWidget : public MultiauthConfigWidget { | ||
41 | public: | ||
42 | PinConfigWidget(QWidget* parent, const char* name); | ||
43 | virtual ~PinConfigWidget(); | ||
44 | virtual void writeConfig(); | ||
45 | ///\todo to protect? | ||
46 | QPushButton *changePIN; | ||
47 | QPushButton *clearPIN; | ||
48 | |||
49 | }; | ||
50 | |||
51 | #endif // PINCONFIGWIDGET_H | ||
diff --git a/noncore/securityplugins/pin/pinDialogBase.cpp b/noncore/securityplugins/pin/pinDialogBase.cpp new file mode 100644 index 0000000..244a75e --- a/dev/null +++ b/noncore/securityplugins/pin/pinDialogBase.cpp | |||
@@ -0,0 +1,304 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'pinDialogBase.ui' | ||
3 | ** | ||
4 | ** Created: Mon Jun 14 11:01:08 2004 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "pinDialogBase.h" | ||
10 | |||
11 | #include <qlabel.h> | ||
12 | #include <qlineedit.h> | ||
13 | #include <qlayout.h> | ||
14 | #include <qvariant.h> | ||
15 | #include <qtooltip.h> | ||
16 | #include <qwhatsthis.h> | ||
17 | |||
18 | /* | ||
19 | * Constructs a PinDialogBase which is a child of 'parent', with the | ||
20 | * name 'name' and widget flags set to 'f' | ||
21 | */ | ||
22 | PinDialogBase::PinDialogBase( QWidget* parent, const char* name, WFlags fl ) | ||
23 | : QWidget( parent, name, fl ) | ||
24 | { | ||
25 | if ( !name ) | ||
26 | setName( "PinDialogBase" ); | ||
27 | resize( 231, 293 ); | ||
28 | QFont f( font() ); | ||
29 | f.setPointSize( 24 ); | ||
30 | setFont( f ); | ||
31 | setCaption( tr( "PinDialogBase" ) ); | ||
32 | |||
33 | button_4 = new QLabel( this, "button_4" ); | ||
34 | button_4->setGeometry( QRect( 11, 138, 68, 44 ) ); | ||
35 | button_4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_4->sizePolicy().hasHeightForWidth() ) ); | ||
36 | button_4->setFrameShape( QLabel::Box ); | ||
37 | button_4->setFrameShadow( QLabel::Raised ); | ||
38 | button_4->setText( tr( "4" ) ); | ||
39 | button_4->setAlignment( int( QLabel::AlignCenter ) ); | ||
40 | |||
41 | button_7 = new QLabel( this, "button_7" ); | ||
42 | button_7->setGeometry( QRect( 11, 188, 68, 44 ) ); | ||
43 | button_7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_7->sizePolicy().hasHeightForWidth() ) ); | ||
44 | button_7->setFrameShape( QLabel::Box ); | ||
45 | button_7->setFrameShadow( QLabel::Raised ); | ||
46 | button_7->setText( tr( "7" ) ); | ||
47 | button_7->setAlignment( int( QLabel::AlignCenter ) ); | ||
48 | |||
49 | prompt = new QLabel( this, "prompt" ); | ||
50 | prompt->setGeometry( QRect( 11, 11, 217, 25 ) ); | ||
51 | QFont prompt_font( prompt->font() ); | ||
52 | prompt_font.setPointSize( 18 ); | ||
53 | prompt->setFont( prompt_font ); | ||
54 | prompt->setText( tr( "Enter your PIN" ) ); | ||
55 | |||
56 | display = new QLineEdit( this, "display" ); | ||
57 | display->setEnabled( FALSE ); | ||
58 | display->setGeometry( QRect( 11, 42, 217, 40 ) ); | ||
59 | QPalette pal; | ||
60 | QColorGroup cg; | ||
61 | cg.setColor( QColorGroup::Foreground, black ); | ||
62 | cg.setColor( QColorGroup::Button, QColor( 228, 228, 228) ); | ||
63 | cg.setColor( QColorGroup::Light, white ); | ||
64 | cg.setColor( QColorGroup::Midlight, QColor( 242, 242, 242) ); | ||
65 | cg.setColor( QColorGroup::Dark, QColor( 78, 78, 78) ); | ||
66 | cg.setColor( QColorGroup::Mid, QColor( 183, 183, 183) ); | ||
67 | cg.setColor( QColorGroup::Text, black ); | ||
68 | cg.setColor( QColorGroup::BrightText, white ); | ||
69 | cg.setColor( QColorGroup::ButtonText, black ); | ||
70 | cg.setColor( QColorGroup::Base, white ); | ||
71 | cg.setColor( QColorGroup::Background, QColor( 220, 220, 220) ); | ||
72 | cg.setColor( QColorGroup::Shadow, black ); | ||
73 | cg.setColor( QColorGroup::Highlight, QColor( 10, 95, 137) ); | ||
74 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
75 | pal.setActive( cg ); | ||
76 | cg.setColor( QColorGroup::Foreground, black ); | ||
77 | cg.setColor( QColorGroup::Button, QColor( 228, 228, 228) ); | ||
78 | cg.setColor( QColorGroup::Light, white ); | ||
79 | cg.setColor( QColorGroup::Midlight, QColor( 242, 242, 242) ); | ||
80 | cg.setColor( QColorGroup::Dark, QColor( 78, 78, 78) ); | ||
81 | cg.setColor( QColorGroup::Mid, QColor( 183, 183, 183) ); | ||
82 | cg.setColor( QColorGroup::Text, black ); | ||
83 | cg.setColor( QColorGroup::BrightText, white ); | ||
84 | cg.setColor( QColorGroup::ButtonText, black ); | ||
85 | cg.setColor( QColorGroup::Base, white ); | ||
86 | cg.setColor( QColorGroup::Background, QColor( 220, 220, 220) ); | ||
87 | cg.setColor( QColorGroup::Shadow, black ); | ||
88 | cg.setColor( QColorGroup::Highlight, QColor( 10, 95, 137) ); | ||
89 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
90 | pal.setInactive( cg ); | ||
91 | cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) ); | ||
92 | cg.setColor( QColorGroup::Button, QColor( 228, 228, 228) ); | ||
93 | cg.setColor( QColorGroup::Light, white ); | ||
94 | cg.setColor( QColorGroup::Midlight, white ); | ||
95 | cg.setColor( QColorGroup::Dark, QColor( 114, 114, 114) ); | ||
96 | cg.setColor( QColorGroup::Mid, QColor( 152, 152, 152) ); | ||
97 | cg.setColor( QColorGroup::Text, black ); | ||
98 | cg.setColor( QColorGroup::BrightText, white ); | ||
99 | cg.setColor( QColorGroup::ButtonText, black ); | ||
100 | cg.setColor( QColorGroup::Base, white ); | ||
101 | cg.setColor( QColorGroup::Background, QColor( 220, 220, 220) ); | ||
102 | cg.setColor( QColorGroup::Shadow, black ); | ||
103 | cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) ); | ||
104 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
105 | pal.setDisabled( cg ); | ||
106 | display->setPalette( pal ); | ||
107 | display->setEchoMode( QLineEdit::Password ); | ||
108 | |||
109 | button_1 = new QLabel( this, "button_1" ); | ||
110 | button_1->setGeometry( QRect( 11, 88, 68, 44 ) ); | ||
111 | button_1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_1->sizePolicy().hasHeightForWidth() ) ); | ||
112 | button_1->setFrameShape( QLabel::Box ); | ||
113 | button_1->setFrameShadow( QLabel::Raised ); | ||
114 | button_1->setText( tr( "1" ) ); | ||
115 | button_1->setAlignment( int( QLabel::AlignCenter ) ); | ||
116 | |||
117 | button_2 = new QLabel( this, "button_2" ); | ||
118 | button_2->setGeometry( QRect( 85, 88, 69, 44 ) ); | ||
119 | button_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_2->sizePolicy().hasHeightForWidth() ) ); | ||
120 | button_2->setFrameShape( QLabel::Box ); | ||
121 | button_2->setFrameShadow( QLabel::Raised ); | ||
122 | button_2->setText( tr( "2" ) ); | ||
123 | button_2->setAlignment( int( QLabel::AlignCenter ) ); | ||
124 | |||
125 | button_5 = new QLabel( this, "button_5" ); | ||
126 | button_5->setGeometry( QRect( 85, 138, 69, 44 ) ); | ||
127 | button_5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_5->sizePolicy().hasHeightForWidth() ) ); | ||
128 | button_5->setFrameShape( QLabel::Box ); | ||
129 | button_5->setFrameShadow( QLabel::Raised ); | ||
130 | button_5->setText( tr( "5" ) ); | ||
131 | button_5->setAlignment( int( QLabel::AlignCenter ) ); | ||
132 | |||
133 | button_6 = new QLabel( this, "button_6" ); | ||
134 | button_6->setGeometry( QRect( 160, 138, 68, 44 ) ); | ||
135 | button_6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_6->sizePolicy().hasHeightForWidth() ) ); | ||
136 | button_6->setFrameShape( QLabel::Box ); | ||
137 | button_6->setFrameShadow( QLabel::Raised ); | ||
138 | button_6->setText( tr( "6" ) ); | ||
139 | button_6->setAlignment( int( QLabel::AlignCenter ) ); | ||
140 | |||
141 | button_3 = new QLabel( this, "button_3" ); | ||
142 | button_3->setGeometry( QRect( 160, 88, 68, 44 ) ); | ||
143 | button_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_3->sizePolicy().hasHeightForWidth() ) ); | ||
144 | button_3->setFrameShape( QLabel::Box ); | ||
145 | button_3->setFrameShadow( QLabel::Raised ); | ||
146 | button_3->setText( tr( "3" ) ); | ||
147 | button_3->setAlignment( int( QLabel::AlignCenter ) ); | ||
148 | |||
149 | button_0 = new QLabel( this, "button_0" ); | ||
150 | button_0->setGeometry( QRect( 11, 238, 68, 44 ) ); | ||
151 | button_0->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_0->sizePolicy().hasHeightForWidth() ) ); | ||
152 | button_0->setFrameShape( QLabel::Box ); | ||
153 | button_0->setFrameShadow( QLabel::Raised ); | ||
154 | button_0->setText( tr( "0" ) ); | ||
155 | button_0->setAlignment( int( QLabel::AlignCenter ) ); | ||
156 | |||
157 | button_8 = new QLabel( this, "button_8" ); | ||
158 | button_8->setGeometry( QRect( 85, 188, 69, 44 ) ); | ||
159 | button_8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_8->sizePolicy().hasHeightForWidth() ) ); | ||
160 | button_8->setFrameShape( QLabel::Box ); | ||
161 | button_8->setFrameShadow( QLabel::Raised ); | ||
162 | button_8->setText( tr( "8" ) ); | ||
163 | button_8->setAlignment( int( QLabel::AlignCenter ) ); | ||
164 | |||
165 | button_9 = new QLabel( this, "button_9" ); | ||
166 | button_9->setGeometry( QRect( 160, 188, 68, 44 ) ); | ||
167 | button_9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_9->sizePolicy().hasHeightForWidth() ) ); | ||
168 | button_9->setFrameShape( QLabel::Box ); | ||
169 | button_9->setFrameShadow( QLabel::Raised ); | ||
170 | button_9->setText( tr( "9" ) ); | ||
171 | button_9->setAlignment( int( QLabel::AlignCenter ) ); | ||
172 | |||
173 | button_OK = new QLabel( this, "button_OK" ); | ||
174 | button_OK->setGeometry( QRect( 160, 238, 68, 44 ) ); | ||
175 | button_OK->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_OK->sizePolicy().hasHeightForWidth() ) ); | ||
176 | cg.setColor( QColorGroup::Foreground, black ); | ||
177 | cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) ); | ||
178 | cg.setColor( QColorGroup::Light, white ); | ||
179 | cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) ); | ||
180 | cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) ); | ||
181 | cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) ); | ||
182 | cg.setColor( QColorGroup::Text, black ); | ||
183 | cg.setColor( QColorGroup::BrightText, white ); | ||
184 | cg.setColor( QColorGroup::ButtonText, black ); | ||
185 | cg.setColor( QColorGroup::Base, white ); | ||
186 | cg.setColor( QColorGroup::Background, QColor( 0, 170, 0) ); | ||
187 | cg.setColor( QColorGroup::Shadow, black ); | ||
188 | cg.setColor( QColorGroup::Highlight, black ); | ||
189 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
190 | pal.setActive( cg ); | ||
191 | cg.setColor( QColorGroup::Foreground, black ); | ||
192 | cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) ); | ||
193 | cg.setColor( QColorGroup::Light, white ); | ||
194 | cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) ); | ||
195 | cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) ); | ||
196 | cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) ); | ||
197 | cg.setColor( QColorGroup::Text, black ); | ||
198 | cg.setColor( QColorGroup::BrightText, white ); | ||
199 | cg.setColor( QColorGroup::ButtonText, black ); | ||
200 | cg.setColor( QColorGroup::Base, white ); | ||
201 | cg.setColor( QColorGroup::Background, QColor( 0, 170, 0) ); | ||
202 | cg.setColor( QColorGroup::Shadow, black ); | ||
203 | cg.setColor( QColorGroup::Highlight, black ); | ||
204 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
205 | pal.setInactive( cg ); | ||
206 | cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) ); | ||
207 | cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) ); | ||
208 | cg.setColor( QColorGroup::Light, white ); | ||
209 | cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) ); | ||
210 | cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) ); | ||
211 | cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) ); | ||
212 | cg.setColor( QColorGroup::Text, black ); | ||
213 | cg.setColor( QColorGroup::BrightText, white ); | ||
214 | cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) ); | ||
215 | cg.setColor( QColorGroup::Base, white ); | ||
216 | cg.setColor( QColorGroup::Background, QColor( 0, 170, 0) ); | ||
217 | cg.setColor( QColorGroup::Shadow, black ); | ||
218 | cg.setColor( QColorGroup::Highlight, black ); | ||
219 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
220 | pal.setDisabled( cg ); | ||
221 | button_OK->setPalette( pal ); | ||
222 | button_OK->setFrameShape( QLabel::Box ); | ||
223 | button_OK->setFrameShadow( QLabel::Raised ); | ||
224 | button_OK->setText( tr( "Enter" ) ); | ||
225 | button_OK->setAlignment( int( QLabel::AlignCenter ) ); | ||
226 | |||
227 | button_Skip = new QLabel( this, "button_Skip" ); | ||
228 | button_Skip->setGeometry( QRect( 85, 238, 69, 44 ) ); | ||
229 | button_Skip->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, button_Skip->sizePolicy().hasHeightForWidth() ) ); | ||
230 | cg.setColor( QColorGroup::Foreground, black ); | ||
231 | cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) ); | ||
232 | cg.setColor( QColorGroup::Light, white ); | ||
233 | cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) ); | ||
234 | cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) ); | ||
235 | cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) ); | ||
236 | cg.setColor( QColorGroup::Text, black ); | ||
237 | cg.setColor( QColorGroup::BrightText, white ); | ||
238 | cg.setColor( QColorGroup::ButtonText, black ); | ||
239 | cg.setColor( QColorGroup::Base, white ); | ||
240 | cg.setColor( QColorGroup::Background, QColor( 255, 255, 127) ); | ||
241 | cg.setColor( QColorGroup::Shadow, black ); | ||
242 | cg.setColor( QColorGroup::Highlight, black ); | ||
243 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
244 | pal.setActive( cg ); | ||
245 | cg.setColor( QColorGroup::Foreground, black ); | ||
246 | cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) ); | ||
247 | cg.setColor( QColorGroup::Light, white ); | ||
248 | cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) ); | ||
249 | cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) ); | ||
250 | cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) ); | ||
251 | cg.setColor( QColorGroup::Text, black ); | ||
252 | cg.setColor( QColorGroup::BrightText, white ); | ||
253 | cg.setColor( QColorGroup::ButtonText, black ); | ||
254 | cg.setColor( QColorGroup::Base, white ); | ||
255 | cg.setColor( QColorGroup::Background, QColor( 255, 255, 127) ); | ||
256 | cg.setColor( QColorGroup::Shadow, black ); | ||
257 | cg.setColor( QColorGroup::Highlight, black ); | ||
258 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
259 | pal.setInactive( cg ); | ||
260 | cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) ); | ||
261 | cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) ); | ||
262 | cg.setColor( QColorGroup::Light, white ); | ||
263 | cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) ); | ||
264 | cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) ); | ||
265 | cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) ); | ||
266 | cg.setColor( QColorGroup::Text, black ); | ||
267 | cg.setColor( QColorGroup::BrightText, white ); | ||
268 | cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) ); | ||
269 | cg.setColor( QColorGroup::Base, white ); | ||
270 | cg.setColor( QColorGroup::Background, QColor( 255, 255, 127) ); | ||
271 | cg.setColor( QColorGroup::Shadow, black ); | ||
272 | cg.setColor( QColorGroup::Highlight, black ); | ||
273 | cg.setColor( QColorGroup::HighlightedText, white ); | ||
274 | pal.setDisabled( cg ); | ||
275 | button_Skip->setPalette( pal ); | ||
276 | button_Skip->setFrameShape( QLabel::Box ); | ||
277 | button_Skip->setFrameShadow( QLabel::Raised ); | ||
278 | button_Skip->setText( tr( "Skip" ) ); | ||
279 | button_Skip->setAlignment( int( QLabel::AlignCenter ) ); | ||
280 | } | ||
281 | |||
282 | /* | ||
283 | * Destroys the object and frees any allocated resources | ||
284 | */ | ||
285 | PinDialogBase::~PinDialogBase() | ||
286 | { | ||
287 | // no need to delete child widgets, Qt does it all for us | ||
288 | } | ||
289 | |||
290 | /* | ||
291 | * Main event handler. Reimplemented to handle application | ||
292 | * font changes | ||
293 | */ | ||
294 | bool PinDialogBase::event( QEvent* ev ) | ||
295 | { | ||
296 | bool ret = QWidget::event( ev ); | ||
297 | if ( ev->type() == QEvent::ApplicationFontChange ) { | ||
298 | QFont prompt_font( prompt->font() ); | ||
299 | prompt_font.setPointSize( 18 ); | ||
300 | prompt->setFont( prompt_font ); | ||
301 | } | ||
302 | return ret; | ||
303 | } | ||
304 | |||
diff --git a/noncore/securityplugins/pin/pinDialogBase.h b/noncore/securityplugins/pin/pinDialogBase.h new file mode 100644 index 0000000..3ed2b63 --- a/dev/null +++ b/noncore/securityplugins/pin/pinDialogBase.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form interface generated from reading ui file 'pinDialogBase.ui' | ||
3 | ** | ||
4 | ** Created: Mon Jun 14 11:00:59 2004 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #ifndef PINDIALOGBASE_H | ||
10 | #define PINDIALOGBASE_H | ||
11 | |||
12 | #include <qvariant.h> | ||
13 | #include <qwidget.h> | ||
14 | class QVBoxLayout; | ||
15 | class QHBoxLayout; | ||
16 | class QGridLayout; | ||
17 | class QLabel; | ||
18 | class QLineEdit; | ||
19 | |||
20 | class PinDialogBase : public QWidget | ||
21 | { | ||
22 | Q_OBJECT | ||
23 | |||
24 | public: | ||
25 | PinDialogBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | ||
26 | ~PinDialogBase(); | ||
27 | |||
28 | QLabel* button_4; | ||
29 | QLabel* button_7; | ||
30 | QLabel* prompt; | ||
31 | QLineEdit* display; | ||
32 | QLabel* button_1; | ||
33 | QLabel* button_2; | ||
34 | QLabel* button_5; | ||
35 | QLabel* button_6; | ||
36 | QLabel* button_3; | ||
37 | QLabel* button_0; | ||
38 | QLabel* button_8; | ||
39 | QLabel* button_9; | ||
40 | QLabel* button_OK; | ||
41 | QLabel* button_Skip; | ||
42 | |||
43 | protected: | ||
44 | bool event( QEvent* ); | ||
45 | }; | ||
46 | |||
47 | #endif // PINDIALOGBASE_H | ||
diff --git a/noncore/securityplugins/pin/pinDialogBase.ui b/noncore/securityplugins/pin/pinDialogBase.ui new file mode 100644 index 0000000..79e7a55 --- a/dev/null +++ b/noncore/securityplugins/pin/pinDialogBase.ui | |||
@@ -0,0 +1,1258 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>PinDialogBase</class> | ||
3 | <widget> | ||
4 | <class>QWidget</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>PinDialogBase</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>231</width> | ||
15 | <height>293</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>font</name> | ||
20 | <font> | ||
21 | <pointsize>24</pointsize> | ||
22 | </font> | ||
23 | </property> | ||
24 | <property stdset="1"> | ||
25 | <name>caption</name> | ||
26 | <string>PinDialogBase</string> | ||
27 | </property> | ||
28 | <widget> | ||
29 | <class>QLabel</class> | ||
30 | <property stdset="1"> | ||
31 | <name>name</name> | ||
32 | <cstring>button_4</cstring> | ||
33 | </property> | ||
34 | <property stdset="1"> | ||
35 | <name>geometry</name> | ||
36 | <rect> | ||
37 | <x>11</x> | ||
38 | <y>138</y> | ||
39 | <width>68</width> | ||
40 | <height>44</height> | ||
41 | </rect> | ||
42 | </property> | ||
43 | <property stdset="1"> | ||
44 | <name>sizePolicy</name> | ||
45 | <sizepolicy> | ||
46 | <hsizetype>5</hsizetype> | ||
47 | <vsizetype>5</vsizetype> | ||
48 | </sizepolicy> | ||
49 | </property> | ||
50 | <property stdset="1"> | ||
51 | <name>frameShape</name> | ||
52 | <enum>Box</enum> | ||
53 | </property> | ||
54 | <property stdset="1"> | ||
55 | <name>frameShadow</name> | ||
56 | <enum>Raised</enum> | ||
57 | </property> | ||
58 | <property stdset="1"> | ||
59 | <name>text</name> | ||
60 | <string>4</string> | ||
61 | </property> | ||
62 | <property stdset="1"> | ||
63 | <name>alignment</name> | ||
64 | <set>AlignCenter</set> | ||
65 | </property> | ||
66 | <property> | ||
67 | <name>hAlign</name> | ||
68 | </property> | ||
69 | </widget> | ||
70 | <widget> | ||
71 | <class>QLabel</class> | ||
72 | <property stdset="1"> | ||
73 | <name>name</name> | ||
74 | <cstring>button_7</cstring> | ||
75 | </property> | ||
76 | <property stdset="1"> | ||
77 | <name>geometry</name> | ||
78 | <rect> | ||
79 | <x>11</x> | ||
80 | <y>188</y> | ||
81 | <width>68</width> | ||
82 | <height>44</height> | ||
83 | </rect> | ||
84 | </property> | ||
85 | <property stdset="1"> | ||
86 | <name>sizePolicy</name> | ||
87 | <sizepolicy> | ||
88 | <hsizetype>5</hsizetype> | ||
89 | <vsizetype>5</vsizetype> | ||
90 | </sizepolicy> | ||
91 | </property> | ||
92 | <property stdset="1"> | ||
93 | <name>frameShape</name> | ||
94 | <enum>Box</enum> | ||
95 | </property> | ||
96 | <property stdset="1"> | ||
97 | <name>frameShadow</name> | ||
98 | <enum>Raised</enum> | ||
99 | </property> | ||
100 | <property stdset="1"> | ||
101 | <name>text</name> | ||
102 | <string>7</string> | ||
103 | </property> | ||
104 | <property stdset="1"> | ||
105 | <name>alignment</name> | ||
106 | <set>AlignCenter</set> | ||
107 | </property> | ||
108 | <property> | ||
109 | <name>hAlign</name> | ||
110 | </property> | ||
111 | </widget> | ||
112 | <widget> | ||
113 | <class>QLabel</class> | ||
114 | <property stdset="1"> | ||
115 | <name>name</name> | ||
116 | <cstring>prompt</cstring> | ||
117 | </property> | ||
118 | <property stdset="1"> | ||
119 | <name>geometry</name> | ||
120 | <rect> | ||
121 | <x>11</x> | ||
122 | <y>11</y> | ||
123 | <width>217</width> | ||
124 | <height>25</height> | ||
125 | </rect> | ||
126 | </property> | ||
127 | <property stdset="1"> | ||
128 | <name>font</name> | ||
129 | <font> | ||
130 | <pointsize>18</pointsize> | ||
131 | </font> | ||
132 | </property> | ||
133 | <property stdset="1"> | ||
134 | <name>text</name> | ||
135 | <string>Enter your PIN</string> | ||
136 | </property> | ||
137 | </widget> | ||
138 | <widget> | ||
139 | <class>QLineEdit</class> | ||
140 | <property stdset="1"> | ||
141 | <name>name</name> | ||
142 | <cstring>display</cstring> | ||
143 | </property> | ||
144 | <property stdset="1"> | ||
145 | <name>enabled</name> | ||
146 | <bool>false</bool> | ||
147 | </property> | ||
148 | <property stdset="1"> | ||
149 | <name>geometry</name> | ||
150 | <rect> | ||
151 | <x>11</x> | ||
152 | <y>42</y> | ||
153 | <width>217</width> | ||
154 | <height>40</height> | ||
155 | </rect> | ||
156 | </property> | ||
157 | <property stdset="1"> | ||
158 | <name>palette</name> | ||
159 | <palette> | ||
160 | <active> | ||
161 | <color> | ||
162 | <red>0</red> | ||
163 | <green>0</green> | ||
164 | <blue>0</blue> | ||
165 | </color> | ||
166 | <color> | ||
167 | <red>228</red> | ||
168 | <green>228</green> | ||
169 | <blue>228</blue> | ||
170 | </color> | ||
171 | <color> | ||
172 | <red>255</red> | ||
173 | <green>255</green> | ||
174 | <blue>255</blue> | ||
175 | </color> | ||
176 | <color> | ||
177 | <red>242</red> | ||
178 | <green>242</green> | ||
179 | <blue>242</blue> | ||
180 | </color> | ||
181 | <color> | ||
182 | <red>78</red> | ||
183 | <green>78</green> | ||
184 | <blue>78</blue> | ||
185 | </color> | ||
186 | <color> | ||
187 | <red>183</red> | ||
188 | <green>183</green> | ||
189 | <blue>183</blue> | ||
190 | </color> | ||
191 | <color> | ||
192 | <red>0</red> | ||
193 | <green>0</green> | ||
194 | <blue>0</blue> | ||
195 | </color> | ||
196 | <color> | ||
197 | <red>255</red> | ||
198 | <green>255</green> | ||
199 | <blue>255</blue> | ||
200 | </color> | ||
201 | <color> | ||
202 | <red>0</red> | ||
203 | <green>0</green> | ||
204 | <blue>0</blue> | ||
205 | </color> | ||
206 | <color> | ||
207 | <red>255</red> | ||
208 | <green>255</green> | ||
209 | <blue>255</blue> | ||
210 | </color> | ||
211 | <color> | ||
212 | <red>220</red> | ||
213 | <green>220</green> | ||
214 | <blue>220</blue> | ||
215 | </color> | ||
216 | <color> | ||
217 | <red>0</red> | ||
218 | <green>0</green> | ||
219 | <blue>0</blue> | ||
220 | </color> | ||
221 | <color> | ||
222 | <red>10</red> | ||
223 | <green>95</green> | ||
224 | <blue>137</blue> | ||
225 | </color> | ||
226 | <color> | ||
227 | <red>255</red> | ||
228 | <green>255</green> | ||
229 | <blue>255</blue> | ||
230 | </color> | ||
231 | </active> | ||
232 | <disabled> | ||
233 | <color> | ||
234 | <red>128</red> | ||
235 | <green>128</green> | ||
236 | <blue>128</blue> | ||
237 | </color> | ||
238 | <color> | ||
239 | <red>228</red> | ||
240 | <green>228</green> | ||
241 | <blue>228</blue> | ||
242 | </color> | ||
243 | <color> | ||
244 | <red>255</red> | ||
245 | <green>255</green> | ||
246 | <blue>255</blue> | ||
247 | </color> | ||
248 | <color> | ||
249 | <red>255</red> | ||
250 | <green>255</green> | ||
251 | <blue>255</blue> | ||
252 | </color> | ||
253 | <color> | ||
254 | <red>114</red> | ||
255 | <green>114</green> | ||
256 | <blue>114</blue> | ||
257 | </color> | ||
258 | <color> | ||
259 | <red>152</red> | ||
260 | <green>152</green> | ||
261 | <blue>152</blue> | ||
262 | </color> | ||
263 | <color> | ||
264 | <red>0</red> | ||
265 | <green>0</green> | ||
266 | <blue>0</blue> | ||
267 | </color> | ||
268 | <color> | ||
269 | <red>255</red> | ||
270 | <green>255</green> | ||
271 | <blue>255</blue> | ||
272 | </color> | ||
273 | <color> | ||
274 | <red>0</red> | ||
275 | <green>0</green> | ||
276 | <blue>0</blue> | ||
277 | </color> | ||
278 | <color> | ||
279 | <red>255</red> | ||
280 | <green>255</green> | ||
281 | <blue>255</blue> | ||
282 | </color> | ||
283 | <color> | ||
284 | <red>220</red> | ||
285 | <green>220</green> | ||
286 | <blue>220</blue> | ||
287 | </color> | ||
288 | <color> | ||
289 | <red>0</red> | ||
290 | <green>0</green> | ||
291 | <blue>0</blue> | ||
292 | </color> | ||
293 | <color> | ||
294 | <red>0</red> | ||
295 | <green>0</green> | ||
296 | <blue>128</blue> | ||
297 | </color> | ||
298 | <color> | ||
299 | <red>255</red> | ||
300 | <green>255</green> | ||
301 | <blue>255</blue> | ||
302 | </color> | ||
303 | </disabled> | ||
304 | <inactive> | ||
305 | <color> | ||
306 | <red>0</red> | ||
307 | <green>0</green> | ||
308 | <blue>0</blue> | ||
309 | </color> | ||
310 | <color> | ||
311 | <red>228</red> | ||
312 | <green>228</green> | ||
313 | <blue>228</blue> | ||
314 | </color> | ||
315 | <color> | ||
316 | <red>255</red> | ||
317 | <green>255</green> | ||
318 | <blue>255</blue> | ||
319 | </color> | ||
320 | <color> | ||
321 | <red>242</red> | ||
322 | <green>242</green> | ||
323 | <blue>242</blue> | ||
324 | </color> | ||
325 | <color> | ||
326 | <red>78</red> | ||
327 | <green>78</green> | ||
328 | <blue>78</blue> | ||
329 | </color> | ||
330 | <color> | ||
331 | <red>183</red> | ||
332 | <green>183</green> | ||
333 | <blue>183</blue> | ||
334 | </color> | ||
335 | <color> | ||
336 | <red>0</red> | ||
337 | <green>0</green> | ||
338 | <blue>0</blue> | ||
339 | </color> | ||
340 | <color> | ||
341 | <red>255</red> | ||
342 | <green>255</green> | ||
343 | <blue>255</blue> | ||
344 | </color> | ||
345 | <color> | ||
346 | <red>0</red> | ||
347 | <green>0</green> | ||
348 | <blue>0</blue> | ||
349 | </color> | ||
350 | <color> | ||
351 | <red>255</red> | ||
352 | <green>255</green> | ||
353 | <blue>255</blue> | ||
354 | </color> | ||
355 | <color> | ||
356 | <red>220</red> | ||
357 | <green>220</green> | ||
358 | <blue>220</blue> | ||
359 | </color> | ||
360 | <color> | ||
361 | <red>0</red> | ||
362 | <green>0</green> | ||
363 | <blue>0</blue> | ||
364 | </color> | ||
365 | <color> | ||
366 | <red>10</red> | ||
367 | <green>95</green> | ||
368 | <blue>137</blue> | ||
369 | </color> | ||
370 | <color> | ||
371 | <red>255</red> | ||
372 | <green>255</green> | ||
373 | <blue>255</blue> | ||
374 | </color> | ||
375 | </inactive> | ||
376 | </palette> | ||
377 | </property> | ||
378 | <property stdset="1"> | ||
379 | <name>echoMode</name> | ||
380 | <enum>Password</enum> | ||
381 | </property> | ||
382 | </widget> | ||
383 | <widget> | ||
384 | <class>QLabel</class> | ||
385 | <property stdset="1"> | ||
386 | <name>name</name> | ||
387 | <cstring>button_1</cstring> | ||
388 | </property> | ||
389 | <property stdset="1"> | ||
390 | <name>geometry</name> | ||
391 | <rect> | ||
392 | <x>11</x> | ||
393 | <y>88</y> | ||
394 | <width>68</width> | ||
395 | <height>44</height> | ||
396 | </rect> | ||
397 | </property> | ||
398 | <property stdset="1"> | ||
399 | <name>sizePolicy</name> | ||
400 | <sizepolicy> | ||
401 | <hsizetype>5</hsizetype> | ||
402 | <vsizetype>5</vsizetype> | ||
403 | </sizepolicy> | ||
404 | </property> | ||
405 | <property stdset="1"> | ||
406 | <name>frameShape</name> | ||
407 | <enum>Box</enum> | ||
408 | </property> | ||
409 | <property stdset="1"> | ||
410 | <name>frameShadow</name> | ||
411 | <enum>Raised</enum> | ||
412 | </property> | ||
413 | <property stdset="1"> | ||
414 | <name>text</name> | ||
415 | <string>1</string> | ||
416 | </property> | ||
417 | <property stdset="1"> | ||
418 | <name>alignment</name> | ||
419 | <set>AlignCenter</set> | ||
420 | </property> | ||
421 | <property> | ||
422 | <name>hAlign</name> | ||
423 | </property> | ||
424 | </widget> | ||
425 | <widget> | ||
426 | <class>QLabel</class> | ||
427 | <property stdset="1"> | ||
428 | <name>name</name> | ||
429 | <cstring>button_2</cstring> | ||
430 | </property> | ||
431 | <property stdset="1"> | ||
432 | <name>geometry</name> | ||
433 | <rect> | ||
434 | <x>85</x> | ||
435 | <y>88</y> | ||
436 | <width>69</width> | ||
437 | <height>44</height> | ||
438 | </rect> | ||
439 | </property> | ||
440 | <property stdset="1"> | ||
441 | <name>sizePolicy</name> | ||
442 | <sizepolicy> | ||
443 | <hsizetype>5</hsizetype> | ||
444 | <vsizetype>5</vsizetype> | ||
445 | </sizepolicy> | ||
446 | </property> | ||
447 | <property stdset="1"> | ||
448 | <name>frameShape</name> | ||
449 | <enum>Box</enum> | ||
450 | </property> | ||
451 | <property stdset="1"> | ||
452 | <name>frameShadow</name> | ||
453 | <enum>Raised</enum> | ||
454 | </property> | ||
455 | <property stdset="1"> | ||
456 | <name>text</name> | ||
457 | <string>2</string> | ||
458 | </property> | ||
459 | <property stdset="1"> | ||
460 | <name>alignment</name> | ||
461 | <set>AlignCenter</set> | ||
462 | </property> | ||
463 | <property> | ||
464 | <name>hAlign</name> | ||
465 | </property> | ||
466 | </widget> | ||
467 | <widget> | ||
468 | <class>QLabel</class> | ||
469 | <property stdset="1"> | ||
470 | <name>name</name> | ||
471 | <cstring>button_5</cstring> | ||
472 | </property> | ||
473 | <property stdset="1"> | ||
474 | <name>geometry</name> | ||
475 | <rect> | ||
476 | <x>85</x> | ||
477 | <y>138</y> | ||
478 | <width>69</width> | ||
479 | <height>44</height> | ||
480 | </rect> | ||
481 | </property> | ||
482 | <property stdset="1"> | ||
483 | <name>sizePolicy</name> | ||
484 | <sizepolicy> | ||
485 | <hsizetype>5</hsizetype> | ||
486 | <vsizetype>5</vsizetype> | ||
487 | </sizepolicy> | ||
488 | </property> | ||
489 | <property stdset="1"> | ||
490 | <name>frameShape</name> | ||
491 | <enum>Box</enum> | ||
492 | </property> | ||
493 | <property stdset="1"> | ||
494 | <name>frameShadow</name> | ||
495 | <enum>Raised</enum> | ||
496 | </property> | ||
497 | <property stdset="1"> | ||
498 | <name>text</name> | ||
499 | <string>5</string> | ||
500 | </property> | ||
501 | <property stdset="1"> | ||
502 | <name>alignment</name> | ||
503 | <set>AlignCenter</set> | ||
504 | </property> | ||
505 | <property> | ||
506 | <name>hAlign</name> | ||
507 | </property> | ||
508 | </widget> | ||
509 | <widget> | ||
510 | <class>QLabel</class> | ||
511 | <property stdset="1"> | ||
512 | <name>name</name> | ||
513 | <cstring>button_6</cstring> | ||
514 | </property> | ||
515 | <property stdset="1"> | ||
516 | <name>geometry</name> | ||
517 | <rect> | ||
518 | <x>160</x> | ||
519 | <y>138</y> | ||
520 | <width>68</width> | ||
521 | <height>44</height> | ||
522 | </rect> | ||
523 | </property> | ||
524 | <property stdset="1"> | ||
525 | <name>sizePolicy</name> | ||
526 | <sizepolicy> | ||
527 | <hsizetype>5</hsizetype> | ||
528 | <vsizetype>5</vsizetype> | ||
529 | </sizepolicy> | ||
530 | </property> | ||
531 | <property stdset="1"> | ||
532 | <name>frameShape</name> | ||
533 | <enum>Box</enum> | ||
534 | </property> | ||
535 | <property stdset="1"> | ||
536 | <name>frameShadow</name> | ||
537 | <enum>Raised</enum> | ||
538 | </property> | ||
539 | <property stdset="1"> | ||
540 | <name>text</name> | ||
541 | <string>6</string> | ||
542 | </property> | ||
543 | <property stdset="1"> | ||
544 | <name>alignment</name> | ||
545 | <set>AlignCenter</set> | ||
546 | </property> | ||
547 | <property> | ||
548 | <name>hAlign</name> | ||
549 | </property> | ||
550 | </widget> | ||
551 | <widget> | ||
552 | <class>QLabel</class> | ||
553 | <property stdset="1"> | ||
554 | <name>name</name> | ||
555 | <cstring>button_3</cstring> | ||
556 | </property> | ||
557 | <property stdset="1"> | ||
558 | <name>geometry</name> | ||
559 | <rect> | ||
560 | <x>160</x> | ||
561 | <y>88</y> | ||
562 | <width>68</width> | ||
563 | <height>44</height> | ||
564 | </rect> | ||
565 | </property> | ||
566 | <property stdset="1"> | ||
567 | <name>sizePolicy</name> | ||
568 | <sizepolicy> | ||
569 | <hsizetype>5</hsizetype> | ||
570 | <vsizetype>5</vsizetype> | ||
571 | </sizepolicy> | ||
572 | </property> | ||
573 | <property stdset="1"> | ||
574 | <name>frameShape</name> | ||
575 | <enum>Box</enum> | ||
576 | </property> | ||
577 | <property stdset="1"> | ||
578 | <name>frameShadow</name> | ||
579 | <enum>Raised</enum> | ||
580 | </property> | ||
581 | <property stdset="1"> | ||
582 | <name>text</name> | ||
583 | <string>3</string> | ||
584 | </property> | ||
585 | <property stdset="1"> | ||
586 | <name>alignment</name> | ||
587 | <set>AlignCenter</set> | ||
588 | </property> | ||
589 | <property> | ||
590 | <name>hAlign</name> | ||
591 | </property> | ||
592 | </widget> | ||
593 | <widget> | ||
594 | <class>QLabel</class> | ||
595 | <property stdset="1"> | ||
596 | <name>name</name> | ||
597 | <cstring>button_0</cstring> | ||
598 | </property> | ||
599 | <property stdset="1"> | ||
600 | <name>geometry</name> | ||
601 | <rect> | ||
602 | <x>11</x> | ||
603 | <y>238</y> | ||
604 | <width>68</width> | ||
605 | <height>44</height> | ||
606 | </rect> | ||
607 | </property> | ||
608 | <property stdset="1"> | ||
609 | <name>sizePolicy</name> | ||
610 | <sizepolicy> | ||
611 | <hsizetype>5</hsizetype> | ||
612 | <vsizetype>5</vsizetype> | ||
613 | </sizepolicy> | ||
614 | </property> | ||
615 | <property stdset="1"> | ||
616 | <name>frameShape</name> | ||
617 | <enum>Box</enum> | ||
618 | </property> | ||
619 | <property stdset="1"> | ||
620 | <name>frameShadow</name> | ||
621 | <enum>Raised</enum> | ||
622 | </property> | ||
623 | <property stdset="1"> | ||
624 | <name>text</name> | ||
625 | <string>0</string> | ||
626 | </property> | ||
627 | <property stdset="1"> | ||
628 | <name>alignment</name> | ||
629 | <set>AlignCenter</set> | ||
630 | </property> | ||
631 | <property> | ||
632 | <name>hAlign</name> | ||
633 | </property> | ||
634 | <property> | ||
635 | <name>layoutMargin</name> | ||
636 | </property> | ||
637 | <property> | ||
638 | <name>layoutSpacing</name> | ||
639 | </property> | ||
640 | </widget> | ||
641 | <widget> | ||
642 | <class>QLabel</class> | ||
643 | <property stdset="1"> | ||
644 | <name>name</name> | ||
645 | <cstring>button_8</cstring> | ||
646 | </property> | ||
647 | <property stdset="1"> | ||
648 | <name>geometry</name> | ||
649 | <rect> | ||
650 | <x>85</x> | ||
651 | <y>188</y> | ||
652 | <width>69</width> | ||
653 | <height>44</height> | ||
654 | </rect> | ||
655 | </property> | ||
656 | <property stdset="1"> | ||
657 | <name>sizePolicy</name> | ||
658 | <sizepolicy> | ||
659 | <hsizetype>5</hsizetype> | ||
660 | <vsizetype>5</vsizetype> | ||
661 | </sizepolicy> | ||
662 | </property> | ||
663 | <property stdset="1"> | ||
664 | <name>frameShape</name> | ||
665 | <enum>Box</enum> | ||
666 | </property> | ||
667 | <property stdset="1"> | ||
668 | <name>frameShadow</name> | ||
669 | <enum>Raised</enum> | ||
670 | </property> | ||
671 | <property stdset="1"> | ||
672 | <name>text</name> | ||
673 | <string>8</string> | ||
674 | </property> | ||
675 | <property stdset="1"> | ||
676 | <name>alignment</name> | ||
677 | <set>AlignCenter</set> | ||
678 | </property> | ||
679 | <property> | ||
680 | <name>hAlign</name> | ||
681 | </property> | ||
682 | </widget> | ||
683 | <widget> | ||
684 | <class>QLabel</class> | ||
685 | <property stdset="1"> | ||
686 | <name>name</name> | ||
687 | <cstring>button_9</cstring> | ||
688 | </property> | ||
689 | <property stdset="1"> | ||
690 | <name>geometry</name> | ||
691 | <rect> | ||
692 | <x>160</x> | ||
693 | <y>188</y> | ||
694 | <width>68</width> | ||
695 | <height>44</height> | ||
696 | </rect> | ||
697 | </property> | ||
698 | <property stdset="1"> | ||
699 | <name>sizePolicy</name> | ||
700 | <sizepolicy> | ||
701 | <hsizetype>5</hsizetype> | ||
702 | <vsizetype>5</vsizetype> | ||
703 | </sizepolicy> | ||
704 | </property> | ||
705 | <property stdset="1"> | ||
706 | <name>frameShape</name> | ||
707 | <enum>Box</enum> | ||
708 | </property> | ||
709 | <property stdset="1"> | ||
710 | <name>frameShadow</name> | ||
711 | <enum>Raised</enum> | ||
712 | </property> | ||
713 | <property stdset="1"> | ||
714 | <name>text</name> | ||
715 | <string>9</string> | ||
716 | </property> | ||
717 | <property stdset="1"> | ||
718 | <name>alignment</name> | ||
719 | <set>AlignCenter</set> | ||
720 | </property> | ||
721 | <property> | ||
722 | <name>hAlign</name> | ||
723 | </property> | ||
724 | <property> | ||
725 | <name>layoutMargin</name> | ||
726 | </property> | ||
727 | <property> | ||
728 | <name>layoutSpacing</name> | ||
729 | </property> | ||
730 | </widget> | ||
731 | <widget> | ||
732 | <class>QLabel</class> | ||
733 | <property stdset="1"> | ||
734 | <name>name</name> | ||
735 | <cstring>button_OK</cstring> | ||
736 | </property> | ||
737 | <property stdset="1"> | ||
738 | <name>geometry</name> | ||
739 | <rect> | ||
740 | <x>160</x> | ||
741 | <y>238</y> | ||
742 | <width>68</width> | ||
743 | <height>44</height> | ||
744 | </rect> | ||
745 | </property> | ||
746 | <property stdset="1"> | ||
747 | <name>sizePolicy</name> | ||
748 | <sizepolicy> | ||
749 | <hsizetype>5</hsizetype> | ||
750 | <vsizetype>5</vsizetype> | ||
751 | </sizepolicy> | ||
752 | </property> | ||
753 | <property stdset="1"> | ||
754 | <name>palette</name> | ||
755 | <palette> | ||
756 | <active> | ||
757 | <color> | ||
758 | <red>0</red> | ||
759 | <green>0</green> | ||
760 | <blue>0</blue> | ||
761 | </color> | ||
762 | <color> | ||
763 | <red>192</red> | ||
764 | <green>192</green> | ||
765 | <blue>192</blue> | ||
766 | </color> | ||
767 | <color> | ||
768 | <red>255</red> | ||
769 | <green>255</green> | ||
770 | <blue>255</blue> | ||
771 | </color> | ||
772 | <color> | ||
773 | <red>223</red> | ||
774 | <green>223</green> | ||
775 | <blue>223</blue> | ||
776 | </color> | ||
777 | <color> | ||
778 | <red>96</red> | ||
779 | <green>96</green> | ||
780 | <blue>96</blue> | ||
781 | </color> | ||
782 | <color> | ||
783 | <red>128</red> | ||
784 | <green>128</green> | ||
785 | <blue>128</blue> | ||
786 | </color> | ||
787 | <color> | ||
788 | <red>0</red> | ||
789 | <green>0</green> | ||
790 | <blue>0</blue> | ||
791 | </color> | ||
792 | <color> | ||
793 | <red>255</red> | ||
794 | <green>255</green> | ||
795 | <blue>255</blue> | ||
796 | </color> | ||
797 | <color> | ||
798 | <red>0</red> | ||
799 | <green>0</green> | ||
800 | <blue>0</blue> | ||
801 | </color> | ||
802 | <color> | ||
803 | <red>255</red> | ||
804 | <green>255</green> | ||
805 | <blue>255</blue> | ||
806 | </color> | ||
807 | <color> | ||
808 | <red>0</red> | ||
809 | <green>170</green> | ||
810 | <blue>0</blue> | ||
811 | </color> | ||
812 | <color> | ||
813 | <red>0</red> | ||
814 | <green>0</green> | ||
815 | <blue>0</blue> | ||
816 | </color> | ||
817 | <color> | ||
818 | <red>0</red> | ||
819 | <green>0</green> | ||
820 | <blue>0</blue> | ||
821 | </color> | ||
822 | <color> | ||
823 | <red>255</red> | ||
824 | <green>255</green> | ||
825 | <blue>255</blue> | ||
826 | </color> | ||
827 | </active> | ||
828 | <disabled> | ||
829 | <color> | ||
830 | <red>128</red> | ||
831 | <green>128</green> | ||
832 | <blue>128</blue> | ||
833 | </color> | ||
834 | <color> | ||
835 | <red>192</red> | ||
836 | <green>192</green> | ||
837 | <blue>192</blue> | ||
838 | </color> | ||
839 | <color> | ||
840 | <red>255</red> | ||
841 | <green>255</green> | ||
842 | <blue>255</blue> | ||
843 | </color> | ||
844 | <color> | ||
845 | <red>220</red> | ||
846 | <green>220</green> | ||
847 | <blue>220</blue> | ||
848 | </color> | ||
849 | <color> | ||
850 | <red>96</red> | ||
851 | <green>96</green> | ||
852 | <blue>96</blue> | ||
853 | </color> | ||
854 | <color> | ||
855 | <red>128</red> | ||
856 | <green>128</green> | ||
857 | <blue>128</blue> | ||
858 | </color> | ||
859 | <color> | ||
860 | <red>0</red> | ||
861 | <green>0</green> | ||
862 | <blue>0</blue> | ||
863 | </color> | ||
864 | <color> | ||
865 | <red>255</red> | ||
866 | <green>255</green> | ||
867 | <blue>255</blue> | ||
868 | </color> | ||
869 | <color> | ||
870 | <red>128</red> | ||
871 | <green>128</green> | ||
872 | <blue>128</blue> | ||
873 | </color> | ||
874 | <color> | ||
875 | <red>255</red> | ||
876 | <green>255</green> | ||
877 | <blue>255</blue> | ||
878 | </color> | ||
879 | <color> | ||
880 | <red>0</red> | ||
881 | <green>170</green> | ||
882 | <blue>0</blue> | ||
883 | </color> | ||
884 | <color> | ||
885 | <red>0</red> | ||
886 | <green>0</green> | ||
887 | <blue>0</blue> | ||
888 | </color> | ||
889 | <color> | ||
890 | <red>0</red> | ||
891 | <green>0</green> | ||
892 | <blue>0</blue> | ||
893 | </color> | ||
894 | <color> | ||
895 | <red>255</red> | ||
896 | <green>255</green> | ||
897 | <blue>255</blue> | ||
898 | </color> | ||
899 | </disabled> | ||
900 | <inactive> | ||
901 | <color> | ||
902 | <red>0</red> | ||
903 | <green>0</green> | ||
904 | <blue>0</blue> | ||
905 | </color> | ||
906 | <color> | ||
907 | <red>192</red> | ||
908 | <green>192</green> | ||
909 | <blue>192</blue> | ||
910 | </color> | ||
911 | <color> | ||
912 | <red>255</red> | ||
913 | <green>255</green> | ||
914 | <blue>255</blue> | ||
915 | </color> | ||
916 | <color> | ||
917 | <red>220</red> | ||
918 | <green>220</green> | ||
919 | <blue>220</blue> | ||
920 | </color> | ||
921 | <color> | ||
922 | <red>96</red> | ||
923 | <green>96</green> | ||
924 | <blue>96</blue> | ||
925 | </color> | ||
926 | <color> | ||
927 | <red>128</red> | ||
928 | <green>128</green> | ||
929 | <blue>128</blue> | ||
930 | </color> | ||
931 | <color> | ||
932 | <red>0</red> | ||
933 | <green>0</green> | ||
934 | <blue>0</blue> | ||
935 | </color> | ||
936 | <color> | ||
937 | <red>255</red> | ||
938 | <green>255</green> | ||
939 | <blue>255</blue> | ||
940 | </color> | ||
941 | <color> | ||
942 | <red>0</red> | ||
943 | <green>0</green> | ||
944 | <blue>0</blue> | ||
945 | </color> | ||
946 | <color> | ||
947 | <red>255</red> | ||
948 | <green>255</green> | ||
949 | <blue>255</blue> | ||
950 | </color> | ||
951 | <color> | ||
952 | <red>0</red> | ||
953 | <green>170</green> | ||
954 | <blue>0</blue> | ||
955 | </color> | ||
956 | <color> | ||
957 | <red>0</red> | ||
958 | <green>0</green> | ||
959 | <blue>0</blue> | ||
960 | </color> | ||
961 | <color> | ||
962 | <red>0</red> | ||
963 | <green>0</green> | ||
964 | <blue>0</blue> | ||
965 | </color> | ||
966 | <color> | ||
967 | <red>255</red> | ||
968 | <green>255</green> | ||
969 | <blue>255</blue> | ||
970 | </color> | ||
971 | </inactive> | ||
972 | </palette> | ||
973 | </property> | ||
974 | <property stdset="1"> | ||
975 | <name>frameShape</name> | ||
976 | <enum>Box</enum> | ||
977 | </property> | ||
978 | <property stdset="1"> | ||
979 | <name>frameShadow</name> | ||
980 | <enum>Raised</enum> | ||
981 | </property> | ||
982 | <property stdset="1"> | ||
983 | <name>text</name> | ||
984 | <string>Enter</string> | ||
985 | </property> | ||
986 | <property stdset="1"> | ||
987 | <name>alignment</name> | ||
988 | <set>AlignCenter</set> | ||
989 | </property> | ||
990 | <property> | ||
991 | <name>hAlign</name> | ||
992 | </property> | ||
993 | </widget> | ||
994 | <widget> | ||
995 | <class>QLabel</class> | ||
996 | <property stdset="1"> | ||
997 | <name>name</name> | ||
998 | <cstring>button_Skip</cstring> | ||
999 | </property> | ||
1000 | <property stdset="1"> | ||
1001 | <name>geometry</name> | ||
1002 | <rect> | ||
1003 | <x>85</x> | ||
1004 | <y>238</y> | ||
1005 | <width>69</width> | ||
1006 | <height>44</height> | ||
1007 | </rect> | ||
1008 | </property> | ||
1009 | <property stdset="1"> | ||
1010 | <name>sizePolicy</name> | ||
1011 | <sizepolicy> | ||
1012 | <hsizetype>5</hsizetype> | ||
1013 | <vsizetype>5</vsizetype> | ||
1014 | </sizepolicy> | ||
1015 | </property> | ||
1016 | <property stdset="1"> | ||
1017 | <name>palette</name> | ||
1018 | <palette> | ||
1019 | <active> | ||
1020 | <color> | ||
1021 | <red>0</red> | ||
1022 | <green>0</green> | ||
1023 | <blue>0</blue> | ||
1024 | </color> | ||
1025 | <color> | ||
1026 | <red>192</red> | ||
1027 | <green>192</green> | ||
1028 | <blue>192</blue> | ||
1029 | </color> | ||
1030 | <color> | ||
1031 | <red>255</red> | ||
1032 | <green>255</green> | ||
1033 | <blue>255</blue> | ||
1034 | </color> | ||
1035 | <color> | ||
1036 | <red>223</red> | ||
1037 | <green>223</green> | ||
1038 | <blue>223</blue> | ||
1039 | </color> | ||
1040 | <color> | ||
1041 | <red>96</red> | ||
1042 | <green>96</green> | ||
1043 | <blue>96</blue> | ||
1044 | </color> | ||
1045 | <color> | ||
1046 | <red>128</red> | ||
1047 | <green>128</green> | ||
1048 | <blue>128</blue> | ||
1049 | </color> | ||
1050 | <color> | ||
1051 | <red>0</red> | ||
1052 | <green>0</green> | ||
1053 | <blue>0</blue> | ||
1054 | </color> | ||
1055 | <color> | ||
1056 | <red>255</red> | ||
1057 | <green>255</green> | ||
1058 | <blue>255</blue> | ||
1059 | </color> | ||
1060 | <color> | ||
1061 | <red>0</red> | ||
1062 | <green>0</green> | ||
1063 | <blue>0</blue> | ||
1064 | </color> | ||
1065 | <color> | ||
1066 | <red>255</red> | ||
1067 | <green>255</green> | ||
1068 | <blue>255</blue> | ||
1069 | </color> | ||
1070 | <color> | ||
1071 | <red>255</red> | ||
1072 | <green>255</green> | ||
1073 | <blue>127</blue> | ||
1074 | </color> | ||
1075 | <color> | ||
1076 | <red>0</red> | ||
1077 | <green>0</green> | ||
1078 | <blue>0</blue> | ||
1079 | </color> | ||
1080 | <color> | ||
1081 | <red>0</red> | ||
1082 | <green>0</green> | ||
1083 | <blue>0</blue> | ||
1084 | </color> | ||
1085 | <color> | ||
1086 | <red>255</red> | ||
1087 | <green>255</green> | ||
1088 | <blue>255</blue> | ||
1089 | </color> | ||
1090 | </active> | ||
1091 | <disabled> | ||
1092 | <color> | ||
1093 | <red>128</red> | ||
1094 | <green>128</green> | ||
1095 | <blue>128</blue> | ||
1096 | </color> | ||
1097 | <color> | ||
1098 | <red>192</red> | ||
1099 | <green>192</green> | ||
1100 | <blue>192</blue> | ||
1101 | </color> | ||
1102 | <color> | ||
1103 | <red>255</red> | ||
1104 | <green>255</green> | ||
1105 | <blue>255</blue> | ||
1106 | </color> | ||
1107 | <color> | ||
1108 | <red>220</red> | ||
1109 | <green>220</green> | ||
1110 | <blue>220</blue> | ||
1111 | </color> | ||
1112 | <color> | ||
1113 | <red>96</red> | ||
1114 | <green>96</green> | ||
1115 | <blue>96</blue> | ||
1116 | </color> | ||
1117 | <color> | ||
1118 | <red>128</red> | ||
1119 | <green>128</green> | ||
1120 | <blue>128</blue> | ||
1121 | </color> | ||
1122 | <color> | ||
1123 | <red>0</red> | ||
1124 | <green>0</green> | ||
1125 | <blue>0</blue> | ||
1126 | </color> | ||
1127 | <color> | ||
1128 | <red>255</red> | ||
1129 | <green>255</green> | ||
1130 | <blue>255</blue> | ||
1131 | </color> | ||
1132 | <color> | ||
1133 | <red>128</red> | ||
1134 | <green>128</green> | ||
1135 | <blue>128</blue> | ||
1136 | </color> | ||
1137 | <color> | ||
1138 | <red>255</red> | ||
1139 | <green>255</green> | ||
1140 | <blue>255</blue> | ||
1141 | </color> | ||
1142 | <color> | ||
1143 | <red>255</red> | ||
1144 | <green>255</green> | ||
1145 | <blue>127</blue> | ||
1146 | </color> | ||
1147 | <color> | ||
1148 | <red>0</red> | ||
1149 | <green>0</green> | ||
1150 | <blue>0</blue> | ||
1151 | </color> | ||
1152 | <color> | ||
1153 | <red>0</red> | ||
1154 | <green>0</green> | ||
1155 | <blue>0</blue> | ||
1156 | </color> | ||
1157 | <color> | ||
1158 | <red>255</red> | ||
1159 | <green>255</green> | ||
1160 | <blue>255</blue> | ||
1161 | </color> | ||
1162 | </disabled> | ||
1163 | <inactive> | ||
1164 | <color> | ||
1165 | <red>0</red> | ||
1166 | <green>0</green> | ||
1167 | <blue>0</blue> | ||
1168 | </color> | ||
1169 | <color> | ||
1170 | <red>192</red> | ||
1171 | <green>192</green> | ||
1172 | <blue>192</blue> | ||
1173 | </color> | ||
1174 | <color> | ||
1175 | <red>255</red> | ||
1176 | <green>255</green> | ||
1177 | <blue>255</blue> | ||
1178 | </color> | ||
1179 | <color> | ||
1180 | <red>220</red> | ||
1181 | <green>220</green> | ||
1182 | <blue>220</blue> | ||
1183 | </color> | ||
1184 | <color> | ||
1185 | <red>96</red> | ||
1186 | <green>96</green> | ||
1187 | <blue>96</blue> | ||
1188 | </color> | ||
1189 | <color> | ||
1190 | <red>128</red> | ||
1191 | <green>128</green> | ||
1192 | <blue>128</blue> | ||
1193 | </color> | ||
1194 | <color> | ||
1195 | <red>0</red> | ||
1196 | <green>0</green> | ||
1197 | <blue>0</blue> | ||
1198 | </color> | ||
1199 | <color> | ||
1200 | <red>255</red> | ||
1201 | <green>255</green> | ||
1202 | <blue>255</blue> | ||
1203 | </color> | ||
1204 | <color> | ||
1205 | <red>0</red> | ||
1206 | <green>0</green> | ||
1207 | <blue>0</blue> | ||
1208 | </color> | ||
1209 | <color> | ||
1210 | <red>255</red> | ||
1211 | <green>255</green> | ||
1212 | <blue>255</blue> | ||
1213 | </color> | ||
1214 | <color> | ||
1215 | <red>255</red> | ||
1216 | <green>255</green> | ||
1217 | <blue>127</blue> | ||
1218 | </color> | ||
1219 | <color> | ||
1220 | <red>0</red> | ||
1221 | <green>0</green> | ||
1222 | <blue>0</blue> | ||
1223 | </color> | ||
1224 | <color> | ||
1225 | <red>0</red> | ||
1226 | <green>0</green> | ||
1227 | <blue>0</blue> | ||
1228 | </color> | ||
1229 | <color> | ||
1230 | <red>255</red> | ||
1231 | <green>255</green> | ||
1232 | <blue>255</blue> | ||
1233 | </color> | ||
1234 | </inactive> | ||
1235 | </palette> | ||
1236 | </property> | ||
1237 | <property stdset="1"> | ||
1238 | <name>frameShape</name> | ||
1239 | <enum>Box</enum> | ||
1240 | </property> | ||
1241 | <property stdset="1"> | ||
1242 | <name>frameShadow</name> | ||
1243 | <enum>Raised</enum> | ||
1244 | </property> | ||
1245 | <property stdset="1"> | ||
1246 | <name>text</name> | ||
1247 | <string>Skip</string> | ||
1248 | </property> | ||
1249 | <property stdset="1"> | ||
1250 | <name>alignment</name> | ||
1251 | <set>AlignCenter</set> | ||
1252 | </property> | ||
1253 | <property> | ||
1254 | <name>hAlign</name> | ||
1255 | </property> | ||
1256 | </widget> | ||
1257 | </widget> | ||
1258 | </UI> | ||
diff --git a/noncore/securityplugins/pin/pinplugin.pro b/noncore/securityplugins/pin/pinplugin.pro new file mode 100644 index 0000000..d066805 --- a/dev/null +++ b/noncore/securityplugins/pin/pinplugin.pro | |||
@@ -0,0 +1,21 @@ | |||
1 | VERSION = 0.0.2 | ||
2 | TEMPLATE = lib | ||
3 | CONFIG += qt warn_on | ||
4 | |||
5 | HEADERS = pin.h pinpluginimpl.h pinConfigWidget.h | ||
6 | |||
7 | INTERFACES = pinDialogBase.ui | ||
8 | |||
9 | SOURCES = pin.cpp pinpluginimpl.cpp pinConfigWidget.cpp | ||
10 | |||
11 | |||
12 | INCLUDEPATH+= $(OPIEDIR)/include | ||
13 | DEPENDPATH+= | ||
14 | |||
15 | LIBS += -lqpe -lopieui2 | ||
16 | |||
17 | DESTDIR = $(OPIEDIR)/plugins/security | ||
18 | TARGET = multiauthpinplugin | ||
19 | |||
20 | include ( $(OPIEDIR)/include.pro ) | ||
21 | |||
diff --git a/noncore/securityplugins/pin/pinpluginimpl.cpp b/noncore/securityplugins/pin/pinpluginimpl.cpp new file mode 100644 index 0000000..1c32f81 --- a/dev/null +++ b/noncore/securityplugins/pin/pinpluginimpl.cpp | |||
@@ -0,0 +1,28 @@ | |||
1 | #include "pinpluginimpl.h" | ||
2 | |||
3 | PinPluginImpl::PinPluginImpl() { | ||
4 | pinPlugin = new PinPlugin(); | ||
5 | } | ||
6 | |||
7 | PinPluginImpl::~PinPluginImpl() { | ||
8 | delete pinPlugin; | ||
9 | } | ||
10 | |||
11 | MultiauthPluginObject* PinPluginImpl::plugin() { | ||
12 | return pinPlugin; | ||
13 | } | ||
14 | |||
15 | Q_EXPORT_INTERFACE() { | ||
16 | Q_CREATE_INSTANCE( PinPluginImpl ) | ||
17 | } | ||
18 | |||
19 | QRESULT PinPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { | ||
20 | *iface = 0; | ||
21 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MultiauthPluginInterface ) ) { | ||
22 | *iface = this, (*iface)->addRef(); | ||
23 | } else { | ||
24 | return QE_NOINTERFACE; | ||
25 | } | ||
26 | return QS_OK; | ||
27 | |||
28 | } | ||
diff --git a/noncore/securityplugins/pin/pinpluginimpl.h b/noncore/securityplugins/pin/pinpluginimpl.h new file mode 100644 index 0000000..e604b64 --- a/dev/null +++ b/noncore/securityplugins/pin/pinpluginimpl.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /** | ||
2 | * \file pinpluginimpl.h | ||
3 | * \brief Standard Opie multiauth plugin definition | ||
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | ||
5 | */ | ||
6 | /* | ||
7 | =. This file is part of the Opie Project | ||
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This library is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This library is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | #ifndef PIN_PLUGIN_IMPL_H | ||
35 | #define PIN_PLUGIN_IMPL_H | ||
36 | |||
37 | #include "pin.h" | ||
38 | |||
39 | /// Standard multiauth plugin class | ||
40 | class PinPluginImpl : public MultiauthPluginInterface{ | ||
41 | |||
42 | public: | ||
43 | PinPluginImpl(); | ||
44 | virtual ~PinPluginImpl(); | ||
45 | |||
46 | QRESULT queryInterface( const QUuid &, QUnknownInterface** ); | ||
47 | // defines standard addRef() and release() functions | ||
48 | Q_REFCOUNT; | ||
49 | |||
50 | virtual MultiauthPluginObject *plugin(); | ||
51 | |||
52 | private: | ||
53 | /// the plugin itself | ||
54 | PinPlugin *pinPlugin; | ||
55 | ulong ref; | ||
56 | }; | ||
57 | |||
58 | #endif | ||