tdf#120787: fine-tune window flags w/ focus on floating toolbars
[LibreOffice.git] / framework / inc / uielement / progressbarwrapper.hxx
blobd2e9a3dca5efdc98319813fa862ec6df5f988964
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_FRAMEWORK_INC_UIELEMENT_PROGRESSBARWRAPPER_HXX
21 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_PROGRESSBARWRAPPER_HXX
23 #include <helper/uielementwrapperbase.hxx>
25 #include <com/sun/star/task/XStatusIndicator.hpp>
26 #include <com/sun/star/awt/XWindow.hpp>
28 #include <cppuhelper/weak.hxx>
29 #include <cppuhelper/weakref.hxx>
31 namespace framework{
33 class ProgressBarWrapper : public UIElementWrapperBase
35 public:
37 // constructor / destructor
39 ProgressBarWrapper();
40 virtual ~ProgressBarWrapper() override;
42 // public interfaces
43 void setStatusBar( const css::uno::Reference< css::awt::XWindow >& rStatusBar, bool bOwnsInstance = false );
44 css::uno::Reference< css::awt::XWindow > getStatusBar() const;
46 // wrapped methods of css::task::XStatusIndicator
47 /// @throws css::uno::RuntimeException
48 void start( const OUString& Text, ::sal_Int32 Range );
49 /// @throws css::uno::RuntimeException
50 void end();
51 /// @throws css::uno::RuntimeException
52 void setText( const OUString& Text );
53 /// @throws css::uno::RuntimeException
54 void setValue( ::sal_Int32 Value );
55 /// @throws css::uno::RuntimeException
56 void reset();
58 // UNO interfaces
59 // XComponent
60 virtual void SAL_CALL dispose() override;
62 // XInitialization
63 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
65 // XUpdatable
66 virtual void SAL_CALL update() override;
68 // XUIElement
69 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getRealInterface() override;
71 // variables
72 // (should be private everyway!)
74 private:
75 css::uno::Reference< css::awt::XWindow > m_xStatusBar; // Reference to our status bar XWindow
76 css::uno::WeakReference< css::uno::XInterface > m_xProgressBarIfacWrapper;
77 bool m_bOwnsInstance; // Indicator that we are owner of the XWindow
78 sal_Int32 m_nRange;
79 sal_Int32 m_nValue;
80 OUString m_aText;
81 }; // class ProgressBarWrapper
83 } // namespace framework
85 #endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_PROGRESSBARWRAPPER_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */