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_ic.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_INPUTCONTEXT_HXX
32 #define _SAL_I18N_INPUTCONTEXT_HXX
34 #include <i18npool/lang.h>
35 #include "i18n_cb.hxx"
37 class SalI18N_InputContext
42 Bool mbUseable
; // system supports current locale ?
43 Bool mbMultiLingual
; // system supports iiimp ?
46 XIMStyle mnSupportedStatusStyle
;
47 XIMStyle mnSupportedPreeditStyle
;
48 XIMStyle mnStatusStyle
;
49 XIMStyle mnPreeditStyle
;
51 preedit_data_t maClientData
;
52 XIMCallback maPreeditStartCallback
;
53 XIMCallback maPreeditDoneCallback
;
54 XIMCallback maPreeditDrawCallback
;
55 XIMCallback maPreeditCaretCallback
;
56 XIMCallback maCommitStringCallback
;
57 XIMCallback maSwitchIMCallback
;
58 XIMCallback maDestroyCallback
;
60 XVaNestedList mpAttributes
;
61 XVaNestedList mpStatusAttributes
;
62 XVaNestedList mpPreeditAttributes
;
64 Bool
SupportInputMethodStyle( XIMStyles
*pIMStyles
);
65 unsigned int GetWeightingOfIMStyle( XIMStyle n_style
) const ;
66 Bool
IsSupportedIMStyle( XIMStyle n_style
) const ;
70 Bool
UseContext() { return mbUseable
; }
71 Bool
IsMultiLingual() { return mbMultiLingual
; }
72 Bool
IsPreeditMode() { return maClientData
.eState
== ePreeditStatusActive
; }
73 XIC
GetContext() { return maContext
; }
75 void ExtendEventMask( XLIB_Window aFocusWindow
);
76 void SetICFocus( SalFrame
* pFocusFrame
);
77 void UnsetICFocus( SalFrame
* pFrame
);
78 void HandleDestroyIM();
80 int HandleKeyEvent( XKeyEvent
*pEvent
, SalFrame
*pFrame
); // unused
81 void EndExtTextInput( USHORT nFlags
); // unused
82 int CommitStringCallback( sal_Unicode
* pText
, sal_Size nLength
);
83 int CommitKeyEvent( sal_Unicode
* pText
, sal_Size nLength
);
84 int UpdateSpotLocation();
86 void Map( SalFrame
*pFrame
);
87 void Unmap( SalFrame
* pFrame
);
89 void SetPreeditState(Bool aPreeditState
);
90 void SetLanguage(LanguageType aInputLanguage
);
92 SalI18N_InputContext( SalFrame
*aFrame
);
93 ~SalI18N_InputContext();
97 SalI18N_InputContext(); // do not use this
101 #endif // _SAL_I18N_INPUTCONTEXT_HXX