bump product version to 4.2.0.1
[LibreOffice.git] / sfx2 / source / appl / imestatuswindow.hxx
blobc84a7b6e81b5da7d2c72ac41c4e7e7b6f74dc10a
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_SFX2_SOURCE_APPL_IMESTATUSWINDOW_HXX
21 #define INCLUDED_SFX2_SOURCE_APPL_IMESTATUSWINDOW_HXX
23 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
24 #include <com/sun/star/uno/Reference.hxx>
25 #include <cppuhelper/implbase1.hxx>
26 #include <osl/mutex.hxx>
28 namespace com { namespace sun { namespace star {
29 namespace beans { class XPropertySet; }
30 namespace lang { class XMultiServiceFactory; }
31 } } }
33 namespace sfx2 { namespace appl {
35 // The MS compiler needs this typedef work-around to accept the using
36 // declarations within ImeStatusWindow:
37 typedef cppu::WeakImplHelper1< com::sun::star::beans::XPropertyChangeListener >
38 ImeStatusWindow_Impl;
40 /** Control the behavior of any (platform-dependent) IME status windows.
42 The decision of whether a status window shall be displayed or not can be
43 stored permanently in the configuration (under key
44 org.openoffice.office.Common/I18N/InputMethod/ShowStatusWindow; if that
45 entry is nil, VCL is asked for a default).
47 class ImeStatusWindow: private ImeStatusWindow_Impl
49 public:
50 ImeStatusWindow( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& rxContext );
52 /** Set up VCL according to the configuration.
54 Is it not strictly required that this method is called exactly once
55 (though that will be the typical use).
57 Must only be called with the Solar mutex locked.
59 void init();
61 /** Return true if the status window is toggled on.
63 This is only meaningful when canToggle returns true.
65 Can be called without the Solar mutex locked.
67 bool isShowing();
69 /** Toggle the status window on or off.
71 This only works if canToggle returns true (otherwise, any calls of this
72 method are ignored).
74 Must only be called with the Solar mutex locked.
76 void show(bool bShow);
78 /** Return true if the status window can be toggled on and off externally.
80 Must only be called with the Solar mutex locked.
82 bool canToggle() const;
84 using ImeStatusWindow_Impl::acquire;
85 using ImeStatusWindow_Impl::release;
86 using ImeStatusWindow_Impl::operator new;
87 using ImeStatusWindow_Impl::operator delete;
89 private:
90 ImeStatusWindow(ImeStatusWindow &); // not implemented
91 void operator =(ImeStatusWindow); // not implemented
93 virtual ~ImeStatusWindow();
95 virtual void SAL_CALL
96 disposing(com::sun::star::lang::EventObject const & rSource)
97 throw (com::sun::star::uno::RuntimeException);
99 virtual void SAL_CALL
100 propertyChange(com::sun::star::beans::PropertyChangeEvent const & rEvent)
101 throw (com::sun::star::uno::RuntimeException);
103 com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
104 getConfig();
106 com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
107 m_xContext;
109 osl::Mutex m_aMutex;
110 com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
111 m_xConfig;
112 com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >
113 m_xConfigListener;
114 bool m_bDisposed;
119 #endif // INCLUDED_SFX2_SOURCE_APPL_IMESTATUSWINDOW_HXX
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */