xref: /aoo41x/main/vcl/inc/unx/i18n_ic.hxx (revision 161f4cd1)
1*161f4cd1SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*161f4cd1SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*161f4cd1SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*161f4cd1SAndrew Rist  * distributed with this work for additional information
6*161f4cd1SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*161f4cd1SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*161f4cd1SAndrew Rist  * "License"); you may not use this file except in compliance
9*161f4cd1SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*161f4cd1SAndrew Rist  *
11*161f4cd1SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*161f4cd1SAndrew Rist  *
13*161f4cd1SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*161f4cd1SAndrew Rist  * software distributed under the License is distributed on an
15*161f4cd1SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*161f4cd1SAndrew Rist  * KIND, either express or implied.  See the License for the
17*161f4cd1SAndrew Rist  * specific language governing permissions and limitations
18*161f4cd1SAndrew Rist  * under the License.
19*161f4cd1SAndrew Rist  *
20*161f4cd1SAndrew Rist  *************************************************************/
21*161f4cd1SAndrew Rist 
22*161f4cd1SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SAL_I18N_INPUTCONTEXT_HXX
25cdf0e10cSrcweir #define _SAL_I18N_INPUTCONTEXT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <i18npool/lang.h>
28cdf0e10cSrcweir #include "i18n_cb.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class SalI18N_InputContext
31cdf0e10cSrcweir {
32cdf0e10cSrcweir 
33cdf0e10cSrcweir private:
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 	Bool    mbUseable; // system supports current locale ?
36cdf0e10cSrcweir 	Bool    mbMultiLingual; // system supports iiimp ?
37cdf0e10cSrcweir 	XIC		maContext;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir 	XIMStyle mnSupportedStatusStyle;
40cdf0e10cSrcweir 	XIMStyle mnSupportedPreeditStyle;
41cdf0e10cSrcweir 	XIMStyle mnStatusStyle;
42cdf0e10cSrcweir 	XIMStyle mnPreeditStyle;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 	preedit_data_t maClientData;
45cdf0e10cSrcweir 	XIMCallback maPreeditStartCallback;
46cdf0e10cSrcweir 	XIMCallback maPreeditDoneCallback;
47cdf0e10cSrcweir 	XIMCallback maPreeditDrawCallback;
48cdf0e10cSrcweir 	XIMCallback maPreeditCaretCallback;
49cdf0e10cSrcweir 	XIMCallback maCommitStringCallback;
50cdf0e10cSrcweir     XIMCallback maSwitchIMCallback;
51cdf0e10cSrcweir 	XIMCallback maDestroyCallback;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	XVaNestedList mpAttributes;
54cdf0e10cSrcweir 	XVaNestedList mpStatusAttributes;
55cdf0e10cSrcweir 	XVaNestedList mpPreeditAttributes;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	Bool 		 SupportInputMethodStyle( XIMStyles *pIMStyles );
58cdf0e10cSrcweir 	unsigned int GetWeightingOfIMStyle(   XIMStyle n_style ) const ;
59cdf0e10cSrcweir 	Bool 		 IsSupportedIMStyle(      XIMStyle n_style ) const ;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir public:
62cdf0e10cSrcweir 
UseContext()63cdf0e10cSrcweir 	Bool UseContext() 		{ return mbUseable; }
IsMultiLingual()64cdf0e10cSrcweir 	Bool IsMultiLingual() 	{ return mbMultiLingual; }
IsPreeditMode()65cdf0e10cSrcweir 	Bool IsPreeditMode()	{ return maClientData.eState == ePreeditStatusActive; }
GetContext()66cdf0e10cSrcweir 	XIC  GetContext() 		{ return maContext; }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	void ExtendEventMask(  XLIB_Window aFocusWindow );
69cdf0e10cSrcweir 	void SetICFocus( SalFrame* pFocusFrame );
70cdf0e10cSrcweir 	void UnsetICFocus( SalFrame* pFrame );
71cdf0e10cSrcweir     void HandleDestroyIM();
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	int  HandleKeyEvent( XKeyEvent *pEvent, SalFrame *pFrame ); // unused
74cdf0e10cSrcweir 	void EndExtTextInput( sal_uInt16 nFlags );						// unused
75cdf0e10cSrcweir 	int  CommitStringCallback( sal_Unicode* pText, sal_Size nLength );
76cdf0e10cSrcweir     int  CommitKeyEvent( sal_Unicode* pText, sal_Size nLength );
77cdf0e10cSrcweir     int  UpdateSpotLocation();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	void Map( SalFrame *pFrame );
80cdf0e10cSrcweir 	void Unmap( SalFrame* pFrame );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     void SetPreeditState(Bool aPreeditState);
83cdf0e10cSrcweir     void SetLanguage(LanguageType aInputLanguage);
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	SalI18N_InputContext( SalFrame *aFrame );
86cdf0e10cSrcweir 	~SalI18N_InputContext();
87cdf0e10cSrcweir 
88cdf0e10cSrcweir private:
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	SalI18N_InputContext(); // do not use this
91cdf0e10cSrcweir 
92cdf0e10cSrcweir };
93cdf0e10cSrcweir 
94cdf0e10cSrcweir #endif // _SAL_I18N_INPUTCONTEXT_HXX
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 
97