bump product version to 4.1.6.2
[LibreOffice.git] / UnoControls / source / inc / statusindicator.hxx
blob300cfc6711c3bd115088441f181fd04cd83fe0ab
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 _UNOCONTROLS_STATUSINDICATOR_CTRL_HXX
21 #define _UNOCONTROLS_STATUSINDICATOR_CTRL_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>
33 #include "basecontainercontrol.hxx"
35 namespace unocontrols{
37 #define SERVICENAME_STATUSINDICATOR "com.sun.star.task.XStatusIndicator"
38 #define IMPLEMENTATIONNAME_STATUSINDICATOR "stardiv.UnoControls.StatusIndicator"
39 #define STATUSINDICATOR_FREEBORDER 5 // border around and between the controls
40 #define FIXEDTEXT_SERVICENAME "com.sun.star.awt.UnoControlFixedText"
41 #define FIXEDTEXT_MODELNAME "com.sun.star.awt.UnoControlFixedTextModel"
42 #define CONTROLNAME_TEXT "Text" // identifier the control in container
43 #define CONTROLNAME_PROGRESSBAR "ProgressBar" // -||-
44 #define STATUSINDICATOR_DEFAULT_TEXT "\0"
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 //____________________________________________________________________________________________________________
52 // structs, types
53 //____________________________________________________________________________________________________________
55 //____________________________________________________________________________________________________________
56 // class declaration
57 //____________________________________________________________________________________________________________
59 class StatusIndicator : public ::com::sun::star::awt::XLayoutConstrains
60 , public ::com::sun::star::task::XStatusIndicator
61 , public BaseContainerControl
64 //-------------------------------------------------------------------------------------------------------------
65 // public methods
66 //-------------------------------------------------------------------------------------------------------------
68 public:
70 //---------------------------------------------------------------------------------------------------------
71 // construct/destruct
72 //---------------------------------------------------------------------------------------------------------
74 /**_______________________________________________________________________________________________________
75 @short
76 @descr
78 @seealso
80 @param
82 @return
84 @onerror
87 StatusIndicator( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
89 /**_______________________________________________________________________________________________________
90 @short
91 @descr
93 @seealso
95 @param
97 @return
99 @onerror
102 virtual ~StatusIndicator();
104 //---------------------------------------------------------------------------------------------------------
105 // XInterface
106 //---------------------------------------------------------------------------------------------------------
108 /**_______________________________________________________________________________________________________
109 @short give answer, if interface is supported
110 @descr The interfaces are searched by type.
112 @seealso XInterface
114 @param "rType" is the type of searched interface.
116 @return Any information about found interface
118 @onerror A RuntimeException is thrown.
121 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
122 throw( ::com::sun::star::uno::RuntimeException );
124 /**_______________________________________________________________________________________________________
125 @short increment refcount
126 @descr -
128 @seealso XInterface
129 @seealso release()
131 @param -
133 @return -
135 @onerror A RuntimeException is thrown.
138 virtual void SAL_CALL acquire() throw();
140 /**_______________________________________________________________________________________________________
141 @short decrement refcount
142 @descr -
144 @seealso XInterface
145 @seealso acquire()
147 @param -
149 @return -
151 @onerror A RuntimeException is thrown.
154 virtual void SAL_CALL release() throw();
156 //---------------------------------------------------------------------------------------------------------
157 // XTypeProvider
158 //---------------------------------------------------------------------------------------------------------
160 /**_______________________________________________________________________________________________________
161 @short get information about supported interfaces
162 @descr -
164 @seealso XTypeProvider
166 @param -
168 @return Sequence of types of all supported interfaces
170 @onerror A RuntimeException is thrown.
173 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
174 throw( ::com::sun::star::uno::RuntimeException );
176 //---------------------------------------------------------------------------------------------------------
177 // XAggregation
178 //---------------------------------------------------------------------------------------------------------
180 /**_______________________________________________________________________________________________________
181 @short -
182 @descr -
184 @seealso -
186 @param -
188 @return -
190 @onerror -
193 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType )
194 throw( ::com::sun::star::uno::RuntimeException );
196 //---------------------------------------------------------------------------------------------------------
197 // XStatusIndicator
198 //---------------------------------------------------------------------------------------------------------
200 /*-****************************************************************************************************//**
201 @short -
202 @descr -
204 @seealso -
206 @param -
208 @return -
210 @onerror -
211 *//*-*****************************************************************************************************/
213 virtual void SAL_CALL start(
214 const OUString& sText ,
215 sal_Int32 nRange
216 ) throw( ::com::sun::star::uno::RuntimeException );
218 /*-****************************************************************************************************//**
219 @short -
220 @descr -
222 @seealso -
224 @param -
226 @return -
228 @onerror -
229 *//*-*****************************************************************************************************/
231 virtual void SAL_CALL end() throw( ::com::sun::star::uno::RuntimeException );
233 /*-****************************************************************************************************//**
234 @short -
235 @descr -
237 @seealso -
239 @param -
241 @return -
243 @onerror -
244 *//*-*****************************************************************************************************/
246 virtual void SAL_CALL reset() throw( ::com::sun::star::uno::RuntimeException );
248 /*-****************************************************************************************************//**
249 @short -
250 @descr -
252 @seealso -
254 @param -
256 @return -
258 @onerror -
259 *//*-*****************************************************************************************************/
261 virtual void SAL_CALL setText( const OUString& sText ) throw( ::com::sun::star::uno::RuntimeException );
263 /*-****************************************************************************************************//**
264 @short -
265 @descr -
267 @seealso -
269 @param -
271 @return -
273 @onerror -
274 *//*-*****************************************************************************************************/
276 virtual void SAL_CALL setValue( sal_Int32 nValue ) throw( ::com::sun::star::uno::RuntimeException );
278 //---------------------------------------------------------------------------------------------------------
279 // XLayoutConstrains
280 //---------------------------------------------------------------------------------------------------------
282 /**_______________________________________________________________________________________________________
283 @short -
284 @descr -
286 @seealso -
288 @param -
290 @return -
292 @onerror -
295 virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize() throw( ::com::sun::star::uno::RuntimeException );
297 /**_______________________________________________________________________________________________________
298 @short -
299 @descr -
301 @seealso -
303 @param -
305 @return -
307 @onerror -
310 virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize() throw( ::com::sun::star::uno::RuntimeException );
312 /**_______________________________________________________________________________________________________
313 @short -
314 @descr -
316 @seealso -
318 @param -
320 @return -
322 @onerror -
325 virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize )
326 throw( ::com::sun::star::uno::RuntimeException );
328 //---------------------------------------------------------------------------------------------------------
329 // XControl
330 //---------------------------------------------------------------------------------------------------------
332 /**_______________________________________________________________________________________________________
333 @short -
334 @descr -
336 @seealso -
338 @param -
340 @return -
342 @onerror -
345 virtual void SAL_CALL createPeer(
346 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& xToolkit ,
347 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent
348 ) throw( ::com::sun::star::uno::RuntimeException );
350 /**_______________________________________________________________________________________________________
351 @short -
352 @descr -
354 @seealso -
356 @param -
358 @return -
360 @onerror -
363 virtual sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel )
364 throw( ::com::sun::star::uno::RuntimeException );
366 /**_______________________________________________________________________________________________________
367 @short -
368 @descr -
370 @seealso -
372 @param -
374 @return -
376 @onerror -
379 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
380 throw( ::com::sun::star::uno::RuntimeException );
382 //---------------------------------------------------------------------------------------------------------
383 // XComponent
384 //---------------------------------------------------------------------------------------------------------
386 /**_______________________________________________________________________________________________________
387 @short -
388 @descr -
390 @seealso -
392 @param -
394 @return -
396 @onerror -
399 virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
401 //---------------------------------------------------------------------------------------------------------
402 // XWindow
403 //---------------------------------------------------------------------------------------------------------
405 /**_______________________________________________________________________________________________________
406 @short -
407 @descr -
409 @seealso -
411 @param -
413 @return -
415 @onerror -
418 virtual void SAL_CALL setPosSize( sal_Int32 nX ,
419 sal_Int32 nY ,
420 sal_Int32 nWidth ,
421 sal_Int32 nHeight ,
422 sal_Int16 nFlags ) throw( ::com::sun::star::uno::RuntimeException );
424 //---------------------------------------------------------------------------------------------------------
425 // BaseControl
426 //---------------------------------------------------------------------------------------------------------
428 /**_______________________________________________________________________________________________________
429 @short -
430 @descr -
432 @seealso -
434 @param -
436 @return -
438 @onerror -
441 static const ::com::sun::star::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
443 /**_______________________________________________________________________________________________________
444 @short -
445 @descr -
447 @seealso -
449 @param -
451 @return -
453 @onerror -
456 static const OUString impl_getStaticImplementationName();
458 //____________________________________________________________________________________________________________
459 // protected methods
460 //____________________________________________________________________________________________________________
462 protected:
464 /**_______________________________________________________________________________________________________
465 @short -
466 @descr -
468 @seealso -
470 @param -
472 @return -
474 @onerror -
477 virtual ::com::sun::star::awt::WindowDescriptor* impl_getWindowDescriptor(
478 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParentPeer
481 /**_______________________________________________________________________________________________________
482 @short -
483 @descr -
485 @seealso -
487 @param -
489 @return -
491 @onerror -
494 virtual void impl_paint (
495 sal_Int32 nX,
496 sal_Int32 nY,
497 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > & rGraphics
500 /**_______________________________________________________________________________________________________
501 @short -
502 @descr -
504 @seealso -
506 @param -
508 @return -
510 @onerror -
513 virtual void impl_recalcLayout( const ::com::sun::star::awt::WindowEvent& aEvent );
515 //____________________________________________________________________________________________________________
516 // debug methods
517 //____________________________________________________________________________________________________________
519 private:
521 /**_______________________________________________________________________________________________________
522 @short -
523 @descr -
525 @seealso -
527 @param -
529 @return -
531 @onerror -
534 //____________________________________________________________________________________________________________
535 // private variables
536 //____________________________________________________________________________________________________________
538 private:
540 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFixedText > m_xText ;
541 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XProgressBar > m_xProgressBar ;
543 }; // class StatusIndicator
545 } // namespace unocontrols
547 #endif // #ifndef _UNOCONTROLS_STATUSINDICATOR_CTRL_HXX
549 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */