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 .
20 #ifndef INCLUDED_SC_INC_CHARTUNO_HXX
21 #define INCLUDED_SC_INC_CHARTUNO_HXX
23 #include "address.hxx"
24 #include "rangelst.hxx"
25 #include <svl/lstner.hxx>
26 #include <comphelper/proparrhlp.hxx>
27 #include <comphelper/propertycontainer.hxx>
29 #include <com/sun/star/table/XTableChart.hpp>
30 #include <com/sun/star/table/XTableCharts.hpp>
31 #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/container/XEnumerationAccess.hpp>
34 #include <com/sun/star/container/XIndexAccess.hpp>
35 #include <com/sun/star/container/XNamed.hpp>
36 #include <cppuhelper/compbase4.hxx>
37 #include <cppuhelper/implbase4.hxx>
42 class ScChartsObj
: public cppu::WeakImplHelper4
<
43 com::sun::star::table::XTableCharts
,
44 com::sun::star::container::XEnumerationAccess
,
45 com::sun::star::container::XIndexAccess
,
46 com::sun::star::lang::XServiceInfo
>,
50 ScDocShell
* pDocShell
;
51 SCTAB nTab
; // Charts are per sheet
53 ScChartObj
* GetObjectByIndex_Impl(long nIndex
) const;
54 ScChartObj
* GetObjectByName_Impl(const OUString
& aName
) const;
57 ScChartsObj(ScDocShell
* pDocSh
, SCTAB nT
);
58 virtual ~ScChartsObj();
60 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) SAL_OVERRIDE
;
63 virtual void SAL_CALL
addNewByName( const OUString
& aName
,
64 const ::com::sun::star::awt::Rectangle
& aRect
,
65 const ::com::sun::star::uno::Sequence
<
66 ::com::sun::star::table::CellRangeAddress
>& aRanges
,
67 sal_Bool bColumnHeaders
, sal_Bool bRowHeaders
)
68 throw(::com::sun::star::uno::RuntimeException
,
69 std::exception
) SAL_OVERRIDE
;
70 virtual void SAL_CALL
removeByName( const OUString
& aName
)
71 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
74 virtual ::com::sun::star::uno::Any SAL_CALL
getByName( const OUString
& aName
)
75 throw(::com::sun::star::container::NoSuchElementException
,
76 ::com::sun::star::lang::WrappedTargetException
,
77 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getElementNames()
79 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
)
81 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual sal_Int32 SAL_CALL
getCount() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
85 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
)
86 throw(::com::sun::star::lang::IndexOutOfBoundsException
,
87 ::com::sun::star::lang::WrappedTargetException
,
88 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
92 createEnumeration() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
95 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
96 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 virtual sal_Bool SAL_CALL
hasElements() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual OUString SAL_CALL
getImplementationName()
101 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
102 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
103 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
104 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
105 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 typedef ::cppu::WeakComponentImplHelper4
<
109 ::com::sun::star::table::XTableChart
,
110 ::com::sun::star::document::XEmbeddedObjectSupplier
,
111 ::com::sun::star::container::XNamed
,
112 ::com::sun::star::lang::XServiceInfo
> ScChartObj_Base
;
114 typedef ::comphelper::OPropertyContainer ScChartObj_PBase
;
115 typedef ::comphelper::OPropertyArrayUsageHelper
< ScChartObj
> ScChartObj_PABase
;
117 class ScChartObj
: public ::comphelper::OBaseMutex
118 ,public ScChartObj_Base
119 ,public ScChartObj_PBase
120 ,public ScChartObj_PABase
124 ScDocShell
* pDocShell
;
125 SCTAB nTab
; // Charts are per sheet
128 void Update_Impl( const ScRangeListRef
& rRanges
, bool bColHeaders
, bool bRowHeaders
);
129 void GetData_Impl( ScRangeListRef
& rRanges
, bool& rColHeaders
, bool& rRowHeaders
) const;
132 // ::comphelper::OPropertySetHelper
133 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() SAL_OVERRIDE
;
134 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& rValue
)
135 throw (::com::sun::star::uno::Exception
,
136 std::exception
) SAL_OVERRIDE
;
137 using ::cppu::OPropertySetHelper::getFastPropertyValue
;
138 virtual void SAL_CALL
getFastPropertyValue( ::com::sun::star::uno::Any
& rValue
, sal_Int32 nHandle
) const SAL_OVERRIDE
;
140 // ::comphelper::OPropertyArrayUsageHelper
141 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const SAL_OVERRIDE
;
144 ScChartObj(ScDocShell
* pDocSh
, SCTAB nT
, const OUString
& rN
);
145 virtual ~ScChartObj();
147 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) SAL_OVERRIDE
;
153 DECLARE_XTYPEPROVIDER()
156 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
159 virtual sal_Bool SAL_CALL
getHasColumnHeaders() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
160 virtual void SAL_CALL
setHasColumnHeaders( sal_Bool bHasColumnHeaders
)
161 throw(::com::sun::star::uno::RuntimeException
,
162 std::exception
) SAL_OVERRIDE
;
163 virtual sal_Bool SAL_CALL
getHasRowHeaders() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
164 virtual void SAL_CALL
setHasRowHeaders( sal_Bool bHasRowHeaders
)
165 throw(::com::sun::star::uno::RuntimeException
,
166 std::exception
) SAL_OVERRIDE
;
167 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::table::CellRangeAddress
> SAL_CALL
168 getRanges( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
169 virtual void SAL_CALL
setRanges( const ::com::sun::star::uno::Sequence
<
170 ::com::sun::star::table::CellRangeAddress
>& aRanges
)
171 throw(::com::sun::star::uno::RuntimeException
,
172 std::exception
) SAL_OVERRIDE
;
174 // XEmbeddedObjectSupplier
175 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> SAL_CALL
176 getEmbeddedObject() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
179 virtual OUString SAL_CALL
getName() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
180 virtual void SAL_CALL
setName( const OUString
& aName
)
181 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
184 virtual OUString SAL_CALL
getImplementationName()
185 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
186 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
187 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
188 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
189 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
192 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo()
193 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
198 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */