bump product version to 4.1.6.2
[LibreOffice.git] / UnoControls / source / inc / progressbar.hxx
blob1c8d89255512317d80968dcb399cf3291c70296f
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 _UNOCONTROLS_PROGRESSBAR_CTRL_HXX
21 #define _UNOCONTROLS_PROGRESSBAR_CTRL_HXX
23 #include <com/sun/star/lang/XServiceName.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include "basecontrol.hxx"
28 //____________________________________________________________________________________________________________
29 // namespaces
30 //____________________________________________________________________________________________________________
32 namespace unocontrols{
34 #define SERVICENAME_PROGRESSBAR "com.sun.star.awt.XProgressBar"
35 #define IMPLEMENTATIONNAME_PROGRESSBAR "stardiv.UnoControls.ProgressBar"
36 #define PROGRESSBAR_FREESPACE 4
37 #define PROGRESSBAR_DEFAULT_HORIZONTAL sal_True
38 #define PROGRESSBAR_DEFAULT_BLOCKDIMENSION Size(1,1)
39 #define PROGRESSBAR_DEFAULT_BACKGROUNDCOLOR TRGB_COLORDATA( 0x00, 0xC0, 0xC0, 0xC0 ) // lightgray
40 #define PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR TRGB_COLORDATA( 0x00, 0x00, 0x00, 0x80 ) // blue
41 #define PROGRESSBAR_DEFAULT_MINRANGE INT_MIN
42 #define PROGRESSBAR_DEFAULT_MAXRANGE INT_MAX
43 #define PROGRESSBAR_DEFAULT_BLOCKVALUE 1
44 #define PROGRESSBAR_DEFAULT_VALUE PROGRESSBAR_DEFAULT_MINRANGE
45 #define PROGRESSBAR_LINECOLOR_BRIGHT TRGB_COLORDATA( 0x00, 0xFF, 0xFF, 0xFF ) // white
46 #define PROGRESSBAR_LINECOLOR_SHADOW TRGB_COLORDATA( 0x00, 0x00, 0x00, 0x00 ) // black
48 class ProgressBar : public ::com::sun::star::awt::XControlModel
49 , public ::com::sun::star::awt::XProgressBar
50 , public BaseControl
53 //____________________________________________________________________________________________________________
54 // public methods
55 //____________________________________________________________________________________________________________
57 public:
59 //________________________________________________________________________________________________________
60 // construct/destruct
61 //________________________________________________________________________________________________________
63 /**_________________________________________________________________________________________________________
64 @short
65 @descr
67 @seealso
69 @param
71 @return
73 @onerror
76 ProgressBar( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
78 /**_________________________________________________________________________________________________________
79 @short
80 @descr
82 @seealso
84 @param
86 @return
88 @onerror
91 virtual ~ProgressBar();
93 //__________________________________________________________________________________________________________
94 // XInterface
95 //__________________________________________________________________________________________________________
97 /**_________________________________________________________________________________________________________
98 @short
99 @descr
101 @seealso
103 @param
105 @return
107 @onerror
110 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
111 throw( ::com::sun::star::uno::RuntimeException );
113 /**_______________________________________________________________________________________________________
114 @short increment refcount
115 @descr -
117 @seealso XInterface
118 @seealso release()
120 @param -
122 @return -
124 @onerror A RuntimeException is thrown.
127 virtual void SAL_CALL acquire() throw();
129 /**_______________________________________________________________________________________________________
130 @short decrement refcount
131 @descr -
133 @seealso XInterface
134 @seealso acquire()
136 @param -
138 @return -
140 @onerror A RuntimeException is thrown.
143 virtual void SAL_CALL release() throw();
145 //__________________________________________________________________________________________________________
146 // XTypeProvider
147 //__________________________________________________________________________________________________________
149 /**_________________________________________________________________________________________________________
150 @short
151 @descr
153 @seealso
155 @param
157 @return
159 @onerror
162 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
163 throw( ::com::sun::star::uno::RuntimeException );
165 //__________________________________________________________________________________________________________
166 // XAggregation
167 //__________________________________________________________________________________________________________
169 /**_________________________________________________________________________________________________________
170 @short
171 @descr
173 @seealso
175 @param
177 @return
179 @onerror
182 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType )
183 throw( ::com::sun::star::uno::RuntimeException );
185 //________________________________________________________________________________________________________
186 // XProgressBar
187 //________________________________________________________________________________________________________
189 /**_________________________________________________________________________________________________________
190 @short
191 @descr
193 @seealso
195 @param
197 @return
199 @onerror
202 virtual void SAL_CALL setForegroundColor( sal_Int32 nColor )
203 throw( ::com::sun::star::uno::RuntimeException );
205 /**_________________________________________________________________________________________________________
206 @short
207 @descr
209 @seealso
211 @param
213 @return
215 @onerror
218 virtual void SAL_CALL setBackgroundColor( sal_Int32 nColor )
219 throw( ::com::sun::star::uno::RuntimeException );
221 /**_________________________________________________________________________________________________________
222 @short
223 @descr
225 @seealso
227 @param
229 @return
231 @onerror
234 virtual void SAL_CALL setValue( sal_Int32 nValue ) throw( ::com::sun::star::uno::RuntimeException );
236 /**_________________________________________________________________________________________________________
237 @short
238 @descr
240 @seealso
242 @param
244 @return
246 @onerror
249 virtual void SAL_CALL setRange(
250 sal_Int32 nMin ,
251 sal_Int32 nMax
252 ) throw( ::com::sun::star::uno::RuntimeException );
254 /**_________________________________________________________________________________________________________
255 @short
256 @descr
258 @seealso
260 @param
262 @return
264 @onerror
267 virtual sal_Int32 SAL_CALL getValue() throw( ::com::sun::star::uno::RuntimeException );
269 //__________________________________________________________________________________________________________
270 // XWindow
271 //__________________________________________________________________________________________________________
273 /**_________________________________________________________________________________________________________
274 @short
275 @descr
277 @seealso
279 @param
281 @return
283 @onerror
286 virtual void SAL_CALL setPosSize(
287 sal_Int32 nX ,
288 sal_Int32 nY ,
289 sal_Int32 nWidth ,
290 sal_Int32 nHeight ,
291 sal_Int16 nFlags
292 ) throw( ::com::sun::star::uno::RuntimeException );
294 //__________________________________________________________________________________________________________
295 // XControl
296 //__________________________________________________________________________________________________________
298 /**_________________________________________________________________________________________________________
299 @short
300 @descr
302 @seealso
304 @param
306 @return
308 @onerror
311 virtual sal_Bool SAL_CALL setModel(
312 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel
313 ) throw( ::com::sun::star::uno::RuntimeException );
315 /**_________________________________________________________________________________________________________
316 @short
317 @descr
319 @seealso
321 @param
323 @return
325 @onerror
328 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
329 throw( ::com::sun::star::uno::RuntimeException );
331 //__________________________________________________________________________________________________________
332 // BaseControl
333 //__________________________________________________________________________________________________________
335 /**_________________________________________________________________________________________________________
336 @short
337 @descr
339 @seealso
341 @param
343 @return
345 @onerror
348 static const ::com::sun::star::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
350 /**_________________________________________________________________________________________________________
351 @short
352 @descr
354 @seealso
356 @param
358 @return
360 @onerror
363 static const OUString impl_getStaticImplementationName();
365 //____________________________________________________________________________________________________________
366 // protected methods
367 //____________________________________________________________________________________________________________
369 protected:
371 /**_________________________________________________________________________________________________________
372 @short
373 @descr
375 @seealso
377 @param
379 @return
381 @onerror
384 virtual void impl_paint(
385 sal_Int32 nX ,
386 sal_Int32 nY ,
387 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics
390 /**_________________________________________________________________________________________________________
391 @short
392 @descr
394 @seealso
396 @param
398 @return
400 @onerror
403 void impl_recalcRange();
405 //____________________________________________________________________________________________________________
406 // private variables
407 //____________________________________________________________________________________________________________
409 private:
411 sal_Bool m_bHorizontal ; // orientation for steps [true=horizontal/false=vertikal]
412 ::com::sun::star::awt::Size m_aBlockSize ; // width and height of a block [>=0,0]
413 sal_Int32 m_nForegroundColor ; // (alpha,r,g,b)
414 sal_Int32 m_nBackgroundColor ; // (alpha,r,g,b)
415 sal_Int32 m_nMinRange ; // lowest value = 0% [long, <_nMaxRange]
416 sal_Int32 m_nMaxRange ; // highest value = 100% [long, >_nMinRange]
417 double m_nBlockValue ; // value for one block [long, >0]
418 sal_Int32 m_nValue ; // value for progress [long]
420 }; // class ProgressBar
422 } // namespace unocontrols
424 #endif // #ifndef _UNOCONTROLS_PROGRESSBAR_CTRL_HXX
426 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */