bump product version to 5.0.4.1
[LibreOffice.git] / UnoControls / source / inc / statusindicator.hxx
blob4760d3ea1cebaf2edf10335e73e01022c9f29565
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_UNOCONTROLS_SOURCE_INC_STATUSINDICATOR_HXX
21 #define INCLUDED_UNOCONTROLS_SOURCE_INC_STATUSINDICATOR_HXX
23 #include <com/sun/star/awt/XControlModel.hpp>
24 #include <com/sun/star/awt/XFixedText.hpp>
25 #include <com/sun/star/awt/XGraphics.hpp>
26 #include <com/sun/star/awt/XLayoutConstrains.hpp>
27 #include <com/sun/star/awt/XProgressBar.hpp>
28 #include <com/sun/star/task/XStatusIndicator.hpp>
29 #include <com/sun/star/awt/XToolkit.hpp>
30 #include <com/sun/star/awt/XWindowPeer.hpp>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <rtl/ref.hxx>
34 #include "basecontainercontrol.hxx"
36 namespace unocontrols{
38 class ProgressBar;
40 #define STATUSINDICATOR_FREEBORDER 5 // border around and between the controls
41 #define FIXEDTEXT_SERVICENAME "com.sun.star.awt.UnoControlFixedText"
42 #define FIXEDTEXT_MODELNAME "com.sun.star.awt.UnoControlFixedTextModel"
43 #define CONTROLNAME_TEXT "Text" // identifier the control in container
44 #define CONTROLNAME_PROGRESSBAR "ProgressBar" // -||-
45 #define STATUSINDICATOR_BACKGROUNDCOLOR TRGB_COLORDATA( 0x00, 0xC0, 0xC0, 0xC0 ) // lighgray
46 #define STATUSINDICATOR_LINECOLOR_BRIGHT TRGB_COLORDATA( 0x00, 0xFF, 0xFF, 0xFF ) // white
47 #define STATUSINDICATOR_LINECOLOR_SHADOW TRGB_COLORDATA( 0x00, 0x00, 0x00, 0x00 ) // black
48 #define STATUSINDICATOR_DEFAULT_WIDTH 300
49 #define STATUSINDICATOR_DEFAULT_HEIGHT 25
51 // structs, types
53 // class declaration
55 class StatusIndicator : public ::com::sun::star::awt::XLayoutConstrains
56 , public ::com::sun::star::task::XStatusIndicator
57 , public BaseContainerControl
60 // public methods
62 public:
64 // construct/destruct
66 /**_______________________________________________________________________________________________________
67 @short
68 @descr
70 @seealso
72 @param
74 @return
76 @onerror
79 StatusIndicator( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
81 /**_______________________________________________________________________________________________________
82 @short
83 @descr
85 @seealso
87 @param
89 @return
91 @onerror
94 virtual ~StatusIndicator();
96 // XInterface
98 /**_______________________________________________________________________________________________________
99 @short give answer, if interface is supported
100 @descr The interfaces are searched by type.
102 @seealso XInterface
104 @param "rType" is the type of searched interface.
106 @return Any information about found interface
108 @onerror A RuntimeException is thrown.
111 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
112 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
114 /**_______________________________________________________________________________________________________
115 @short increment refcount
116 @seealso XInterface
117 @seealso release()
118 @onerror A RuntimeException is thrown.
121 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
123 /**_______________________________________________________________________________________________________
124 @short decrement refcount
125 @seealso XInterface
126 @seealso acquire()
127 @onerror A RuntimeException is thrown.
130 virtual void SAL_CALL release() throw() SAL_OVERRIDE;
132 // XTypeProvider
134 /**_______________________________________________________________________________________________________
135 @short get information about supported interfaces
136 @seealso XTypeProvider
137 @return Sequence of types of all supported interfaces
139 @onerror A RuntimeException is thrown.
142 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
143 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
145 // XAggregation
147 /**_______________________________________________________________________________________________________
150 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType )
151 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
153 // XStatusIndicator
155 /*-****************************************************************************************************
156 *//*-*****************************************************************************************************/
158 virtual void SAL_CALL start(
159 const OUString& sText ,
160 sal_Int32 nRange
161 ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
163 /*-****************************************************************************************************
164 *//*-*****************************************************************************************************/
166 virtual void SAL_CALL end() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
168 /*-****************************************************************************************************
169 *//*-*****************************************************************************************************/
171 virtual void SAL_CALL reset() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
173 /*-****************************************************************************************************
174 *//*-*****************************************************************************************************/
176 virtual void SAL_CALL setText( const OUString& sText ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
178 /*-****************************************************************************************************
179 *//*-*****************************************************************************************************/
181 virtual void SAL_CALL setValue( sal_Int32 nValue ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
183 // XLayoutConstrains
185 /**_______________________________________________________________________________________________________
188 virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
190 /**_______________________________________________________________________________________________________
193 virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
195 /**_______________________________________________________________________________________________________
198 virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize )
199 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
201 // XControl
203 /**_______________________________________________________________________________________________________
206 virtual void SAL_CALL createPeer(
207 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& xToolkit ,
208 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent
209 ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
211 /**_______________________________________________________________________________________________________
214 virtual sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel )
215 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
217 /**_______________________________________________________________________________________________________
220 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
221 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
223 // XComponent
225 /**_______________________________________________________________________________________________________
228 virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
230 // XWindow
232 /**_______________________________________________________________________________________________________
235 virtual void SAL_CALL setPosSize( sal_Int32 nX ,
236 sal_Int32 nY ,
237 sal_Int32 nWidth ,
238 sal_Int32 nHeight ,
239 sal_Int16 nFlags ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
241 // BaseControl
243 /**_______________________________________________________________________________________________________
246 static const ::com::sun::star::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
248 /**_______________________________________________________________________________________________________
251 static const OUString impl_getStaticImplementationName();
253 // protected methods
255 protected:
257 /**_______________________________________________________________________________________________________
260 virtual ::com::sun::star::awt::WindowDescriptor* impl_getWindowDescriptor(
261 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParentPeer
262 ) SAL_OVERRIDE;
264 /**_______________________________________________________________________________________________________
267 virtual void impl_paint (
268 sal_Int32 nX,
269 sal_Int32 nY,
270 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > & rGraphics
271 ) SAL_OVERRIDE;
273 /**_______________________________________________________________________________________________________
276 virtual void impl_recalcLayout( const ::com::sun::star::awt::WindowEvent& aEvent ) SAL_OVERRIDE;
278 // debug methods
280 private:
282 /**_______________________________________________________________________________________________________
285 // private variables
287 private:
289 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFixedText > m_xText;
290 rtl::Reference<ProgressBar> m_xProgressBar;
292 }; // class StatusIndicator
294 } // namespace unocontrols
296 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_STATUSINDICATOR_HXX
298 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */