Update ooo320-m1
[ooovba.git] / UnoControls / source / inc / statusindicator.hxx
blob2210133c030437d327713116c3888bff8e5d7ffa
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: statusindicator.hxx,v $
10 * $Revision: 1.7 $
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 #ifndef _UNOCONTROLS_STATUSINDICATOR_CTRL_HXX
32 #define _UNOCONTROLS_STATUSINDICATOR_CTRL_HXX
34 //____________________________________________________________________________________________________________
35 // includes of other projects
36 //____________________________________________________________________________________________________________
38 #include <com/sun/star/awt/XControlModel.hpp>
39 #include <com/sun/star/awt/XFixedText.hpp>
40 #include <com/sun/star/awt/XGraphics.hpp>
41 #include <com/sun/star/awt/XLayoutConstrains.hpp>
42 #include <com/sun/star/awt/XProgressBar.hpp>
43 #include <com/sun/star/task/XStatusIndicator.hpp>
44 #include <com/sun/star/awt/XToolkit.hpp>
45 #include <com/sun/star/awt/XWindowPeer.hpp>
46 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
48 //____________________________________________________________________________________________________________
49 // includes of my own project
50 //____________________________________________________________________________________________________________
51 #include "basecontainercontrol.hxx"
53 //____________________________________________________________________________________________________________
54 // namespace
55 //____________________________________________________________________________________________________________
57 namespace unocontrols{
59 #define UNO3_ANY ::com::sun::star::uno::Any
60 #define UNO3_OUSTRING ::rtl::OUString
61 #define UNO3_RECTANGLE ::com::sun::star::awt::Rectangle
62 #define UNO3_REFERENCE ::com::sun::star::uno::Reference
63 #define UNO3_RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
64 #define UNO3_SEQUENCE ::com::sun::star::uno::Sequence
65 #define UNO3_SIZE ::com::sun::star::awt::Size
66 #define UNO3_TYPE ::com::sun::star::uno::Type
67 #define UNO3_XCONTROLMODEL ::com::sun::star::awt::XControlModel
68 #define UNO3_XFIXEDTEXT ::com::sun::star::awt::XFixedText
69 #define UNO3_XGRAPHICS ::com::sun::star::awt::XGraphics
70 #define UNO3_XLAYOUTCONSTRAINS ::com::sun::star::awt::XLayoutConstrains
71 #define UNO3_XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory
72 #define UNO3_XPROGRESSBAR ::com::sun::star::awt::XProgressBar
73 #define UNO3_XSTATUSINDICATOR ::com::sun::star::task::XStatusIndicator
74 #define UNO3_XTOOLKIT ::com::sun::star::awt::XToolkit
75 #define UNO3_XWINDOWPEER ::com::sun::star::awt::XWindowPeer
77 //____________________________________________________________________________________________________________
78 // defines
79 //____________________________________________________________________________________________________________
81 #define SERVICENAME_STATUSINDICATOR "com.sun.star.task.XStatusIndicator"
82 #define IMPLEMENTATIONNAME_STATUSINDICATOR "stardiv.UnoControls.StatusIndicator"
83 #undef FREEBORDER
84 #define FREEBORDER 5 // border around and between the controls
85 #define FIXEDTEXT_SERVICENAME "com.sun.star.awt.UnoControlFixedText"
86 #define FIXEDTEXT_MODELNAME "com.sun.star.awt.UnoControlFixedTextModel"
87 #define CONTROLNAME_TEXT "Text" // identifier the control in container
88 #define CONTROLNAME_PROGRESSBAR "ProgressBar" // -||-
89 #define DEFAULT_TEXT "\0"
90 #define BACKGROUNDCOLOR TRGB_COLORDATA( 0x00, 0xC0, 0xC0, 0xC0 ) // lighgray
91 #define LINECOLOR_BRIGHT TRGB_COLORDATA( 0x00, 0xFF, 0xFF, 0xFF ) // white
92 #define LINECOLOR_SHADOW TRGB_COLORDATA( 0x00, 0x00, 0x00, 0x00 ) // black
93 // Overwrite defines from basecontrol.hxx!!!
94 #undef DEFAULT_WIDTH
95 #undef DEFAULT_HEIGHT
96 #define DEFAULT_WIDTH 300
97 #define DEFAULT_HEIGHT 25
99 //____________________________________________________________________________________________________________
100 // structs, types
101 //____________________________________________________________________________________________________________
103 //____________________________________________________________________________________________________________
104 // class declaration
105 //____________________________________________________________________________________________________________
107 class StatusIndicator : public UNO3_XLAYOUTCONSTRAINS
108 , public UNO3_XSTATUSINDICATOR
109 , public BaseContainerControl
112 //-------------------------------------------------------------------------------------------------------------
113 // public methods
114 //-------------------------------------------------------------------------------------------------------------
116 public:
118 //---------------------------------------------------------------------------------------------------------
119 // construct/destruct
120 //---------------------------------------------------------------------------------------------------------
122 /**_______________________________________________________________________________________________________
123 @short
124 @descr
126 @seealso
128 @param
130 @return
132 @onerror
135 StatusIndicator( const UNO3_REFERENCE< UNO3_XMULTISERVICEFACTORY >& xFactory );
137 /**_______________________________________________________________________________________________________
138 @short
139 @descr
141 @seealso
143 @param
145 @return
147 @onerror
150 virtual ~StatusIndicator();
152 //---------------------------------------------------------------------------------------------------------
153 // XInterface
154 //---------------------------------------------------------------------------------------------------------
156 /**_______________________________________________________________________________________________________
157 @short give answer, if interface is supported
158 @descr The interfaces are searched by type.
160 @seealso XInterface
162 @param "rType" is the type of searched interface.
164 @return Any information about found interface
166 @onerror A RuntimeException is thrown.
169 virtual UNO3_ANY SAL_CALL queryInterface( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
171 /**_______________________________________________________________________________________________________
172 @short increment refcount
173 @descr -
175 @seealso XInterface
176 @seealso release()
178 @param -
180 @return -
182 @onerror A RuntimeException is thrown.
185 virtual void SAL_CALL acquire() throw();
187 /**_______________________________________________________________________________________________________
188 @short decrement refcount
189 @descr -
191 @seealso XInterface
192 @seealso acquire()
194 @param -
196 @return -
198 @onerror A RuntimeException is thrown.
201 virtual void SAL_CALL release() throw();
203 //---------------------------------------------------------------------------------------------------------
204 // XTypeProvider
205 //---------------------------------------------------------------------------------------------------------
207 /**_______________________________________________________________________________________________________
208 @short get information about supported interfaces
209 @descr -
211 @seealso XTypeProvider
213 @param -
215 @return Sequence of types of all supported interfaces
217 @onerror A RuntimeException is thrown.
220 virtual UNO3_SEQUENCE< UNO3_TYPE > SAL_CALL getTypes() throw( UNO3_RUNTIMEEXCEPTION );
222 //---------------------------------------------------------------------------------------------------------
223 // XAggregation
224 //---------------------------------------------------------------------------------------------------------
226 /**_______________________________________________________________________________________________________
227 @short -
228 @descr -
230 @seealso -
232 @param -
234 @return -
236 @onerror -
239 virtual UNO3_ANY SAL_CALL queryAggregation( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
241 //---------------------------------------------------------------------------------------------------------
242 // XStatusIndicator
243 //---------------------------------------------------------------------------------------------------------
245 /*-****************************************************************************************************//**
246 @short -
247 @descr -
249 @seealso -
251 @param -
253 @return -
255 @onerror -
256 *//*-*****************************************************************************************************/
258 virtual void SAL_CALL start( const UNO3_OUSTRING& sText ,
259 sal_Int32 nRange ) throw( UNO3_RUNTIMEEXCEPTION );
261 /*-****************************************************************************************************//**
262 @short -
263 @descr -
265 @seealso -
267 @param -
269 @return -
271 @onerror -
272 *//*-*****************************************************************************************************/
274 virtual void SAL_CALL end() throw( UNO3_RUNTIMEEXCEPTION );
276 /*-****************************************************************************************************//**
277 @short -
278 @descr -
280 @seealso -
282 @param -
284 @return -
286 @onerror -
287 *//*-*****************************************************************************************************/
289 virtual void SAL_CALL reset() throw( UNO3_RUNTIMEEXCEPTION );
291 /*-****************************************************************************************************//**
292 @short -
293 @descr -
295 @seealso -
297 @param -
299 @return -
301 @onerror -
302 *//*-*****************************************************************************************************/
304 virtual void SAL_CALL setText( const UNO3_OUSTRING& sText ) throw( UNO3_RUNTIMEEXCEPTION );
306 /*-****************************************************************************************************//**
307 @short -
308 @descr -
310 @seealso -
312 @param -
314 @return -
316 @onerror -
317 *//*-*****************************************************************************************************/
319 virtual void SAL_CALL setValue( sal_Int32 nValue ) throw( UNO3_RUNTIMEEXCEPTION );
321 //---------------------------------------------------------------------------------------------------------
322 // XLayoutConstrains
323 //---------------------------------------------------------------------------------------------------------
325 /**_______________________________________________________________________________________________________
326 @short -
327 @descr -
329 @seealso -
331 @param -
333 @return -
335 @onerror -
338 virtual UNO3_SIZE SAL_CALL getMinimumSize() throw( UNO3_RUNTIMEEXCEPTION );
340 /**_______________________________________________________________________________________________________
341 @short -
342 @descr -
344 @seealso -
346 @param -
348 @return -
350 @onerror -
353 virtual UNO3_SIZE SAL_CALL getPreferredSize() throw( UNO3_RUNTIMEEXCEPTION );
355 /**_______________________________________________________________________________________________________
356 @short -
357 @descr -
359 @seealso -
361 @param -
363 @return -
365 @onerror -
368 virtual UNO3_SIZE SAL_CALL calcAdjustedSize( const UNO3_SIZE& aNewSize ) throw( UNO3_RUNTIMEEXCEPTION );
370 //---------------------------------------------------------------------------------------------------------
371 // XControl
372 //---------------------------------------------------------------------------------------------------------
374 /**_______________________________________________________________________________________________________
375 @short -
376 @descr -
378 @seealso -
380 @param -
382 @return -
384 @onerror -
387 virtual void SAL_CALL createPeer( const UNO3_REFERENCE< UNO3_XTOOLKIT >& xToolkit ,
388 const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xParent ) throw( UNO3_RUNTIMEEXCEPTION );
390 /**_______________________________________________________________________________________________________
391 @short -
392 @descr -
394 @seealso -
396 @param -
398 @return -
400 @onerror -
403 virtual sal_Bool SAL_CALL setModel( const UNO3_REFERENCE< UNO3_XCONTROLMODEL >& xModel ) throw( UNO3_RUNTIMEEXCEPTION );
405 /**_______________________________________________________________________________________________________
406 @short -
407 @descr -
409 @seealso -
411 @param -
413 @return -
415 @onerror -
418 virtual UNO3_REFERENCE< UNO3_XCONTROLMODEL > SAL_CALL getModel() throw( UNO3_RUNTIMEEXCEPTION );
420 //---------------------------------------------------------------------------------------------------------
421 // XComponent
422 //---------------------------------------------------------------------------------------------------------
424 /**_______________________________________________________________________________________________________
425 @short -
426 @descr -
428 @seealso -
430 @param -
432 @return -
434 @onerror -
437 virtual void SAL_CALL dispose() throw( UNO3_RUNTIMEEXCEPTION );
439 //---------------------------------------------------------------------------------------------------------
440 // XWindow
441 //---------------------------------------------------------------------------------------------------------
443 /**_______________________________________________________________________________________________________
444 @short -
445 @descr -
447 @seealso -
449 @param -
451 @return -
453 @onerror -
456 virtual void SAL_CALL setPosSize( sal_Int32 nX ,
457 sal_Int32 nY ,
458 sal_Int32 nWidth ,
459 sal_Int32 nHeight ,
460 sal_Int16 nFlags ) throw( UNO3_RUNTIMEEXCEPTION );
462 //---------------------------------------------------------------------------------------------------------
463 // BaseControl
464 //---------------------------------------------------------------------------------------------------------
466 /**_______________________________________________________________________________________________________
467 @short -
468 @descr -
470 @seealso -
472 @param -
474 @return -
476 @onerror -
479 static const UNO3_SEQUENCE< UNO3_OUSTRING > impl_getStaticSupportedServiceNames();
481 /**_______________________________________________________________________________________________________
482 @short -
483 @descr -
485 @seealso -
487 @param -
489 @return -
491 @onerror -
494 static const UNO3_OUSTRING impl_getStaticImplementationName();
496 //____________________________________________________________________________________________________________
497 // protected methods
498 //____________________________________________________________________________________________________________
500 protected:
502 /**_______________________________________________________________________________________________________
503 @short -
504 @descr -
506 @seealso -
508 @param -
510 @return -
512 @onerror -
515 virtual UNO3_WINDOWDESCRIPTOR* impl_getWindowDescriptor( const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xParentPeer );
517 /**_______________________________________________________________________________________________________
518 @short -
519 @descr -
521 @seealso -
523 @param -
525 @return -
527 @onerror -
530 virtual void impl_paint ( sal_Int32 nX, sal_Int32 nY, const UNO3_REFERENCE< UNO3_XGRAPHICS > & rGraphics );
532 /**_______________________________________________________________________________________________________
533 @short -
534 @descr -
536 @seealso -
538 @param -
540 @return -
542 @onerror -
545 virtual void impl_recalcLayout( const UNO3_WINDOWEVENT& aEvent );
547 //____________________________________________________________________________________________________________
548 // debug methods
549 //____________________________________________________________________________________________________________
551 private:
553 /**_______________________________________________________________________________________________________
554 @short -
555 @descr -
557 @seealso -
559 @param -
561 @return -
563 @onerror -
566 #if OSL_DEBUG_LEVEL > 1
568 #endif
570 //____________________________________________________________________________________________________________
571 // private variables
572 //____________________________________________________________________________________________________________
574 private:
576 UNO3_REFERENCE< UNO3_XFIXEDTEXT > m_xText ;
577 UNO3_REFERENCE< UNO3_XPROGRESSBAR > m_xProgressBar ;
579 }; // class StatusIndicator
581 } // namespace unocontrols
583 #endif // #ifndef _UNOCONTROLS_STATUSINDICATOR_CTRL_HXX