1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _SAL_I18N_CALLBACK_HXX 28 #define _SAL_I18N_CALLBACK_HXX 29 30 #include <salwtype.hxx> 31 #include <vector> 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 // for iiimp / ml input 38 int CommitStringCallback( XIC ic, XPointer client_data, XPointer call_data); 39 40 // xim callbacks 41 void PreeditDoneCallback ( XIC ic, XPointer client_data, XPointer call_data); 42 int PreeditStartCallback( XIC ic, XPointer client_data, XPointer call_data); 43 void PreeditDoneCallback ( XIC ic, XPointer client_data, XPointer call_data); 44 void PreeditDrawCallback ( XIC ic, XPointer client_data, 45 XIMPreeditDrawCallbackStruct *call_data ); 46 void PreeditCaretCallback( XIC ic, XPointer client_data, 47 XIMPreeditCaretCallbackStruct *call_data ); 48 void GetPreeditSpotLocation(XIC ic, XPointer client_data); 49 50 // private hook to prevent from sending further edit events 51 void PreeditCancelCallback( XPointer client_data ); 52 53 void StatusStartCallback (XIC ic, XPointer client_data, XPointer call_data); 54 void StatusDoneCallback (XIC ic, XPointer client_data, XPointer call_data); 55 void StatusDrawCallback (XIC ic, XPointer client_data, 56 XIMStatusDrawCallbackStruct *call_data); 57 void SwitchIMCallback (XIC ix, XPointer client_data, XPointer call_data ); 58 59 // keep informed if kinput2 crashed again 60 void IC_IMDestroyCallback (XIM im, XPointer client_data, XPointer call_data); 61 void IM_IMDestroyCallback (XIM im, XPointer client_data, XPointer call_data); 62 63 Bool IsControlCode(sal_Unicode nChar); 64 65 #ifdef __cplusplus 66 } /* extern "C" */ 67 #endif 68 69 typedef struct { 70 sal_Unicode *pUnicodeBuffer; 71 XIMFeedback *pCharStyle; 72 unsigned int nCursorPos; 73 unsigned int nLength; 74 unsigned int nSize; 75 } preedit_text_t; 76 77 class SalFrame; 78 79 typedef enum { 80 ePreeditStatusDontKnow = 0, 81 ePreeditStatusActive, 82 ePreeditStatusActivationRequired, 83 ePreeditStatusStartPending 84 } preedit_status_t; 85 86 typedef struct { 87 SalFrame* pFrame; 88 Bool bIsMultilingual; 89 preedit_status_t eState; 90 preedit_text_t aText; 91 SalExtTextInputEvent aInputEv; 92 std::vector< sal_uInt16 > aInputFlags; 93 } preedit_data_t; 94 95 #endif /* _SAL_I18N_CALLBACK_HXX */ 96