bump product version to 6.3.0.0.beta1
[LibreOffice.git] / UnoControls / source / inc / statusindicator.hxx
blobabd50d94d0edca77ad22e8f25f5726fc416d3bb6
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 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 {
37 class ProgressBar;
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
54 public:
55 StatusIndicator( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
57 virtual ~StatusIndicator() override;
59 // XInterface
61 /**
62 @short give answer, if interface is supported
63 @descr The interfaces are searched by type.
65 @seealso XInterface
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;
76 /**
77 @short increment refcount
78 @seealso XInterface
79 @seealso release()
80 @onerror A RuntimeException is thrown.
83 virtual void SAL_CALL acquire() throw() override;
85 /**
86 @short decrement refcount
87 @seealso XInterface
88 @seealso acquire()
89 @onerror A RuntimeException is thrown.
92 virtual void SAL_CALL release() throw() override;
94 // XTypeProvider
96 /**
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;
106 // XAggregation
108 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override;
110 // XStatusIndicator
112 virtual void SAL_CALL start(
113 const OUString& sText ,
114 sal_Int32 nRange
115 ) override;
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;
125 // XLayoutConstrains
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;
133 // XControl
135 virtual void SAL_CALL createPeer(
136 const css::uno::Reference< css::awt::XToolkit >& xToolkit ,
137 const css::uno::Reference< css::awt::XWindowPeer >& xParent
138 ) override;
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;
144 // XComponent
146 virtual void SAL_CALL dispose() override;
148 // XWindow
150 virtual void SAL_CALL setPosSize( sal_Int32 nX ,
151 sal_Int32 nY ,
152 sal_Int32 nWidth ,
153 sal_Int32 nHeight ,
154 sal_Int16 nFlags ) override;
156 // BaseControl
158 static const css::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
160 static const OUString impl_getStaticImplementationName();
162 protected:
163 virtual css::awt::WindowDescriptor impl_getWindowDescriptor(
164 const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer
165 ) override;
167 virtual void impl_paint (
168 sal_Int32 nX,
169 sal_Int32 nY,
170 const css::uno::Reference< css::awt::XGraphics > & rGraphics
171 ) override;
173 virtual void impl_recalcLayout( const css::awt::WindowEvent& aEvent ) override;
175 private:
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: */