update credits
[LibreOffice.git] / framework / inc / helper / statusindicator.hxx
blob1f99c8e56ddbf8f689796126c83ee37a84d2e477
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 __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_
21 #define __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_
23 //_______________________________________________
24 // include files of own module
26 #include <helper/statusindicatorfactory.hxx>
27 #include <threadhelp/threadhelpbase.hxx>
28 #include <macros/xinterface.hxx>
29 #include <macros/xtypeprovider.hxx>
30 #include <macros/debug.hxx>
31 #include <macros/generic.hxx>
33 //_______________________________________________
34 // include UNO interfaces
35 #include <com/sun/star/task/XStatusIndicator.hpp>
37 //_______________________________________________
38 // include all others
39 #include <cppuhelper/weak.hxx>
40 #include <cppuhelper/weakref.hxx>
43 namespace framework{
46 //_______________________________________________
47 /**
48 @short implement a status indicator object
50 @descr With this indicator you can show a message and a progress ...
51 but you share the output device with other indicator objects,
52 if this instances was created by the same factory.
53 Then the last created object has full access to device.
54 All others change her internal data structure only.
56 All objects of this StatusIndicator class calls a c++ interface
57 on the StatusIndicatorFactory (where they was created).
58 The factory holds all data structures and paints the progress.
60 @devstatus ready to use
61 @threadsafe yes
63 class StatusIndicator : public css::lang::XTypeProvider
64 , public css::task::XStatusIndicator
65 , private ThreadHelpBase // Order of baseclasses is necessary for right initializaton!
66 , public ::cppu::OWeakObject // => XInterface
68 //-------------------------------------------
69 // member
70 private:
72 /** @short weak reference to our factory
73 @descr All our interface calls will be forwarded
74 to a suitable c++ interface on this factory.
75 But we dont hold our factory alive. They
76 correspond with e.g. with a Frame service and
77 will be owned by him. If the frame will be closed
78 he close our factory too ...
80 css::uno::WeakReference< css::task::XStatusIndicatorFactory > m_xFactory;
82 //-------------------------------------------
83 // c++ interface
84 public:
86 //----------------------------------------
87 /** @short initialize new instance of this class.
89 @param pFactory
90 pointer to our factory
92 StatusIndicator(StatusIndicatorFactory* pFactory);
94 //----------------------------------------
95 /** @short does nothing real ....
97 virtual ~StatusIndicator();
99 //-------------------------------------------
100 // uno interface
101 public:
103 //---------------------------------------
104 // XInterface, XTypeProvider
105 FWK_DECLARE_XINTERFACE
106 FWK_DECLARE_XTYPEPROVIDER
108 //---------------------------------------
109 // XStatusIndicator
110 virtual void SAL_CALL start(const OUString& sText ,
111 sal_Int32 nRange)
112 throw(css::uno::RuntimeException);
114 virtual void SAL_CALL end()
115 throw(css::uno::RuntimeException);
117 virtual void SAL_CALL reset()
118 throw(css::uno::RuntimeException);
120 virtual void SAL_CALL setText(const OUString& sText)
121 throw(css::uno::RuntimeException);
123 virtual void SAL_CALL setValue(sal_Int32 nValue)
124 throw(css::uno::RuntimeException);
126 }; // class StatusIndicator
128 } // namespace framework
130 #endif // __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */