Branch libreoffice-5-0-4
[LibreOffice.git] / vcl / inc / unx / i18n_status.hxx
blobff954ceb37c4ff7e638de7bca809e45e802c414d
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 #ifndef INCLUDED_VCL_INC_UNX_I18N_STATUS_HXX
21 #define INCLUDED_VCL_INC_UNX_I18N_STATUS_HXX
23 #include <rtl/ustring.hxx>
24 #include <salimestatus.hxx>
25 #include <vcl/vclptr.hxx>
27 #include <vector>
29 class SalFrame;
30 class WorkWindow;
31 class ListBox;
32 class FixedText;
33 class PushButton;
34 class SalI18N_InputContext;
36 namespace vcl
39 class StatusWindow;
41 class X11ImeStatus : public SalI18NImeStatus
43 public:
44 X11ImeStatus() {}
45 virtual ~X11ImeStatus();
47 virtual bool canToggle() SAL_OVERRIDE;
48 virtual void toggle() SAL_OVERRIDE;
51 class I18NStatus
53 public:
54 struct ChoiceData
56 OUString aString;
57 void* pData;
59 private:
60 SalFrame* m_pParent;
61 VclPtr<StatusWindow> m_pStatusWindow;
62 OUString m_aCurrentIM;
63 ::std::vector< ChoiceData > m_aChoices;
65 I18NStatus();
66 ~I18NStatus();
68 static I18NStatus* pInstance;
70 static bool getStatusWindowMode();
72 public:
73 static I18NStatus& get();
74 static bool exists();
75 static void free();
77 void setParent( SalFrame* pParent );
78 SalFrame* getParent() const { return m_pParent; }
79 SalFrame* getStatusFrame() const;
81 void setStatusText( const OUString& rText );
83 enum ShowReason { focus, presentation, contextmap };
84 void show( bool bShow, ShowReason eReason );
86 const ::std::vector< ChoiceData >& getChoices() const { return m_aChoices; }
88 // for SwitchIMCallback
89 void changeIM( const OUString& );
91 // External Control:
93 /** Toggle the status window on or off.
95 This only works if canToggleStatusWindow returns true (otherwise, any
96 calls of this method are ignored).
98 void toggleStatusWindow();
101 } // namespace
103 #endif // INCLUDED_VCL_INC_UNX_I18N_STATUS_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */