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 .
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/implbase1.hxx>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/view/XSelectionSupplier.hpp>
27 #include <com/sun/star/util/XModifiable.hpp>
32 /** This is a CommandDispatch implementation for all commands the status bar offers
34 This class reads the information needed from the XModel passed here.
39 typedef ::cppu::ImplInheritanceHelper1
<
41 ::com::sun::star::view::XSelectionChangeListener
>
42 StatusBarCommandDispatch_Base
;
45 class StatusBarCommandDispatch
: public impl::StatusBarCommandDispatch_Base
48 explicit StatusBarCommandDispatch(
49 const ::com::sun::star::uno::Reference
<
50 ::com::sun::star::uno::XComponentContext
> & xContext
,
51 const ::com::sun::star::uno::Reference
<
52 ::com::sun::star::frame::XModel
> & xModel
,
53 const ::com::sun::star::uno::Reference
<
54 ::com::sun::star::view::XSelectionSupplier
> & xSelSupp
);
55 virtual ~StatusBarCommandDispatch();
57 // late initialisation, especially for adding as listener
58 virtual void initialize() SAL_OVERRIDE
;
61 // ____ XDispatch ____
62 virtual void SAL_CALL
dispatch(
63 const ::com::sun::star::util::URL
& URL
,
64 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& Arguments
)
65 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
67 // ____ WeakComponentImplHelperBase ____
68 /// is called when this is disposed
69 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
71 // ____ XModifyListener (override from CommandDispatch) ____
72 virtual void SAL_CALL
modified(
73 const ::com::sun::star::lang::EventObject
& aEvent
)
74 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
76 // ____ XEventListener (base of XModifyListener) ____
77 virtual void SAL_CALL
disposing(
78 const ::com::sun::star::lang::EventObject
& Source
)
79 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual void fireStatusEvent(
82 const OUString
& rURL
,
83 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XStatusListener
> & xSingleListener
) SAL_OVERRIDE
;
85 // ____ XSelectionChangeListener ____
86 virtual void SAL_CALL
selectionChanged(
87 const ::com::sun::star::lang::EventObject
& aEvent
)
88 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 ::com::sun::star::uno::Reference
<
92 ::com::sun::star::util::XModifiable
> m_xModifiable
;
93 ::com::sun::star::uno::Reference
<
94 ::com::sun::star::view::XSelectionSupplier
> m_xSelectionSupplier
;
96 ObjectIdentifier m_aSelectedOID
;
101 // INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_STATUSBARCOMMANDDISPATCH_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */