Avoid potential negative array index access to cached text.
[LibreOffice.git] / vcl / inc / unx / i18n_ic.hxx
blob303b3fb2e497950509d77cfeb10d39bd0e9a2dca
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include "i18n_cb.hxx"
24 enum class EndExtTextInputFlags;
26 class SalI18N_InputContext
29 private:
31 Bool mbUseable; // system supports current locale ?
32 XIC maContext;
34 XIMStyle mnSupportedPreeditStyle;
35 XIMStyle mnStatusStyle;
36 XIMStyle mnPreeditStyle;
38 preedit_data_t maClientData;
39 XIMCallback maPreeditStartCallback;
40 XIMCallback maPreeditDoneCallback;
41 XIMCallback maPreeditDrawCallback;
42 XIMCallback maPreeditCaretCallback;
43 XIMCallback maCommitStringCallback;
44 XIMCallback maSwitchIMCallback;
45 XIMCallback maDestroyCallback;
47 XVaNestedList mpAttributes;
48 XVaNestedList mpStatusAttributes;
49 XVaNestedList mpPreeditAttributes;
51 bool SupportInputMethodStyle( XIMStyles const *pIMStyles );
52 static unsigned int GetWeightingOfIMStyle( XIMStyle n_style );
53 bool IsSupportedIMStyle( XIMStyle n_style ) const;
55 public:
57 Bool UseContext() const { return mbUseable; }
58 bool IsPreeditMode() const { return maClientData.eState == PreeditStatus::Active; }
59 XIC GetContext() const { return maContext; }
61 void ExtendEventMask( ::Window aFocusWindow );
62 void SetICFocus( SalFrame* pFocusFrame );
63 void UnsetICFocus();
64 void HandleDestroyIM();
66 void EndExtTextInput();
67 void CommitKeyEvent( sal_Unicode const * pText, std::size_t nLength );
68 int UpdateSpotLocation();
70 void Map( SalFrame *pFrame );
71 void Unmap();
73 SalI18N_InputContext( SalFrame *aFrame );
74 ~SalI18N_InputContext();
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */