merge the formfield patch from ooo-build
[ooovba.git] / vcl / unx / inc / i18n_xkb.hxx
blobc257f0e88382e73e3146769a93b09920a116d58a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: i18n_xkb.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SAL_I18N_XKBDEXTENSION_HXX
32 #define _SAL_I18N_XKBDEXTENSION_HXX
34 #include <sal/types.h>
35 #include <vcl/dllapi.h>
37 class VCL_DLLPUBLIC SalI18N_KeyboardExtension
39 private:
41 sal_Bool mbUseExtension;
42 sal_uInt32 mnDefaultGroup;
43 sal_uInt32 mnGroup;
44 int mnEventBase;
45 int mnErrorBase;
46 Display* mpDisplay;
48 public:
50 SalI18N_KeyboardExtension( Display *pDisplay );
51 inline ~SalI18N_KeyboardExtension();
53 inline sal_Bool UseExtension() const ; // server and client support the
54 // extension
55 inline void UseExtension( sal_Bool bState );// used to disable the Extension
57 void Dispatch( XEvent *pEvent ); // keep track of group changes
59 sal_uInt32 LookupKeysymInGroup( sal_uInt32 nKeyCode,
60 sal_uInt32 nShiftState,
61 sal_uInt32 nGroup ) const ;
63 inline sal_uInt32 LookupKeysymInDefaultGroup(
64 sal_uInt32 nKeyCode,
65 sal_uInt32 nShiftState ) const ;
66 inline sal_uInt32 GetGroup() const ; // the current keyboard group
67 inline sal_uInt32 GetDefaultGroup() const ; // base group, usually group 1
68 inline int GetEventBase() const ;
70 protected:
72 SalI18N_KeyboardExtension(); // disabled
75 inline
76 SalI18N_KeyboardExtension::~SalI18N_KeyboardExtension()
80 inline sal_Bool
81 SalI18N_KeyboardExtension::UseExtension() const
83 return mbUseExtension;
86 inline void
87 SalI18N_KeyboardExtension::UseExtension( sal_Bool bState )
89 mbUseExtension = mbUseExtension && bState;
92 inline sal_uInt32
93 SalI18N_KeyboardExtension::LookupKeysymInDefaultGroup( sal_uInt32 nKeyCode,
94 sal_uInt32 nShiftState ) const
96 return LookupKeysymInGroup( nKeyCode, nShiftState, mnDefaultGroup );
99 inline sal_uInt32
100 SalI18N_KeyboardExtension::GetGroup() const
102 return mnGroup;
105 inline sal_uInt32
106 SalI18N_KeyboardExtension::GetDefaultGroup() const
108 return mnDefaultGroup;
111 inline int
112 SalI18N_KeyboardExtension::GetEventBase() const
114 return mnEventBase;
117 #endif // _SAL_I18N_XKBDEXTENSION_HXX