1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: i18n_xkb.hxx,v $
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
41 sal_Bool mbUseExtension
;
42 sal_uInt32 mnDefaultGroup
;
50 SalI18N_KeyboardExtension( Display
*pDisplay
);
51 inline ~SalI18N_KeyboardExtension();
53 inline sal_Bool
UseExtension() const ; // server and client support the
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(
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 ;
72 SalI18N_KeyboardExtension(); // disabled
76 SalI18N_KeyboardExtension::~SalI18N_KeyboardExtension()
81 SalI18N_KeyboardExtension::UseExtension() const
83 return mbUseExtension
;
87 SalI18N_KeyboardExtension::UseExtension( sal_Bool bState
)
89 mbUseExtension
= mbUseExtension
&& bState
;
93 SalI18N_KeyboardExtension::LookupKeysymInDefaultGroup( sal_uInt32 nKeyCode
,
94 sal_uInt32 nShiftState
) const
96 return LookupKeysymInGroup( nKeyCode
, nShiftState
, mnDefaultGroup
);
100 SalI18N_KeyboardExtension::GetGroup() const
106 SalI18N_KeyboardExtension::GetDefaultGroup() const
108 return mnDefaultGroup
;
112 SalI18N_KeyboardExtension::GetEventBase() const
117 #endif // _SAL_I18N_XKBDEXTENSION_HXX