1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: statusindicator.hxx,v $
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 //____________________________________________________________________________________________________________
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 //____________________________________________________________________________________________________________
79 //____________________________________________________________________________________________________________
81 #define SERVICENAME_STATUSINDICATOR "com.sun.star.task.XStatusIndicator"
82 #define IMPLEMENTATIONNAME_STATUSINDICATOR "stardiv.UnoControls.StatusIndicator"
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!!!
96 #define DEFAULT_WIDTH 300
97 #define DEFAULT_HEIGHT 25
99 //____________________________________________________________________________________________________________
101 //____________________________________________________________________________________________________________
103 //____________________________________________________________________________________________________________
105 //____________________________________________________________________________________________________________
107 class StatusIndicator
: public UNO3_XLAYOUTCONSTRAINS
108 , public UNO3_XSTATUSINDICATOR
109 , public BaseContainerControl
112 //-------------------------------------------------------------------------------------------------------------
114 //-------------------------------------------------------------------------------------------------------------
118 //---------------------------------------------------------------------------------------------------------
119 // construct/destruct
120 //---------------------------------------------------------------------------------------------------------
122 /**_______________________________________________________________________________________________________
135 StatusIndicator( const UNO3_REFERENCE
< UNO3_XMULTISERVICEFACTORY
>& xFactory
);
137 /**_______________________________________________________________________________________________________
150 virtual ~StatusIndicator();
152 //---------------------------------------------------------------------------------------------------------
154 //---------------------------------------------------------------------------------------------------------
156 /**_______________________________________________________________________________________________________
157 @short give answer, if interface is supported
158 @descr The interfaces are searched by type.
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
182 @onerror A RuntimeException is thrown.
185 virtual void SAL_CALL
acquire() throw();
187 /**_______________________________________________________________________________________________________
188 @short decrement refcount
198 @onerror A RuntimeException is thrown.
201 virtual void SAL_CALL
release() throw();
203 //---------------------------------------------------------------------------------------------------------
205 //---------------------------------------------------------------------------------------------------------
207 /**_______________________________________________________________________________________________________
208 @short get information about supported interfaces
211 @seealso XTypeProvider
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 //---------------------------------------------------------------------------------------------------------
224 //---------------------------------------------------------------------------------------------------------
226 /**_______________________________________________________________________________________________________
239 virtual UNO3_ANY SAL_CALL
queryAggregation( const UNO3_TYPE
& aType
) throw( UNO3_RUNTIMEEXCEPTION
);
241 //---------------------------------------------------------------------------------------------------------
243 //---------------------------------------------------------------------------------------------------------
245 /*-****************************************************************************************************//**
256 *//*-*****************************************************************************************************/
258 virtual void SAL_CALL
start( const UNO3_OUSTRING
& sText
,
259 sal_Int32 nRange
) throw( UNO3_RUNTIMEEXCEPTION
);
261 /*-****************************************************************************************************//**
272 *//*-*****************************************************************************************************/
274 virtual void SAL_CALL
end() throw( UNO3_RUNTIMEEXCEPTION
);
276 /*-****************************************************************************************************//**
287 *//*-*****************************************************************************************************/
289 virtual void SAL_CALL
reset() throw( UNO3_RUNTIMEEXCEPTION
);
291 /*-****************************************************************************************************//**
302 *//*-*****************************************************************************************************/
304 virtual void SAL_CALL
setText( const UNO3_OUSTRING
& sText
) throw( UNO3_RUNTIMEEXCEPTION
);
306 /*-****************************************************************************************************//**
317 *//*-*****************************************************************************************************/
319 virtual void SAL_CALL
setValue( sal_Int32 nValue
) throw( UNO3_RUNTIMEEXCEPTION
);
321 //---------------------------------------------------------------------------------------------------------
323 //---------------------------------------------------------------------------------------------------------
325 /**_______________________________________________________________________________________________________
338 virtual UNO3_SIZE SAL_CALL
getMinimumSize() throw( UNO3_RUNTIMEEXCEPTION
);
340 /**_______________________________________________________________________________________________________
353 virtual UNO3_SIZE SAL_CALL
getPreferredSize() throw( UNO3_RUNTIMEEXCEPTION
);
355 /**_______________________________________________________________________________________________________
368 virtual UNO3_SIZE SAL_CALL
calcAdjustedSize( const UNO3_SIZE
& aNewSize
) throw( UNO3_RUNTIMEEXCEPTION
);
370 //---------------------------------------------------------------------------------------------------------
372 //---------------------------------------------------------------------------------------------------------
374 /**_______________________________________________________________________________________________________
387 virtual void SAL_CALL
createPeer( const UNO3_REFERENCE
< UNO3_XTOOLKIT
>& xToolkit
,
388 const UNO3_REFERENCE
< UNO3_XWINDOWPEER
>& xParent
) throw( UNO3_RUNTIMEEXCEPTION
);
390 /**_______________________________________________________________________________________________________
403 virtual sal_Bool SAL_CALL
setModel( const UNO3_REFERENCE
< UNO3_XCONTROLMODEL
>& xModel
) throw( UNO3_RUNTIMEEXCEPTION
);
405 /**_______________________________________________________________________________________________________
418 virtual UNO3_REFERENCE
< UNO3_XCONTROLMODEL
> SAL_CALL
getModel() throw( UNO3_RUNTIMEEXCEPTION
);
420 //---------------------------------------------------------------------------------------------------------
422 //---------------------------------------------------------------------------------------------------------
424 /**_______________________________________________________________________________________________________
437 virtual void SAL_CALL
dispose() throw( UNO3_RUNTIMEEXCEPTION
);
439 //---------------------------------------------------------------------------------------------------------
441 //---------------------------------------------------------------------------------------------------------
443 /**_______________________________________________________________________________________________________
456 virtual void SAL_CALL
setPosSize( sal_Int32 nX
,
460 sal_Int16 nFlags
) throw( UNO3_RUNTIMEEXCEPTION
);
462 //---------------------------------------------------------------------------------------------------------
464 //---------------------------------------------------------------------------------------------------------
466 /**_______________________________________________________________________________________________________
479 static const UNO3_SEQUENCE
< UNO3_OUSTRING
> impl_getStaticSupportedServiceNames();
481 /**_______________________________________________________________________________________________________
494 static const UNO3_OUSTRING
impl_getStaticImplementationName();
496 //____________________________________________________________________________________________________________
498 //____________________________________________________________________________________________________________
502 /**_______________________________________________________________________________________________________
515 virtual UNO3_WINDOWDESCRIPTOR
* impl_getWindowDescriptor( const UNO3_REFERENCE
< UNO3_XWINDOWPEER
>& xParentPeer
);
517 /**_______________________________________________________________________________________________________
530 virtual void impl_paint ( sal_Int32 nX
, sal_Int32 nY
, const UNO3_REFERENCE
< UNO3_XGRAPHICS
> & rGraphics
);
532 /**_______________________________________________________________________________________________________
545 virtual void impl_recalcLayout( const UNO3_WINDOWEVENT
& aEvent
);
547 //____________________________________________________________________________________________________________
549 //____________________________________________________________________________________________________________
553 /**_______________________________________________________________________________________________________
566 #if OSL_DEBUG_LEVEL > 1
570 //____________________________________________________________________________________________________________
572 //____________________________________________________________________________________________________________
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