summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/okeyfilter.h
Unidiff
Diffstat (limited to 'libopie2/opiecore/okeyfilter.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/okeyfilter.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/libopie2/opiecore/okeyfilter.h b/libopie2/opiecore/okeyfilter.h
new file mode 100644
index 0000000..3f9f744
--- a/dev/null
+++ b/libopie2/opiecore/okeyfilter.h
@@ -0,0 +1,77 @@
1/*
2 This file is part of the Opie Project
3 =. Copyright (C) 2004 Rajko 'Alwin' Albrecht <alwin@handhelds.org>
4 .=l. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .>+-=
6_;:, .> :=|. This program is free software; you can
7.> <`_, > . <= redistribute it and/or modify it under
8:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
9.="- .-=="i, .._ License as published by the Free Software
10- . .-<_> .<> Foundation; either version 2 of the License,
11 ._= =} : or (at your option) any later version.
12 .%`+i> _;_.
13 .i_,=:_. -<s. This program is distributed in the hope that
14 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
15 : .. .:, . . . without even the implied warranty of
16 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
17 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
18..}^=.= = ; Library General Public License for more
19++= -. .` .: details.
20: = ...= . :.=-
21-. .:....=;==+<; You should have received a copy of the GNU
22 -_. . . )=. = Library General Public License along with
23 -- :-=` this library; see the file COPYING.LIB.
24 If not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27*/
28
29/* QT */
30#include <qwindowsystem_qws.h>
31#include <qvaluelist.h>
32
33namespace Opie {
34namespace Core {
35 class ODevice;
36namespace Internal {
37 class iPAQ;
38 class SIMpad;
39}
40
41/**
42 * A singleton which will manage all possible keyboard filters inside opie.
43 * It makes sure that key handlers of odevice are checked first than the
44 * keyfilters of software.
45 * @short a keyfilter proxy
46 * @see QWSServer::KeyboardFilter
47 * @author Rajko Albrecht
48 * @version 1.0
49 */
50class OKeyFilter:public QWSServer::KeyboardFilter
51{
52 friend class Opie::Core::ODevice;
53 friend class Opie::Core::Internal::iPAQ;
54 friend class Opie::Core::Internal::SIMpad;
55
56 static QValueList<QWSServer::KeyboardFilter*> filterList;
57 static QValueList<QWSServer::KeyboardFilter*> preFilterList;
58
59 OKeyFilter();
60 OKeyFilter(const OKeyFilter&):QWSServer::KeyboardFilter(){};
61
62protected:
63 void addPreHandler(QWSServer::KeyboardFilter*);
64 void remPreHandler(QWSServer::KeyboardFilter*);
65
66public:
67 virtual ~OKeyFilter();
68 virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
69
70 void addHandler(QWSServer::KeyboardFilter*);
71 void remHandler(QWSServer::KeyboardFilter*);
72
73 static OKeyFilter*inst();
74};
75
76}
77}