merge the formfield patch from ooo-build
[ooovba.git] / vcl / unx / inc / i18n_status.hxx
blob7e261a9a78b3275a541f19cf6a28cd68de5f09df
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: i18n_status.hxx,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SAL_I18N_STATUS_HXX
32 #define _SAL_I18N_STATUS_HXX
34 #include <tools/string.hxx>
35 #include <tools/link.hxx>
36 #include <tools/gen.hxx>
38 #ifndef _RTL_USTRING_HXX
39 #include <rtl/ustring.hxx>
40 #endif
41 #include <vcl/salimestatus.hxx>
43 #include <vector>
45 class SalFrame;
46 class WorkWindow;
47 class ListBox;
48 class FixedText;
49 class PushButton;
50 class SalI18N_InputContext;
52 namespace vcl
55 class StatusWindow;
57 class X11ImeStatus : public SalI18NImeStatus
59 public:
60 X11ImeStatus() {}
61 virtual ~X11ImeStatus();
63 virtual bool canToggle();
64 virtual void toggle();
67 class I18NStatus
69 public:
70 struct ChoiceData
72 String aString;
73 void* pData;
75 private:
76 SalFrame* m_pParent;
77 StatusWindow* m_pStatusWindow;
78 String m_aCurrentIM;
79 ::std::vector< ChoiceData > m_aChoices;
81 I18NStatus();
82 ~I18NStatus();
84 static I18NStatus* pInstance;
86 static bool getStatusWindowMode();
88 public:
89 static I18NStatus& get();
90 static bool exists();
91 static void free();
93 void setParent( SalFrame* pParent );
94 SalFrame* getParent() const { return m_pParent; }
95 SalFrame* getStatusFrame() const;
97 void setStatusText( const String& rText );
98 String getStatusText() const;
100 enum ShowReason { focus, presentation, contextmap };
101 void show( bool bShow, ShowReason eReason );
103 const ::std::vector< ChoiceData >& getChoices() const { return m_aChoices; }
104 void clearChoices();
105 void addChoice( const String&, void* pData );
107 void toTop() const;
109 // for SwitchIMCallback
110 void changeIM( const String& );
112 // External Control:
114 /** Return true if the status window can be toggled on and off externally.
116 bool canToggleStatusWindow() const;
118 /** Toggle the status window on or off.
120 This only works if canToggleStatusWindow returns true (otherwise, any
121 calls of this method are ignored).
123 void toggleStatusWindow();
126 } // namespace
128 #endif // _SAL_I18N_STATUS_HXX