Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / controller / main / StatusBarCommandDispatch.hxx
blob6c3734154ecf6353d4470a76b5b9d7921ededae2
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_STATUSBARCOMMANDDISPATCH_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_STATUSBARCOMMANDDISPATCH_HXX
22 #include "CommandDispatch.hxx"
23 #include <ObjectIdentifier.hxx>
24 #include <cppuhelper/implbase.hxx>
25 #include <com/sun/star/view/XSelectionChangeListener.hpp>
27 namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } }
28 namespace com { namespace sun { namespace star { namespace util { class XModifiable; } } } }
29 namespace com { namespace sun { namespace star { namespace view { class XSelectionSupplier; } } } }
31 namespace chart
34 /** This is a CommandDispatch implementation for all commands the status bar offers
36 This class reads the information needed from the XModel passed here.
39 namespace impl
41 typedef ::cppu::ImplInheritanceHelper<
42 CommandDispatch,
43 css::view::XSelectionChangeListener >
44 StatusBarCommandDispatch_Base;
47 class StatusBarCommandDispatch : public impl::StatusBarCommandDispatch_Base
49 public:
50 explicit StatusBarCommandDispatch(
51 const css::uno::Reference< css::uno::XComponentContext > & xContext,
52 const css::uno::Reference< css::frame::XModel > & xModel,
53 const css::uno::Reference< css::view::XSelectionSupplier > & xSelSupp );
54 virtual ~StatusBarCommandDispatch() override;
56 // late initialisation, especially for adding as listener
57 virtual void initialize() override;
59 protected:
60 // ____ XDispatch ____
61 virtual void SAL_CALL dispatch(
62 const css::util::URL& URL,
63 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
65 // ____ WeakComponentImplHelperBase ____
66 /// is called when this is disposed
67 virtual void SAL_CALL disposing() override;
69 // ____ XModifyListener (override from CommandDispatch) ____
70 virtual void SAL_CALL modified(
71 const css::lang::EventObject& aEvent ) override;
73 // ____ XEventListener (base of XModifyListener) ____
74 virtual void SAL_CALL disposing(
75 const css::lang::EventObject& Source ) override;
77 virtual void fireStatusEvent(
78 const OUString & rURL,
79 const css::uno::Reference< css::frame::XStatusListener > & xSingleListener ) override;
81 // ____ XSelectionChangeListener ____
82 virtual void SAL_CALL selectionChanged(
83 const css::lang::EventObject& aEvent ) override;
85 private:
86 css::uno::Reference< css::util::XModifiable > m_xModifiable;
87 css::uno::Reference< css::view::XSelectionSupplier > m_xSelectionSupplier;
88 bool m_bIsModified;
89 ObjectIdentifier m_aSelectedOID;
92 } // namespace chart
94 // INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_STATUSBARCOMMANDDISPATCH_HXX
95 #endif
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */