merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / controller / main / StatusBarCommandDispatch.hxx
blobf493faa6270bdd62baa33dfff5db25b3a243315c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: StatusBarCommandDispatch.hxx,v $
10 * $Revision: 1.3 $
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 ************************************************************************/
30 #ifndef CHART2_STATUSBARCOMMANDDISPATCH_HXX
31 #define CHART2_STATUSBARCOMMANDDISPATCH_HXX
33 #include "CommandDispatch.hxx"
34 #include <cppuhelper/implbase1.hxx>
35 #include <com/sun/star/frame/XModel.hpp>
36 #include <com/sun/star/view/XSelectionSupplier.hpp>
37 #include <com/sun/star/util/XModifiable.hpp>
39 namespace chart
42 /** This is a CommandDispatch implementation for all commands the status bar offers
44 This class reads the information needed from the XModel passed here.
47 namespace impl
49 typedef ::cppu::ImplInheritanceHelper1<
50 CommandDispatch,
51 ::com::sun::star::view::XSelectionChangeListener >
52 StatusBarCommandDispatch_Base;
55 class StatusBarCommandDispatch : public impl::StatusBarCommandDispatch_Base
57 public:
58 explicit StatusBarCommandDispatch(
59 const ::com::sun::star::uno::Reference<
60 ::com::sun::star::uno::XComponentContext > & xContext,
61 const ::com::sun::star::uno::Reference<
62 ::com::sun::star::frame::XModel > & xModel,
63 const ::com::sun::star::uno::Reference<
64 ::com::sun::star::view::XSelectionSupplier > & xSelSupp );
65 virtual ~StatusBarCommandDispatch();
67 // late initialisation, especially for adding as listener
68 virtual void initialize();
70 protected:
71 // ____ XDispatch ____
72 virtual void SAL_CALL dispatch(
73 const ::com::sun::star::util::URL& URL,
74 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments )
75 throw (::com::sun::star::uno::RuntimeException);
77 // ____ WeakComponentImplHelperBase ____
78 /// is called when this is disposed
79 virtual void SAL_CALL disposing();
81 // ____ XModifyListener (override from CommandDispatch) ____
82 virtual void SAL_CALL modified(
83 const ::com::sun::star::lang::EventObject& aEvent )
84 throw (::com::sun::star::uno::RuntimeException);
86 // ____ XEventListener (base of XModifyListener) ____
87 virtual void SAL_CALL disposing(
88 const ::com::sun::star::lang::EventObject& Source )
89 throw (::com::sun::star::uno::RuntimeException);
91 virtual void fireStatusEvent(
92 const ::rtl::OUString & rURL,
93 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xSingleListener );
95 // ____ XSelectionChangeListener ____
96 virtual void SAL_CALL selectionChanged(
97 const ::com::sun::star::lang::EventObject& aEvent )
98 throw (::com::sun::star::uno::RuntimeException);
100 private:
101 ::com::sun::star::uno::Reference<
102 ::com::sun::star::util::XModifiable > m_xModifiable;
103 ::com::sun::star::uno::Reference<
104 ::com::sun::star::view::XSelectionSupplier > m_xSelectionSupplier;
105 bool m_bIsModified;
106 ::rtl::OUString m_aSelectedCID;
109 } // namespace chart
111 // CHART2_STATUSBARCOMMANDDISPATCH_HXX
112 #endif