1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: chartuno.hxx,v $
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 ************************************************************************/
31 #ifndef SC_CHARTUNO_HXX
32 #define SC_CHARTUNO_HXX
34 #include "address.hxx"
35 #include <svtools/lstner.hxx>
36 #include <tools/string.hxx>
38 #include <com/sun/star/table/XTableChart.hpp>
39 #include <com/sun/star/table/XTableCharts.hpp>
40 #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/container/XEnumerationAccess.hpp>
43 #include <com/sun/star/container/XIndexAccess.hpp>
44 #include <com/sun/star/container/XNamed.hpp>
45 #include <cppuhelper/implbase4.hxx>
53 class ScChartsObj
: public cppu::WeakImplHelper4
<
54 com::sun::star::table::XTableCharts
,
55 com::sun::star::container::XEnumerationAccess
,
56 com::sun::star::container::XIndexAccess
,
57 com::sun::star::lang::XServiceInfo
>,
61 ScDocShell
* pDocShell
;
62 SCTAB nTab
; // Charts sind pro Sheet
64 ScChartObj
* GetObjectByIndex_Impl(long nIndex
) const;
65 ScChartObj
* GetObjectByName_Impl(const ::rtl::OUString
& aName
) const;
68 ScChartsObj(ScDocShell
* pDocSh
, SCTAB nT
);
69 virtual ~ScChartsObj();
71 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
74 virtual void SAL_CALL
addNewByName( const ::rtl::OUString
& aName
,
75 const ::com::sun::star::awt::Rectangle
& aRect
,
76 const ::com::sun::star::uno::Sequence
<
77 ::com::sun::star::table::CellRangeAddress
>& aRanges
,
78 sal_Bool bColumnHeaders
, sal_Bool bRowHeaders
)
79 throw(::com::sun::star::uno::RuntimeException
);
80 virtual void SAL_CALL
removeByName( const ::rtl::OUString
& aName
)
81 throw(::com::sun::star::uno::RuntimeException
);
84 virtual ::com::sun::star::uno::Any SAL_CALL
getByName( const ::rtl::OUString
& aName
)
85 throw(::com::sun::star::container::NoSuchElementException
,
86 ::com::sun::star::lang::WrappedTargetException
,
87 ::com::sun::star::uno::RuntimeException
);
88 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getElementNames()
89 throw(::com::sun::star::uno::RuntimeException
);
90 virtual sal_Bool SAL_CALL
hasByName( const ::rtl::OUString
& aName
)
91 throw(::com::sun::star::uno::RuntimeException
);
94 virtual sal_Int32 SAL_CALL
getCount() throw(::com::sun::star::uno::RuntimeException
);
95 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
)
96 throw(::com::sun::star::lang::IndexOutOfBoundsException
,
97 ::com::sun::star::lang::WrappedTargetException
,
98 ::com::sun::star::uno::RuntimeException
);
100 // XEnumerationAccess
101 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
102 createEnumeration() throw(::com::sun::star::uno::RuntimeException
);
105 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
106 throw(::com::sun::star::uno::RuntimeException
);
107 virtual sal_Bool SAL_CALL
hasElements() throw(::com::sun::star::uno::RuntimeException
);
110 virtual ::rtl::OUString SAL_CALL
getImplementationName()
111 throw(::com::sun::star::uno::RuntimeException
);
112 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
)
113 throw(::com::sun::star::uno::RuntimeException
);
114 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames()
115 throw(::com::sun::star::uno::RuntimeException
);
119 class ScChartObj
: public cppu::WeakImplHelper4
<
120 com::sun::star::table::XTableChart
,
121 com::sun::star::document::XEmbeddedObjectSupplier
,
122 com::sun::star::container::XNamed
,
123 com::sun::star::lang::XServiceInfo
>,
127 ScDocShell
* pDocShell
;
128 SCTAB nTab
; // Charts sind pro Sheet
131 void Update_Impl( const ScRangeListRef
& rRanges
, bool bColHeaders
, bool bRowHeaders
);
132 void GetData_Impl( ScRangeListRef
& rRanges
, bool& rColHeaders
, bool& rRowHeaders
) const;
135 ScChartObj(ScDocShell
* pDocSh
, SCTAB nT
, const String
& rN
);
136 virtual ~ScChartObj();
138 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
141 virtual sal_Bool SAL_CALL
getHasColumnHeaders() throw(::com::sun::star::uno::RuntimeException
);
142 virtual void SAL_CALL
setHasColumnHeaders( sal_Bool bHasColumnHeaders
)
143 throw(::com::sun::star::uno::RuntimeException
);
144 virtual sal_Bool SAL_CALL
getHasRowHeaders() throw(::com::sun::star::uno::RuntimeException
);
145 virtual void SAL_CALL
setHasRowHeaders( sal_Bool bHasRowHeaders
)
146 throw(::com::sun::star::uno::RuntimeException
);
147 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::table::CellRangeAddress
> SAL_CALL
148 getRanges( ) throw(::com::sun::star::uno::RuntimeException
);
149 virtual void SAL_CALL
setRanges( const ::com::sun::star::uno::Sequence
<
150 ::com::sun::star::table::CellRangeAddress
>& aRanges
)
151 throw(::com::sun::star::uno::RuntimeException
);
153 // XEmbeddedObjectSupplier
154 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> SAL_CALL
155 getEmbeddedObject() throw(::com::sun::star::uno::RuntimeException
);
158 virtual ::rtl::OUString SAL_CALL
getName() throw(::com::sun::star::uno::RuntimeException
);
159 virtual void SAL_CALL
setName( const ::rtl::OUString
& aName
)
160 throw(::com::sun::star::uno::RuntimeException
);
163 virtual ::rtl::OUString SAL_CALL
getImplementationName()
164 throw(::com::sun::star::uno::RuntimeException
);
165 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
)
166 throw(::com::sun::star::uno::RuntimeException
);
167 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames()
168 throw(::com::sun::star::uno::RuntimeException
);