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_CHARTAPIWRAPPER_DATASERIESPOINTWRAPPER_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_DATASERIESPOINTWRAPPER_HXX
22 #include "WrappedPropertySet.hxx"
23 #include "ReferenceSizePropertyProvider.hxx"
24 #include <cppuhelper/implbase4.hxx>
25 #include <comphelper/uno3.hxx>
26 #include <cppuhelper/interfacecontainer.hxx>
27 #include <com/sun/star/chart2/XDataSeries.hpp>
28 #include <com/sun/star/frame/XModel.hpp>
29 #include <com/sun/star/lang/XComponent.hpp>
30 #include <com/sun/star/lang/XEventListener.hpp>
31 #include <com/sun/star/lang/XInitialization.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
35 #include <boost/shared_ptr.hpp>
43 class Chart2ModelContact
;
45 class DataSeriesPointWrapper
: public ::cppu::ImplInheritanceHelper4
<
47 , com::sun::star::lang::XServiceInfo
48 , com::sun::star::lang::XInitialization
49 , com::sun::star::lang::XComponent
50 , com::sun::star::lang::XEventListener
52 , public ReferenceSizePropertyProvider
62 //this constructor needs an initialize call afterwards
63 DataSeriesPointWrapper( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
65 DataSeriesPointWrapper( eType eType
66 , sal_Int32 nSeriesIndexInNewAPI
67 , sal_Int32 nPointIndex
//ignored for series
68 , ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
70 virtual ~DataSeriesPointWrapper();
72 bool isSupportingAreaProperties();
73 bool isLinesForbidden() { return !m_bLinesAllowed
;}
75 /// XServiceInfo declarations
76 virtual OUString SAL_CALL
getImplementationName()
77 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
79 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
81 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 static OUString
getImplementationName_Static();
84 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
86 // ___lang::XInitialization___
87 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
88 throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
90 //ReferenceSizePropertyProvider
91 virtual void updateReferenceSize() SAL_OVERRIDE
;
92 virtual ::com::sun::star::uno::Any
getReferenceSize() SAL_OVERRIDE
;
93 virtual ::com::sun::star::awt::Size
getCurrentSizeForReference() SAL_OVERRIDE
;
96 // ____ XComponent ____
97 virtual void SAL_CALL
dispose()
98 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
99 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
<
100 ::com::sun::star::lang::XEventListener
>& xListener
)
101 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
102 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
<
103 ::com::sun::star::lang::XEventListener
>& aListener
)
104 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
106 // ____ XEventListener ____
107 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
108 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
111 // ____ WrappedPropertySet ____
112 virtual const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& getPropertySequence() SAL_OVERRIDE
;
113 virtual const std::vector
< WrappedProperty
* > createWrappedProperties() SAL_OVERRIDE
;
114 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 virtual ::com::sun::star::uno::Reference
<
117 ::com::sun::star::beans::XPropertySet
> getInnerPropertySet() SAL_OVERRIDE
;
119 virtual ::com::sun::star::beans::PropertyState SAL_CALL
getPropertyState( const OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
120 virtual void SAL_CALL
setPropertyToDefault( const OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
121 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyDefault( const OUString
& aPropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
> getDataSeries();
125 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getDataPointProperties();
129 void SAL_CALL getStatisticsPropertyValue
130 ( ::com::sun::star::uno::Any
& rValue
,
131 sal_Int32 nHandle
) const;
133 void SAL_CALL
setStatisticsPropertyValue_NoBroadcast(
134 sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& rValue
)
135 throw (::com::sun::star::uno::Exception
);
137 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
138 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer
;
141 sal_Int32 m_nSeriesIndexInNewAPI
;
142 sal_Int32 m_nPointIndex
;
144 bool m_bLinesAllowed
;
146 //this should only be used, if the DataSeriesPointWrapper is initialized via the XInitialize interface
147 //because a big change in the chartmodel may lead to an dataseriespointer that is not connected to the model anymore
148 //with the indices instead we can always get the new dataseries
149 ::com::sun::star::uno::Reference
<
150 ::com::sun::star::chart2::XDataSeries
> m_xDataSeries
;
153 } // namespace wrapper
156 // INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_DATASERIESPOINTWRAPPER_HXX
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */