1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/XLayoutConstrains.hpp>
24 #include <com/sun/star/task/XStatusIndicator.hpp>
25 #include <rtl/ref.hxx>
27 #include <basecontainercontrol.hxx>
29 namespace com::sun::star::awt
{ class XControlModel
; }
30 namespace com::sun::star::awt
{ class XFixedText
; }
31 namespace com::sun::star::awt
{ class XGraphics
; }
32 namespace com::sun::star::awt
{ class XToolkit
; }
33 namespace com::sun::star::awt
{ class XWindowPeer
; }
35 namespace unocontrols
{
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_BACKGROUNDCOLOR sal_Int32(Color( 0x00, 0xC0, 0xC0, 0xC0 )) // lightgray
45 #define STATUSINDICATOR_LINECOLOR_BRIGHT sal_Int32(Color( 0x00, 0xFF, 0xFF, 0xFF )) // white
46 #define STATUSINDICATOR_LINECOLOR_SHADOW sal_Int32(Color( 0x00, 0x00, 0x00, 0x00 )) // black
47 #define STATUSINDICATOR_DEFAULT_WIDTH 300
48 #define STATUSINDICATOR_DEFAULT_HEIGHT 25
50 class StatusIndicator
: public css::awt::XLayoutConstrains
51 , public css::task::XStatusIndicator
52 , public BaseContainerControl
55 StatusIndicator( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
57 virtual ~StatusIndicator() override
;
62 @short give answer, if interface is supported
63 @descr The interfaces are searched by type.
67 @param "rType" is the type of searched interface.
69 @return Any information about found interface
71 @onerror A RuntimeException is thrown.
74 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& aType
) override
;
77 @short increment refcount
80 @onerror A RuntimeException is thrown.
83 virtual void SAL_CALL
acquire() throw() override
;
86 @short decrement refcount
89 @onerror A RuntimeException is thrown.
92 virtual void SAL_CALL
release() throw() override
;
97 @short get information about supported interfaces
98 @seealso XTypeProvider
99 @return Sequence of types of all supported interfaces
101 @onerror A RuntimeException is thrown.
104 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
108 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& aType
) override
;
112 virtual void SAL_CALL
start(
113 const OUString
& sText
,
117 virtual void SAL_CALL
end() override
;
119 virtual void SAL_CALL
reset() override
;
121 virtual void SAL_CALL
setText( const OUString
& sText
) override
;
123 virtual void SAL_CALL
setValue( sal_Int32 nValue
) override
;
127 virtual css::awt::Size SAL_CALL
getMinimumSize() override
;
129 virtual css::awt::Size SAL_CALL
getPreferredSize() override
;
131 virtual css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
135 virtual void SAL_CALL
createPeer(
136 const css::uno::Reference
< css::awt::XToolkit
>& xToolkit
,
137 const css::uno::Reference
< css::awt::XWindowPeer
>& xParent
140 virtual sal_Bool SAL_CALL
setModel( const css::uno::Reference
< css::awt::XControlModel
>& xModel
) override
;
142 virtual css::uno::Reference
< css::awt::XControlModel
> SAL_CALL
getModel() override
;
146 virtual void SAL_CALL
dispose() override
;
150 virtual void SAL_CALL
setPosSize( sal_Int32 nX
,
154 sal_Int16 nFlags
) override
;
158 static const css::uno::Sequence
< OUString
> impl_getStaticSupportedServiceNames();
160 static const OUString
impl_getStaticImplementationName();
163 virtual css::awt::WindowDescriptor
impl_getWindowDescriptor(
164 const css::uno::Reference
< css::awt::XWindowPeer
>& xParentPeer
167 virtual void impl_paint (
170 const css::uno::Reference
< css::awt::XGraphics
> & rGraphics
173 virtual void impl_recalcLayout( const css::awt::WindowEvent
& aEvent
) override
;
176 css::uno::Reference
< css::awt::XFixedText
> m_xText
;
177 rtl::Reference
<ProgressBar
> m_xProgressBar
;
183 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_STATUSINDICATOR_HXX
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */