Bump version to 4.3-4
[LibreOffice.git] / sc / inc / chartuno.hxx
blob30bd965fa2a533c55ff9faaeaf8ec7ef06d182d6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
40 class ScDocShell;
41 class ScChartObj;
44 class ScChartsObj : public cppu::WeakImplHelper4<
45 com::sun::star::table::XTableCharts,
46 com::sun::star::container::XEnumerationAccess,
47 com::sun::star::container::XIndexAccess,
48 com::sun::star::lang::XServiceInfo >,
49 public SfxListener
51 private:
52 ScDocShell* pDocShell;
53 SCTAB nTab; // Charts are per sheet
55 ScChartObj* GetObjectByIndex_Impl(long nIndex) const;
56 ScChartObj* GetObjectByName_Impl(const OUString& aName) const;
58 public:
59 ScChartsObj(ScDocShell* pDocSh, SCTAB nT);
60 virtual ~ScChartsObj();
62 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
64 // XTableCharts
65 virtual void SAL_CALL addNewByName( const OUString& aName,
66 const ::com::sun::star::awt::Rectangle& aRect,
67 const ::com::sun::star::uno::Sequence<
68 ::com::sun::star::table::CellRangeAddress >& aRanges,
69 sal_Bool bColumnHeaders, sal_Bool bRowHeaders )
70 throw(::com::sun::star::uno::RuntimeException,
71 std::exception) SAL_OVERRIDE;
72 virtual void SAL_CALL removeByName( const OUString& aName )
73 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 // XNameAccess
76 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
77 throw(::com::sun::star::container::NoSuchElementException,
78 ::com::sun::star::lang::WrappedTargetException,
79 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
81 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
83 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 // XIndexAccess
86 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
88 throw(::com::sun::star::lang::IndexOutOfBoundsException,
89 ::com::sun::star::lang::WrappedTargetException,
90 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 // XEnumerationAccess
93 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
94 createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
96 // XElementAccess
97 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
98 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 // XServiceInfo
102 virtual OUString SAL_CALL getImplementationName()
103 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
105 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
107 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
111 typedef ::cppu::WeakComponentImplHelper4<
112 ::com::sun::star::table::XTableChart,
113 ::com::sun::star::document::XEmbeddedObjectSupplier,
114 ::com::sun::star::container::XNamed,
115 ::com::sun::star::lang::XServiceInfo > ScChartObj_Base;
117 typedef ::comphelper::OPropertyContainer ScChartObj_PBase;
118 typedef ::comphelper::OPropertyArrayUsageHelper< ScChartObj > ScChartObj_PABase;
120 class ScChartObj : public ::comphelper::OBaseMutex
121 ,public ScChartObj_Base
122 ,public ScChartObj_PBase
123 ,public ScChartObj_PABase
124 ,public SfxListener
126 private:
127 ScDocShell* pDocShell;
128 SCTAB nTab; // Charts are per sheet
129 OUString aChartName;
131 void Update_Impl( const ScRangeListRef& rRanges, bool bColHeaders, bool bRowHeaders );
132 void GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool& rRowHeaders ) const;
134 protected:
135 // ::comphelper::OPropertySetHelper
136 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
137 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
138 throw (::com::sun::star::uno::Exception,
139 std::exception) SAL_OVERRIDE;
140 using ::cppu::OPropertySetHelper::getFastPropertyValue;
141 virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const SAL_OVERRIDE;
143 // ::comphelper::OPropertyArrayUsageHelper
144 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const SAL_OVERRIDE;
146 public:
147 ScChartObj(ScDocShell* pDocSh, SCTAB nT, const OUString& rN);
148 virtual ~ScChartObj();
150 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
152 // XInterface
153 DECLARE_XINTERFACE()
155 // XTypeProvider
156 DECLARE_XTYPEPROVIDER()
158 // XComponent
159 virtual void SAL_CALL disposing() SAL_OVERRIDE;
161 // XTableChart
162 virtual sal_Bool SAL_CALL getHasColumnHeaders() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
163 virtual void SAL_CALL setHasColumnHeaders( sal_Bool bHasColumnHeaders )
164 throw(::com::sun::star::uno::RuntimeException,
165 std::exception) SAL_OVERRIDE;
166 virtual sal_Bool SAL_CALL getHasRowHeaders() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
167 virtual void SAL_CALL setHasRowHeaders( sal_Bool bHasRowHeaders )
168 throw(::com::sun::star::uno::RuntimeException,
169 std::exception) SAL_OVERRIDE;
170 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
171 getRanges( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
172 virtual void SAL_CALL setRanges( const ::com::sun::star::uno::Sequence<
173 ::com::sun::star::table::CellRangeAddress >& aRanges )
174 throw(::com::sun::star::uno::RuntimeException,
175 std::exception) SAL_OVERRIDE;
177 // XEmbeddedObjectSupplier
178 virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL
179 getEmbeddedObject() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
181 // XNamed
182 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
183 virtual void SAL_CALL setName( const OUString& aName )
184 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
186 // XServiceInfo
187 virtual OUString SAL_CALL getImplementationName()
188 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
189 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
190 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
191 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
192 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
194 // XPropertySet
195 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
196 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
199 #endif
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */