bump product version to 5.0.4.1
[LibreOffice.git] / UnoControls / source / inc / progressbar.hxx
blob2b1dee2de696e1d902f537b4b72f4ecc358273fa
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_PROGRESSBAR_HXX
21 #define INCLUDED_UNOCONTROLS_SOURCE_INC_PROGRESSBAR_HXX
23 #include <com/sun/star/lang/XServiceName.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <vcl/vclptr.hxx>
28 #include "basecontrol.hxx"
30 // namespaces
32 namespace unocontrols{
34 #define PROGRESSBAR_FREESPACE 4
35 #define PROGRESSBAR_DEFAULT_HORIZONTAL true
36 #define PROGRESSBAR_DEFAULT_BLOCKDIMENSION Size(1,1)
37 #define PROGRESSBAR_DEFAULT_BACKGROUNDCOLOR TRGB_COLORDATA( 0x00, 0xC0, 0xC0, 0xC0 ) // lightgray
38 #define PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR TRGB_COLORDATA( 0x00, 0x00, 0x00, 0x80 ) // blue
39 #define PROGRESSBAR_DEFAULT_MINRANGE INT_MIN
40 #define PROGRESSBAR_DEFAULT_MAXRANGE INT_MAX
41 #define PROGRESSBAR_DEFAULT_BLOCKVALUE 1
42 #define PROGRESSBAR_DEFAULT_VALUE PROGRESSBAR_DEFAULT_MINRANGE
43 #define PROGRESSBAR_LINECOLOR_BRIGHT TRGB_COLORDATA( 0x00, 0xFF, 0xFF, 0xFF ) // white
44 #define PROGRESSBAR_LINECOLOR_SHADOW TRGB_COLORDATA( 0x00, 0x00, 0x00, 0x00 ) // black
46 class ProgressBar : public ::com::sun::star::awt::XControlModel
47 , public ::com::sun::star::awt::XProgressBar
48 , public BaseControl
51 // public methods
53 public:
55 // construct/destruct
57 /**_________________________________________________________________________________________________________
58 @short
59 @descr
61 @seealso
63 @param
65 @return
67 @onerror
70 ProgressBar( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
72 /**_________________________________________________________________________________________________________
73 @short
74 @descr
76 @seealso
78 @param
80 @return
82 @onerror
85 virtual ~ProgressBar();
87 // XInterface
89 /**_________________________________________________________________________________________________________
90 @short
91 @descr
93 @seealso
95 @param
97 @return
99 @onerror
102 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
103 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
105 /**_______________________________________________________________________________________________________
106 @short increment refcount
107 @seealso XInterface
108 @seealso release()
109 @onerror A RuntimeException is thrown.
112 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
114 /**_______________________________________________________________________________________________________
115 @short decrement refcount
116 @seealso XInterface
117 @seealso acquire()
118 @onerror A RuntimeException is thrown.
121 virtual void SAL_CALL release() throw() SAL_OVERRIDE;
123 // XTypeProvider
125 /**_________________________________________________________________________________________________________
126 @short
127 @descr
129 @seealso
131 @param
133 @return
135 @onerror
138 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
139 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
141 // XAggregation
143 /**_________________________________________________________________________________________________________
144 @short
145 @descr
147 @seealso
149 @param
151 @return
153 @onerror
156 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType )
157 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
159 // XProgressBar
161 /**_________________________________________________________________________________________________________
162 @short
163 @descr
165 @seealso
167 @param
169 @return
171 @onerror
174 virtual void SAL_CALL setForegroundColor( sal_Int32 nColor )
175 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
177 /**_________________________________________________________________________________________________________
178 @short
179 @descr
181 @seealso
183 @param
185 @return
187 @onerror
190 virtual void SAL_CALL setBackgroundColor( sal_Int32 nColor )
191 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
193 /**_________________________________________________________________________________________________________
194 @short
195 @descr
197 @seealso
199 @param
201 @return
203 @onerror
206 virtual void SAL_CALL setValue( sal_Int32 nValue ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
208 /**_________________________________________________________________________________________________________
209 @short
210 @descr
212 @seealso
214 @param
216 @return
218 @onerror
221 virtual void SAL_CALL setRange(
222 sal_Int32 nMin ,
223 sal_Int32 nMax
224 ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
226 /**_________________________________________________________________________________________________________
227 @short
228 @descr
230 @seealso
232 @param
234 @return
236 @onerror
239 virtual sal_Int32 SAL_CALL getValue() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
241 // XWindow
243 /**_________________________________________________________________________________________________________
244 @short
245 @descr
247 @seealso
249 @param
251 @return
253 @onerror
256 virtual void SAL_CALL setPosSize(
257 sal_Int32 nX ,
258 sal_Int32 nY ,
259 sal_Int32 nWidth ,
260 sal_Int32 nHeight ,
261 sal_Int16 nFlags
262 ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
264 // XControl
266 /**_________________________________________________________________________________________________________
267 @short
268 @descr
270 @seealso
272 @param
274 @return
276 @onerror
279 virtual sal_Bool SAL_CALL setModel(
280 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel
281 ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
283 /**_________________________________________________________________________________________________________
284 @short
285 @descr
287 @seealso
289 @param
291 @return
293 @onerror
296 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
297 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
299 // BaseControl
301 /**_________________________________________________________________________________________________________
302 @short
303 @descr
305 @seealso
307 @param
309 @return
311 @onerror
314 static const ::com::sun::star::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
316 /**_________________________________________________________________________________________________________
317 @short
318 @descr
320 @seealso
322 @param
324 @return
326 @onerror
329 static const OUString impl_getStaticImplementationName();
331 // protected methods
333 protected:
335 /**_________________________________________________________________________________________________________
336 @short
337 @descr
339 @seealso
341 @param
343 @return
345 @onerror
348 virtual void impl_paint(
349 sal_Int32 nX ,
350 sal_Int32 nY ,
351 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics
352 ) SAL_OVERRIDE;
354 /**_________________________________________________________________________________________________________
355 @short
356 @descr
358 @seealso
360 @param
362 @return
364 @onerror
367 void impl_recalcRange();
369 // private variables
371 private:
373 bool m_bHorizontal; // orientation for steps [true=horizontal/false=vertikal]
374 ::com::sun::star::awt::Size m_aBlockSize; // width and height of a block [>=0,0]
375 sal_Int32 m_nForegroundColor; // (alpha,r,g,b)
376 sal_Int32 m_nBackgroundColor; // (alpha,r,g,b)
377 sal_Int32 m_nMinRange; // lowest value = 0% [long, <_nMaxRange]
378 sal_Int32 m_nMaxRange; // highest value = 100% [long, >_nMinRange]
379 double m_nBlockValue; // value for one block [long, >0]
380 sal_Int32 m_nValue; // value for progress [long]
382 }; // class ProgressBar
384 } // namespace unocontrols
386 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_PROGRESSBAR_HXX
388 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */