merge the formfield patch from ooo-build
[ooovba.git] / sfx2 / source / appl / imestatuswindow.hxx
blobb26a1c9075c699b587c0027b32fa13fe18af8f71
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: imestatuswindow.hxx,v $
10 * $Revision: 1.5 $
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 #if !defined INCLUDED_SFX2_APPL_IMESTATUSWINDOW_HXX
32 #define INCLUDED_SFX2_APPL_IMESTATUSWINDOW_HXX
34 #include "com/sun/star/beans/XPropertyChangeListener.hpp"
35 #include "com/sun/star/uno/Reference.hxx"
36 #include "cppuhelper/implbase1.hxx"
37 #include "osl/mutex.hxx"
39 namespace com { namespace sun { namespace star {
40 namespace beans { class XPropertySet; }
41 namespace lang { class XMultiServiceFactory; }
42 } } }
43 class SfxApplication;
45 namespace sfx2 { namespace appl {
47 // The MS compiler needs this typedef work-around to accept the using
48 // declarations within ImeStatusWindow:
49 typedef cppu::WeakImplHelper1< com::sun::star::beans::XPropertyChangeListener >
50 ImeStatusWindow_Impl;
52 /** Control the behavior of any (platform-dependent) IME status windows.
54 The decision of whether a status window shall be displayed or not can be
55 stored permanently in the configuration (under key
56 org.openoffice.office.Common/I18N/InputMethod/ShowStatusWindow; if that
57 entry is nil, VCL is asked for a default).
59 class ImeStatusWindow: private ImeStatusWindow_Impl
61 public:
62 ImeStatusWindow(SfxApplication & rApplication,
63 com::sun::star::uno::Reference<
64 com::sun::star::lang::XMultiServiceFactory > const &
65 rServiceFactory);
67 /** Set up VCL according to the configuration.
69 Is it not strictly required that this method is called exactly once
70 (though that will be the typical use).
72 Must only be called with the Solar mutex locked.
74 void init();
76 /** Return true if the status window is toggled on.
78 This is only meaningful when canToggle returns true.
80 Can be called without the Solar mutex locked.
82 bool isShowing();
84 /** Toggle the status window on or off.
86 This only works if canToggle returns true (otherwise, any calls of this
87 method are ignored).
89 Must only be called with the Solar mutex locked.
91 void show(bool bShow);
93 /** Return true if the status window can be toggled on and off externally.
95 Must only be called with the Solar mutex locked.
97 bool canToggle() const;
99 using ImeStatusWindow_Impl::acquire;
100 using ImeStatusWindow_Impl::release;
101 using ImeStatusWindow_Impl::operator new;
102 using ImeStatusWindow_Impl::operator delete;
104 private:
105 ImeStatusWindow(ImeStatusWindow &); // not implemented
106 void operator =(ImeStatusWindow); // not implemented
108 virtual ~ImeStatusWindow();
110 virtual void SAL_CALL
111 disposing(com::sun::star::lang::EventObject const & rSource)
112 throw (com::sun::star::uno::RuntimeException);
114 virtual void SAL_CALL
115 propertyChange(com::sun::star::beans::PropertyChangeEvent const & rEvent)
116 throw (com::sun::star::uno::RuntimeException);
118 com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
119 getConfig();
121 SfxApplication & m_rApplication;
122 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
123 m_xServiceFactory;
125 osl::Mutex m_aMutex;
126 com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
127 m_xConfig;
128 bool m_bDisposed;
133 #endif // INCLUDED_SFX2_APPL_IMESTATUSWINDOW_HXX