Update ooo320-m1
[ooovba.git] / forms / source / richtext / attributedispatcher.hxx
blob19894650a361b81c95d1efbfd147963c8804b2a3
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: attributedispatcher.hxx,v $
10 * $Revision: 1.4 $
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 //........................................................................
38 namespace frm
40 //........................................................................
42 //====================================================================
43 //= OAttributeDispatcher
44 //====================================================================
45 class OAttributeDispatcher :public ORichTextFeatureDispatcher
46 ,public ITextAttributeListener
48 protected:
49 IMultiAttributeDispatcher* m_pMasterDispatcher;
50 AttributeId m_nAttributeId;
52 public:
53 /** ctor
54 @param _nAttributeId
55 the id of the attribute which this instance is responsible for
56 @param _rURL
57 the URL of the feature which this instance is responsible for
58 @param _pMasterDispatcher
59 the dispatcher which can execute the given attribute
60 @param _pConverter
61 an instance which is able to convert between SfxPoolItems and XDispatch-Parameters
62 If not <NULL/>, the parametrized version of IMultiAttributeDispatcher::executeAttribute
63 will be used.
65 OAttributeDispatcher(
66 EditView& _rView,
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 (());
75 protected:
76 ~OAttributeDispatcher( );
78 protected:
79 // XDispatch
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;
91 // own overridables
92 virtual void fillFeatureEventFromAttributeState( ::com::sun::star::frame::FeatureStateEvent& _rEvent, const AttributeState& _rState ) const;
94 protected:
95 /// notifies our feature state to one particular listener
96 void notifyState(
97 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& _rxControl,
98 const AttributeState& _rState
99 ) SAL_THROW (());
102 //........................................................................
103 } // namespace frm
104 //........................................................................
106 #endif // FORMS_SOURCE_RICHTEXT_ATTRIBUTEDISPATCHER_HXX