1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART_LEGEND_HXX
28 #define CHART_LEGEND_HXX
30 #include "ServiceMacros.hxx"
31 #include "ModifyListenerHelper.hxx"
32 #include "OPropertySet.hxx"
33 #include "MutexContainer.hxx"
34 #include <cppuhelper/implbase5.hxx>
35 #include <comphelper/uno3.hxx>
36 #include <com/sun/star/chart2/XLegend.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <com/sun/star/util/XCloneable.hpp>
40 #include <com/sun/star/util/XModifyBroadcaster.hpp>
41 #include <com/sun/star/util/XModifyListener.hpp>
48 typedef ::cppu::WeakImplHelper5
<
49 ::com::sun::star::chart2::XLegend
,
50 ::com::sun::star::lang::XServiceInfo
,
51 ::com::sun::star::util::XCloneable
,
52 ::com::sun::star::util::XModifyBroadcaster
,
53 ::com::sun::star::util::XModifyListener
>
58 public MutexContainer
,
59 public impl::Legend_Base
,
60 public ::property::OPropertySet
63 Legend( ::com::sun::star::uno::Reference
<
64 ::com::sun::star::uno::XComponentContext
> const & xContext
);
67 /// establish methods for factory instatiation
68 APPHELPER_SERVICE_FACTORY_HELPER( Legend
)
70 /// XServiceInfo declarations
71 APPHELPER_XSERVICEINFO_DECL()
73 /// merge XInterface implementations
75 /// merge XTypeProvider implementations
76 DECLARE_XTYPEPROVIDER()
79 explicit Legend( const Legend
& rOther
);
81 // ____ OPropertySet ____
82 virtual ::com::sun::star::uno::Any
GetDefaultValue( sal_Int32 nHandle
) const
83 throw(::com::sun::star::beans::UnknownPropertyException
);
85 // ____ OPropertySet ____
86 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
88 // ____ XPropertySet ____
89 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
91 throw (::com::sun::star::uno::RuntimeException
);
93 // virtual sal_Bool SAL_CALL convertFastPropertyValue
94 // ( ::com::sun::star::uno::Any & rConvertedValue,
95 // ::com::sun::star::uno::Any & rOldValue,
97 // const ::com::sun::star::uno::Any& rValue )
98 // throw (::com::sun::star::lang::IllegalArgumentException);
101 virtual void SAL_CALL
registerEntry( const ::com::sun::star::uno::Reference
<
102 ::com::sun::star::chart2::XLegendEntry
>& xEntry
)
103 throw (::com::sun::star::lang::IllegalArgumentException
,
104 ::com::sun::star::uno::RuntimeException
);
105 virtual void SAL_CALL
revokeEntry( const ::com::sun::star::uno::Reference
<
106 ::com::sun::star::chart2::XLegendEntry
>& xEntry
)
107 throw (::com::sun::star::container::NoSuchElementException
,
108 ::com::sun::star::uno::RuntimeException
);
109 virtual ::com::sun::star::uno::Sequence
<
110 ::com::sun::star::uno::Reference
<
111 ::com::sun::star::chart2::XLegendEntry
> > SAL_CALL
getEntries()
112 throw (::com::sun::star::uno::RuntimeException
);
114 // ____ XCloneable ____
115 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
116 throw (::com::sun::star::uno::RuntimeException
);
118 // ____ XModifyBroadcaster ____
119 virtual void SAL_CALL
addModifyListener(
120 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
121 throw (::com::sun::star::uno::RuntimeException
);
122 virtual void SAL_CALL
removeModifyListener(
123 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
124 throw (::com::sun::star::uno::RuntimeException
);
126 // ____ XModifyListener ____
127 virtual void SAL_CALL
modified(
128 const ::com::sun::star::lang::EventObject
& aEvent
)
129 throw (::com::sun::star::uno::RuntimeException
);
131 // ____ XEventListener (base of XModifyListener) ____
132 virtual void SAL_CALL
disposing(
133 const ::com::sun::star::lang::EventObject
& Source
)
134 throw (::com::sun::star::uno::RuntimeException
);
136 // ____ OPropertySet ____
137 virtual void firePropertyChangeEvent();
138 using OPropertySet::disposing
;
140 void fireModifyEvent();
143 typedef ::std::vector
<
144 ::com::sun::star::uno::Reference
<
145 ::com::sun::star::chart2::XLegendEntry
> > tLegendEntries
;
147 tLegendEntries m_aLegendEntries
;
148 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
> m_xModifyEventForwarder
;