1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _SAL_I18N_CALLBACK_HXX 24 #define _SAL_I18N_CALLBACK_HXX 25 26 #include <salwtype.hxx> 27 #include <vector> 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 // for iiimp / ml input 34 int CommitStringCallback( XIC ic, XPointer client_data, XPointer call_data); 35 36 // xim callbacks 37 void PreeditDoneCallback ( XIC ic, XPointer client_data, XPointer call_data); 38 int PreeditStartCallback( XIC ic, XPointer client_data, XPointer call_data); 39 void PreeditDoneCallback ( XIC ic, XPointer client_data, XPointer call_data); 40 void PreeditDrawCallback ( XIC ic, XPointer client_data, 41 XIMPreeditDrawCallbackStruct *call_data ); 42 void PreeditCaretCallback( XIC ic, XPointer client_data, 43 XIMPreeditCaretCallbackStruct *call_data ); 44 void GetPreeditSpotLocation(XIC ic, XPointer client_data); 45 46 // private hook to prevent from sending further edit events 47 void PreeditCancelCallback( XPointer client_data ); 48 49 void StatusStartCallback (XIC ic, XPointer client_data, XPointer call_data); 50 void StatusDoneCallback (XIC ic, XPointer client_data, XPointer call_data); 51 void StatusDrawCallback (XIC ic, XPointer client_data, 52 XIMStatusDrawCallbackStruct *call_data); 53 void SwitchIMCallback (XIC ix, XPointer client_data, XPointer call_data ); 54 55 // keep informed if kinput2 crashed again 56 void IC_IMDestroyCallback (XIM im, XPointer client_data, XPointer call_data); 57 void IM_IMDestroyCallback (XIM im, XPointer client_data, XPointer call_data); 58 59 Bool IsControlCode(sal_Unicode nChar); 60 61 #ifdef __cplusplus 62 } /* extern "C" */ 63 #endif 64 65 typedef struct { 66 sal_Unicode *pUnicodeBuffer; 67 XIMFeedback *pCharStyle; 68 unsigned int nCursorPos; 69 unsigned int nLength; 70 unsigned int nSize; 71 } preedit_text_t; 72 73 class SalFrame; 74 75 typedef enum { 76 ePreeditStatusDontKnow = 0, 77 ePreeditStatusActive, 78 ePreeditStatusActivationRequired, 79 ePreeditStatusStartPending 80 } preedit_status_t; 81 82 typedef struct { 83 SalFrame* pFrame; 84 Bool bIsMultilingual; 85 preedit_status_t eState; 86 preedit_text_t aText; 87 SalExtTextInputEvent aInputEv; 88 std::vector< sal_uInt16 > aInputFlags; 89 } preedit_data_t; 90 91 #endif /* _SAL_I18N_CALLBACK_HXX */ 92