1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_FRAMEWORK_INC_HELPER_STATUSINDICATOR_HXX
21 #define INCLUDED_FRAMEWORK_INC_HELPER_STATUSINDICATOR_HXX
23 // include files of own module
25 #include <helper/statusindicatorfactory.hxx>
26 #include <macros/xinterface.hxx>
27 #include <macros/xtypeprovider.hxx>
28 #include <macros/generic.hxx>
30 // include UNO interfaces
31 #include <com/sun/star/task/XStatusIndicator.hpp>
34 #include <cppuhelper/implbase1.hxx>
35 #include <cppuhelper/weakref.hxx>
40 @short implement a status indicator object
42 @descr With this indicator you can show a message and a progress ...
43 but you share the output device with other indicator objects,
44 if this instances was created by the same factory.
45 Then the last created object has full access to device.
46 All others change her internal data structure only.
48 All objects of this StatusIndicator class calls a c++ interface
49 on the StatusIndicatorFactory (where they was created).
50 The factory holds all data structures and paints the progress.
52 @devstatus ready to use
55 class StatusIndicator
: public ::cppu::WeakImplHelper1
< css::task::XStatusIndicator
>
61 /** @short weak reference to our factory
62 @descr All our interface calls will be forwarded
63 to a suitable c++ interface on this factory.
64 But we dont hold our factory alive. They
65 correspond with e.g. with a Frame service and
66 will be owned by him. If the frame will be closed
67 he close our factory too ...
69 css::uno::WeakReference
< css::task::XStatusIndicatorFactory
> m_xFactory
;
72 // We want the callback percentages to increase monotonically
73 int m_nLastCallbackPercent
;
78 /** @short initialize new instance of this class.
81 pointer to our factory
83 StatusIndicator(StatusIndicatorFactory
* pFactory
);
85 /** @short does nothing real ....
87 virtual ~StatusIndicator();
93 virtual void SAL_CALL
start(const OUString
& sText
,
95 throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 virtual void SAL_CALL
end()
98 throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual void SAL_CALL
reset()
101 throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
103 virtual void SAL_CALL
setText(const OUString
& sText
)
104 throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
106 virtual void SAL_CALL
setValue(sal_Int32 nValue
)
107 throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 }; // class StatusIndicator
111 } // namespace framework
113 #endif // INCLUDED_FRAMEWORK_INC_HELPER_STATUSINDICATOR_HXX
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */