Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef SC_VBA_CHARTOBJECTS_HXX
20 : #define SC_VBA_CHARTOBJECTS_HXX
21 : #include <ooo/vba/excel/XChartObjects.hpp>
22 : #include <ooo/vba/excel/XChartObject.hpp>
23 : #include <cppuhelper/implbase1.hxx>
24 : #include <com/sun/star/uno/XComponentContext.hpp>
25 : #include <com/sun/star/table/XTableCharts.hpp>
26 : #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
27 : #include <com/sun/star/container/XEnumerationAccess.hpp>
28 : #include <vbahelper/vbacollectionimpl.hxx>
29 : #include "excelvbahelper.hxx"
30 : #include <boost/unordered_map.hpp>
31 :
32 : typedef CollTestImplHelper< ov::excel::XChartObjects > ChartObjects_BASE;
33 : /* #TODO see if this hash table is 'really' necessary
34 : typedef ::boost::unordered_map< OUString,
35 : css::uno::Reference< ov::excel::XChartObject >,
36 : OUStringHash,
37 : ::std::equal_to< OUString > > aHashTable;
38 : */
39 :
40 0 : class ScVbaChartObjects : public ChartObjects_BASE
41 : {
42 :
43 : css::uno::Reference< css::table::XTableCharts > xTableCharts;
44 : css::uno::Reference< css::drawing::XDrawPageSupplier > xDrawPageSupplier;
45 : // method associated with populating the hashmap ( I'm not convinced this is necessary )
46 : //css::uno::Reference< ov::excel::XChartObject > putByPersistName( const rtl:::OUString& _sPersistChartName );
47 : public:
48 : ScVbaChartObjects( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableCharts >& _xTableCharts, const css::uno::Reference< css::drawing::XDrawPageSupplier >& _xDrawPageSupplier );
49 :
50 : css::uno::Sequence< OUString > getChartObjectNames() throw( css::script::BasicErrorException );
51 : void removeByName(const OUString& _sChartName);
52 :
53 : // XChartObjects
54 : virtual ::com::sun::star::uno::Any SAL_CALL Add( double Left, double Top, double Width, double Height ) throw (::com::sun::star::script::BasicErrorException, std::exception) SAL_OVERRIDE;
55 : virtual void SAL_CALL Delete( ) throw (::com::sun::star::script::BasicErrorException, std::exception) SAL_OVERRIDE;
56 : // XEnumerationAccess
57 : virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) SAL_OVERRIDE;
58 : // XElementAccess
59 : virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) SAL_OVERRIDE;
60 : // ScVbaCollectionBaseImpl
61 : virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) SAL_OVERRIDE;
62 : // ChartObjects_BASE
63 : virtual OUString getServiceImplName() SAL_OVERRIDE;
64 : virtual css::uno::Sequence<OUString> getServiceNames() SAL_OVERRIDE;
65 : };
66 :
67 : #endif //SC_VBA_WINDOW_HXX
68 :
69 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|