fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / controller / main / CommandDispatch.hxx
blobe4255b2fc0446c8f44738390f1eac9b322c887c2
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_COMMANDDISPATCH_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_COMMANDDISPATCH_HXX
22 #include "MutexContainer.hxx"
23 #include <cppuhelper/compbase2.hxx>
24 #include <com/sun/star/frame/XDispatch.hpp>
25 #include <com/sun/star/util/XModifyListener.hpp>
26 #include <com/sun/star/uno/XComponentContext.hpp>
27 #include <com/sun/star/util/XURLTransformer.hpp>
29 #include <vector>
30 #include <map>
32 namespace chart
35 namespace impl
37 typedef ::cppu::WeakComponentImplHelper2<
38 ::com::sun::star::frame::XDispatch,
39 ::com::sun::star::util::XModifyListener >
40 CommandDispatch_Base;
43 /** This is the base class for an XDispatch.
45 class CommandDispatch :
46 public MutexContainer,
47 public impl::CommandDispatch_Base
49 public:
50 explicit CommandDispatch(
51 const ::com::sun::star::uno::Reference<
52 ::com::sun::star::uno::XComponentContext > & xContext );
53 virtual ~CommandDispatch();
55 // late initialisation, especially for adding as listener
56 virtual void initialize();
58 protected:
59 /** sends a status event for a specific command to all registered listeners
60 or only the one given when set.
62 This method should be overridden. The implementation should call
63 fireStatusEventForURL and pass the xSingleListener argument to this
64 method unchanged.
66 @param rURL
67 If empty, all available status events must be fired, otherwise only
68 the one for the given command.
70 @param xSingleListener
71 If set, the event is only sent to this listener rather than to all
72 registered ones. Whenever a listener adds itself, this method is
73 called with this parameter set to give an initial state.
75 virtual void fireStatusEvent(
76 const OUString & rURL,
77 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xSingleListener ) = 0;
79 /** calls fireStatusEvent( OUString, xSingleListener )
81 void fireAllStatusEvents(
82 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xSingleListener );
84 /** sends a status event for a specific command to all registered listeners
85 or only the one given when set.
87 @param xSingleListener
88 If set, the event is only sent to this listener rather than to all
89 registered ones. Whenever a listener adds itself, this method is
90 called with this parameter set to give an initial state.
92 void fireStatusEventForURL(
93 const OUString & rURL,
94 const ::com::sun::star::uno::Any & rState,
95 bool bEnabled,
96 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xSingleListener =
97 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >(),
98 const OUString & rFeatureDescriptor = OUString() );
100 // ____ XDispatch ____
101 virtual void SAL_CALL dispatch(
102 const ::com::sun::star::util::URL& URL,
103 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments )
104 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 virtual void SAL_CALL addStatusListener(
106 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& Control,
107 const ::com::sun::star::util::URL& URL )
108 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 virtual void SAL_CALL removeStatusListener(
110 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& Control,
111 const ::com::sun::star::util::URL& URL )
112 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 // ____ WeakComponentImplHelperBase ____
115 /// is called when this is disposed
116 virtual void SAL_CALL disposing() SAL_OVERRIDE;
118 // ____ XModifyListener ____
119 virtual void SAL_CALL modified(
120 const ::com::sun::star::lang::EventObject& aEvent )
121 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
123 // ____ XEventListener (base of XModifyListener) ____
124 virtual void SAL_CALL disposing(
125 const ::com::sun::star::lang::EventObject& Source )
126 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
128 protected:
129 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
130 ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
132 private:
133 typedef ::std::map< OUString, ::cppu::OInterfaceContainerHelper* >
134 tListenerMap;
136 tListenerMap m_aListeners;
140 } // namespace chart
142 // INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_COMMANDDISPATCH_HXX
143 #endif
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */