1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: attributedispatcher.hxx,v $
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 FORMS_SOURCE_RICHTEXT_ATTRIBUTEDISPATCHER_HXX
31 #define FORMS_SOURCE_RICHTEXT_ATTRIBUTEDISPATCHER_HXX
33 #include "featuredispatcher.hxx"
34 #include "rtattributes.hxx"
35 #include "textattributelistener.hxx"
37 //........................................................................
40 //........................................................................
42 //====================================================================
43 //= OAttributeDispatcher
44 //====================================================================
45 class OAttributeDispatcher
:public ORichTextFeatureDispatcher
46 ,public ITextAttributeListener
49 IMultiAttributeDispatcher
* m_pMasterDispatcher
;
50 AttributeId m_nAttributeId
;
55 the id of the attribute which this instance is responsible for
57 the URL of the feature which this instance is responsible for
58 @param _pMasterDispatcher
59 the dispatcher which can execute the given attribute
61 an instance which is able to convert between SfxPoolItems and XDispatch-Parameters
62 If not <NULL/>, the parametrized version of IMultiAttributeDispatcher::executeAttribute
67 AttributeId _nAttributeId
,
68 const ::com::sun::star::util::URL
& _rURL
,
69 IMultiAttributeDispatcher
* _pMasterDispatcher
72 /// notifies a new attribute state
73 void notifyAttributeState( const AttributeState
& _rState
) SAL_THROW (());
76 ~OAttributeDispatcher( );
80 virtual void SAL_CALL
dispatch( const ::com::sun::star::util::URL
& URL
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& Arguments
) throw (::com::sun::star::uno::RuntimeException
);
82 // ITextAttributeListener
83 virtual void onAttributeStateChanged( AttributeId _nAttributeId
, const AttributeState
& _rState
);
85 // ORichTextFeatureDispatcher
86 virtual void disposing( ::osl::ClearableMutexGuard
& _rClearBeforeNotify
);
88 // ORichTextFeatureDispatcher
89 virtual ::com::sun::star::frame::FeatureStateEvent
buildStatusEvent() const;
92 virtual void fillFeatureEventFromAttributeState( ::com::sun::star::frame::FeatureStateEvent
& _rEvent
, const AttributeState
& _rState
) const;
95 /// notifies our feature state to one particular listener
97 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XStatusListener
>& _rxControl
,
98 const AttributeState
& _rState
102 //........................................................................
104 //........................................................................
106 #endif // FORMS_SOURCE_RICHTEXT_ATTRIBUTEDISPATCHER_HXX