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 .
22 #include <com/sun/star/awt/XLayoutConstrains.hpp>
23 #include <com/sun/star/task/XStatusIndicator.hpp>
24 #include <rtl/ref.hxx>
25 #include <tools/color.hxx>
26 #include <basecontainercontrol.hxx>
28 namespace com::sun::star::awt
{ class XControlModel
; }
29 namespace com::sun::star::awt
{ class XFixedText
; }
30 namespace com::sun::star::awt
{ class XGraphics
; }
31 namespace com::sun::star::awt
{ class XToolkit
; }
32 namespace com::sun::star::awt
{ class XWindowPeer
; }
34 namespace unocontrols
{
38 constexpr auto STATUSINDICATOR_FREEBORDER
= 5; // border around and between the controls
39 constexpr auto STATUSINDICATOR_DEFAULT_WIDTH
= 300;
40 constexpr auto STATUSINDICATOR_DEFAULT_HEIGHT
= 25;
41 constexpr sal_Int32 STATUSINDICATOR_BACKGROUNDCOLOR
= sal_Int32(COL_LIGHTGRAY
);
42 constexpr sal_Int32 STATUSINDICATOR_LINECOLOR_BRIGHT
= sal_Int32(COL_WHITE
);
43 constexpr sal_Int32 STATUSINDICATOR_LINECOLOR_SHADOW
= sal_Int32(COL_BLACK
);
45 class StatusIndicator final
: public css::awt::XLayoutConstrains
46 , public css::task::XStatusIndicator
47 , public BaseContainerControl
50 StatusIndicator( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
52 virtual ~StatusIndicator() override
;
57 @short give answer, if interface is supported
58 @descr The interfaces are searched by type.
62 @param "rType" is the type of searched interface.
64 @return Any information about found interface
66 @onerror A RuntimeException is thrown.
69 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& aType
) override
;
72 @short increment refcount
75 @onerror A RuntimeException is thrown.
78 virtual void SAL_CALL
acquire() noexcept override
;
81 @short decrement refcount
84 @onerror A RuntimeException is thrown.
87 virtual void SAL_CALL
release() noexcept override
;
92 @short get information about supported interfaces
93 @seealso XTypeProvider
94 @return Sequence of types of all supported interfaces
96 @onerror A RuntimeException is thrown.
99 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
103 virtual void SAL_CALL
start(
104 const OUString
& sText
,
108 virtual void SAL_CALL
end() override
;
110 virtual void SAL_CALL
reset() override
;
112 virtual void SAL_CALL
setText( const OUString
& sText
) override
;
114 virtual void SAL_CALL
setValue( sal_Int32 nValue
) override
;
118 virtual css::awt::Size SAL_CALL
getMinimumSize() override
;
120 virtual css::awt::Size SAL_CALL
getPreferredSize() override
;
122 virtual css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
126 virtual void SAL_CALL
createPeer(
127 const css::uno::Reference
< css::awt::XToolkit
>& xToolkit
,
128 const css::uno::Reference
< css::awt::XWindowPeer
>& xParent
131 virtual sal_Bool SAL_CALL
setModel( const css::uno::Reference
< css::awt::XControlModel
>& xModel
) override
;
133 virtual css::uno::Reference
< css::awt::XControlModel
> SAL_CALL
getModel() override
;
137 virtual void SAL_CALL
dispose() override
;
141 virtual void SAL_CALL
setPosSize( sal_Int32 nX
,
145 sal_Int16 nFlags
) override
;
148 virtual css::awt::WindowDescriptor
impl_getWindowDescriptor(
149 const css::uno::Reference
< css::awt::XWindowPeer
>& xParentPeer
152 virtual void impl_paint (
155 const css::uno::Reference
< css::awt::XGraphics
> & rGraphics
158 virtual void impl_recalcLayout( const css::awt::WindowEvent
& aEvent
) override
;
160 css::uno::Reference
< css::awt::XFixedText
> m_xText
;
161 rtl::Reference
<ProgressBar
> m_xProgressBar
;
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */