Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SAL_I18N_STATUS_HXX
30 : : #define _SAL_I18N_STATUS_HXX
31 : :
32 : : #include <tools/string.hxx>
33 : : #include <tools/gen.hxx>
34 : :
35 : : #include <rtl/ustring.hxx>
36 : : #include <salimestatus.hxx>
37 : :
38 : : #include <vector>
39 : :
40 : : class SalFrame;
41 : : class WorkWindow;
42 : : class ListBox;
43 : : class FixedText;
44 : : class PushButton;
45 : : class SalI18N_InputContext;
46 : :
47 : : namespace vcl
48 : : {
49 : :
50 : : class StatusWindow;
51 : :
52 : : class X11ImeStatus : public SalI18NImeStatus
53 : : {
54 : : public:
55 : 0 : X11ImeStatus() {}
56 : : virtual ~X11ImeStatus();
57 : :
58 : : virtual bool canToggle();
59 : : virtual void toggle();
60 : : };
61 : :
62 : : class I18NStatus
63 : : {
64 : : public:
65 : 0 : struct ChoiceData
66 : : {
67 : : String aString;
68 : : void* pData;
69 : : };
70 : : private:
71 : : SalFrame* m_pParent;
72 : : StatusWindow* m_pStatusWindow;
73 : : String m_aCurrentIM;
74 : : ::std::vector< ChoiceData > m_aChoices;
75 : :
76 : : I18NStatus();
77 : : ~I18NStatus();
78 : :
79 : : static I18NStatus* pInstance;
80 : :
81 : : static bool getStatusWindowMode();
82 : :
83 : : public:
84 : : static I18NStatus& get();
85 : : static bool exists();
86 : : static void free();
87 : :
88 : : void setParent( SalFrame* pParent );
89 : 0 : SalFrame* getParent() const { return m_pParent; }
90 : : SalFrame* getStatusFrame() const;
91 : :
92 : : void setStatusText( const String& rText );
93 : :
94 : : enum ShowReason { focus, presentation, contextmap };
95 : : void show( bool bShow, ShowReason eReason );
96 : :
97 : 0 : const ::std::vector< ChoiceData >& getChoices() const { return m_aChoices; }
98 : :
99 : : // for SwitchIMCallback
100 : : void changeIM( const String& );
101 : :
102 : : // External Control:
103 : :
104 : : /** Return true if the status window can be toggled on and off externally.
105 : : */
106 : : bool canToggleStatusWindow() const;
107 : :
108 : : /** Toggle the status window on or off.
109 : :
110 : : This only works if canToggleStatusWindow returns true (otherwise, any
111 : : calls of this method are ignored).
112 : : */
113 : : void toggleStatusWindow();
114 : : };
115 : :
116 : : } // namespace
117 : :
118 : : #endif // _SAL_I18N_STATUS_HXX
119 : :
120 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|