1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
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.
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).
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.
27 ************************************************************************/
29 #if !defined INCLUDED_SFX2_APPL_IMESTATUSWINDOW_HXX
30 #define INCLUDED_SFX2_APPL_IMESTATUSWINDOW_HXX
32 #include "com/sun/star/beans/XPropertyChangeListener.hpp"
33 #include "com/sun/star/uno/Reference.hxx"
34 #include "cppuhelper/implbase1.hxx"
35 #include "osl/mutex.hxx"
37 namespace com
{ namespace sun
{ namespace star
{
38 namespace beans
{ class XPropertySet
; }
39 namespace lang
{ class XMultiServiceFactory
; }
42 namespace sfx2
{ namespace appl
{
44 // The MS compiler needs this typedef work-around to accept the using
45 // declarations within ImeStatusWindow:
46 typedef cppu::WeakImplHelper1
< com::sun::star::beans::XPropertyChangeListener
>
49 /** Control the behavior of any (platform-dependent) IME status windows.
51 The decision of whether a status window shall be displayed or not can be
52 stored permanently in the configuration (under key
53 org.openoffice.office.Common/I18N/InputMethod/ShowStatusWindow; if that
54 entry is nil, VCL is asked for a default).
56 class ImeStatusWindow
: private ImeStatusWindow_Impl
59 ImeStatusWindow( com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
> const& rServiceFactory
);
61 /** Set up VCL according to the configuration.
63 Is it not strictly required that this method is called exactly once
64 (though that will be the typical use).
66 Must only be called with the Solar mutex locked.
70 /** Return true if the status window is toggled on.
72 This is only meaningful when canToggle returns true.
74 Can be called without the Solar mutex locked.
78 /** Toggle the status window on or off.
80 This only works if canToggle returns true (otherwise, any calls of this
83 Must only be called with the Solar mutex locked.
85 void show(bool bShow
);
87 /** Return true if the status window can be toggled on and off externally.
89 Must only be called with the Solar mutex locked.
91 bool canToggle() const;
93 using ImeStatusWindow_Impl::acquire
;
94 using ImeStatusWindow_Impl::release
;
95 using ImeStatusWindow_Impl::operator new;
96 using ImeStatusWindow_Impl::operator delete;
99 ImeStatusWindow(ImeStatusWindow
&); // not implemented
100 void operator =(ImeStatusWindow
); // not implemented
102 virtual ~ImeStatusWindow();
104 virtual void SAL_CALL
105 disposing(com::sun::star::lang::EventObject
const & rSource
)
106 throw (com::sun::star::uno::RuntimeException
);
108 virtual void SAL_CALL
109 propertyChange(com::sun::star::beans::PropertyChangeEvent
const & rEvent
)
110 throw (com::sun::star::uno::RuntimeException
);
112 com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
>
115 com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>
119 com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
>
121 com::sun::star::uno::Reference
< com::sun::star::beans::XPropertyChangeListener
>
128 #endif // INCLUDED_SFX2_APPL_IMESTATUSWINDOW_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */