Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SAL_I18N_XKBDEXTENSION_HXX
30 : : #define _SAL_I18N_XKBDEXTENSION_HXX
31 : :
32 : : #include <sal/types.h>
33 : : #include <vclpluginapi.h>
34 : :
35 : : class VCLPLUG_GEN_PUBLIC SalI18N_KeyboardExtension
36 : : {
37 : : private:
38 : :
39 : : sal_Bool mbUseExtension;
40 : : sal_uInt32 mnDefaultGroup;
41 : : sal_uInt32 mnGroup;
42 : : int mnEventBase;
43 : : int mnErrorBase;
44 : : Display* mpDisplay;
45 : :
46 : : public:
47 : :
48 : : SalI18N_KeyboardExtension( Display *pDisplay );
49 : : inline ~SalI18N_KeyboardExtension();
50 : :
51 : : inline sal_Bool UseExtension() const ; // server and client support the
52 : : // extension
53 : : inline void UseExtension( sal_Bool bState );// used to disable the Extension
54 : :
55 : : void Dispatch( XEvent *pEvent ); // keep track of group changes
56 : :
57 : : inline sal_uInt32 GetGroup() const ; // the current keyboard group
58 : : inline sal_uInt32 GetDefaultGroup() const ; // base group, usually group 1
59 : : inline int GetEventBase() const ;
60 : :
61 : : protected:
62 : :
63 : : SalI18N_KeyboardExtension(); // disabled
64 : : };
65 : :
66 : : inline
67 : 0 : SalI18N_KeyboardExtension::~SalI18N_KeyboardExtension()
68 : : {
69 : 0 : }
70 : :
71 : : inline sal_Bool
72 : 0 : SalI18N_KeyboardExtension::UseExtension() const
73 : : {
74 : 0 : return mbUseExtension;
75 : : }
76 : :
77 : : inline void
78 : 0 : SalI18N_KeyboardExtension::UseExtension( sal_Bool bState )
79 : : {
80 : 0 : mbUseExtension = mbUseExtension && bState;
81 : 0 : }
82 : :
83 : : inline sal_uInt32
84 : : SalI18N_KeyboardExtension::GetGroup() const
85 : : {
86 : : return mnGroup;
87 : : }
88 : :
89 : : inline sal_uInt32
90 : : SalI18N_KeyboardExtension::GetDefaultGroup() const
91 : : {
92 : : return mnDefaultGroup;
93 : : }
94 : :
95 : : inline int
96 : 0 : SalI18N_KeyboardExtension::GetEventBase() const
97 : : {
98 : 0 : return mnEventBase;
99 : : }
100 : :
101 : : #endif // _SAL_I18N_XKBDEXTENSION_HXX
102 : :
103 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|