LibreOffice Module svx (master) 1
formfeaturedispatcher.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SVX_SOURCE_INC_FORMFEATUREDISPATCHER_HXX
21#define INCLUDED_SVX_SOURCE_INC_FORMFEATUREDISPATCHER_HXX
22
23#include <com/sun/star/frame/XDispatch.hpp>
24#include <com/sun/star/form/runtime/XFormOperations.hpp>
25
28
29
30namespace svx
31{
32
33 typedef ::cppu::WeakImplHelper < css::frame::XDispatch
35
37 {
38 public:
55 css::util::URL _aFeatureURL,
56 const sal_Int16 _nFormFeature,
57 const css::uno::Reference< css::form::runtime::XFormOperations >& _rxFormOperations,
58 ::osl::Mutex& _rMutex
59 );
60
63 void updateAllListeners();
64
65 private:
66 // XDispatch
67 virtual void SAL_CALL dispatch( const css::util::URL& _rURL, const css::uno::Sequence< css::beans::PropertyValue >& _rArguments ) override;
68 virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& _rxControl, const css::util::URL& _rURL ) override;
69 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& _rxControl, const css::util::URL& _rURL ) override;
70
81 void notifyStatus(
82 const css::uno::Reference< css::frame::XStatusListener >& _rxListener,
83 ::osl::ClearableMutexGuard& _rFreeForNotification
84 );
85
92 void getUnoState( css::frame::FeatureStateEvent& /* [out] */ _rState ) const;
93
94 ::osl::Mutex& m_rMutex;
96 css::uno::Reference< css::form::runtime::XFormOperations >
98 const css::util::URL m_aFeatureURL;
99 css::uno::Any m_aLastKnownState;
100 const sal_Int16 m_nFormFeature;
102
103 };
104
105
106}
107
108
109#endif
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void updateAllListeners()
notifies all our listeners of the current state
OSingleFeatureDispatcher(css::util::URL _aFeatureURL, const sal_Int16 _nFormFeature, const css::uno::Reference< css::form::runtime::XFormOperations > &_rxFormOperations, ::osl::Mutex &_rMutex)
constructs the dispatcher
css::uno::Reference< css::form::runtime::XFormOperations > m_xFormOperations
void notifyStatus(const css::uno::Reference< css::frame::XStatusListener > &_rxListener, ::osl::ClearableMutexGuard &_rFreeForNotification)
notifies our current state to one or all listeners
virtual void SAL_CALL dispatch(const css::util::URL &_rURL, const css::uno::Sequence< css::beans::PropertyValue > &_rArguments) override
void getUnoState(css::frame::FeatureStateEvent &_rState) const
retrieves the current status of our feature, in a format which can be used for UNO notifications
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &_rxControl, const css::util::URL &_rURL) override
::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener > m_aStatusListeners
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &_rxControl, const css::util::URL &_rURL) override
::cppu::WeakImplHelper< css::frame::XDispatch > OSingleFeatureDispatcher_Base