author | alwin <alwin> | 2004-08-01 10:32:56 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-08-01 10:32:56 (UTC) |
commit | 142d432ef9f8215636a81c358c828d4b6986a6ad (patch) (unidiff) | |
tree | faf33f40f3e19fdd0362256c61e6774ea949f70c /libopie2/opiecore/okeyfilter.h | |
parent | 24c8aff75cbb41ccb2acf3de79675c2f4fd7ecc9 (diff) | |
download | opie-142d432ef9f8215636a81c358c828d4b6986a6ad.zip opie-142d432ef9f8215636a81c358c828d4b6986a6ad.tar.gz opie-142d432ef9f8215636a81c358c828d4b6986a6ad.tar.bz2 |
added a keyfilter singleton. All OPIE apps should use that instead of
the base from qte 'cause there are some stupids in handling pointers.
key handlers from odevice-classes will handled at top of all others
iPAQ and SIMPad are switched to that filter queue.
Diffstat (limited to 'libopie2/opiecore/okeyfilter.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/okeyfilter.h | 77 |
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 | |||
33 | namespace Opie { | ||
34 | namespace Core { | ||
35 | class ODevice; | ||
36 | namespace 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 | */ | ||
50 | class 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 | |||
62 | protected: | ||
63 | void addPreHandler(QWSServer::KeyboardFilter*); | ||
64 | void remPreHandler(QWSServer::KeyboardFilter*); | ||
65 | |||
66 | public: | ||
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 | } | ||