1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: statusindicator.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_
32 #define __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_
34 //_______________________________________________
35 // include files of own module
37 #include <helper/statusindicatorfactory.hxx>
38 #include <threadhelp/threadhelpbase.hxx>
39 #include <macros/xinterface.hxx>
40 #include <macros/xtypeprovider.hxx>
41 #include <macros/debug.hxx>
42 #include <macros/generic.hxx>
44 //_______________________________________________
45 // include UNO interfaces
46 #include <com/sun/star/task/XStatusIndicator.hpp>
48 //_______________________________________________
50 #include <cppuhelper/weak.hxx>
51 #include <cppuhelper/weakref.hxx>
53 //_______________________________________________
58 //_______________________________________________
61 //_______________________________________________
63 @short implement a status indicator object
65 @descr With this indicator you can show a message and a progress ...
66 but you share the output device with other indicator objects,
67 if this instances was created by the same factory.
68 Then the last created object has full access to device.
69 All others change her internal data structure only.
71 All objects of this StatusIndicator class calls a c++ interface
72 on the StatusIndicatorFactory (where they was created).
73 The factory holds all data structures and paints the progress.
75 @devstatus ready to use
78 class StatusIndicator
: public css::lang::XTypeProvider
79 , public css::task::XStatusIndicator
80 , private ThreadHelpBase
// Order of baseclasses is neccessary for right initializaton!
81 , public ::cppu::OWeakObject
// => XInterface
83 //-------------------------------------------
87 /** @short weak reference to our factory
88 @descr All our interface calls will be forwarded
89 to a suitable c++ interface on this factory.
90 But we dont hold our factory alive. They
91 correspond with e.g. with a Frame service and
92 will be owned by him. If the frame will be closed
93 he close our factory too ...
95 css::uno::WeakReference
< css::task::XStatusIndicatorFactory
> m_xFactory
;
97 //-------------------------------------------
101 //----------------------------------------
102 /** @short initialize new instance of this class.
105 pointer to our factory
107 StatusIndicator(StatusIndicatorFactory
* pFactory
);
109 //----------------------------------------
110 /** @short does nothing real ....
112 virtual ~StatusIndicator();
114 //-------------------------------------------
118 //---------------------------------------
119 // XInterface, XTypeProvider
120 FWK_DECLARE_XINTERFACE
121 FWK_DECLARE_XTYPEPROVIDER
123 //---------------------------------------
125 virtual void SAL_CALL
start(const ::rtl::OUString
& sText
,
127 throw(css::uno::RuntimeException
);
129 virtual void SAL_CALL
end()
130 throw(css::uno::RuntimeException
);
132 virtual void SAL_CALL
reset()
133 throw(css::uno::RuntimeException
);
135 virtual void SAL_CALL
setText(const ::rtl::OUString
& sText
)
136 throw(css::uno::RuntimeException
);
138 virtual void SAL_CALL
setValue(sal_Int32 nValue
)
139 throw(css::uno::RuntimeException
);
141 }; // class StatusIndicator
143 } // namespace framework
145 #endif // __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_