merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / inc / NameContainer.hxx
blobf44d3cea490a4a3f539c1f799a86e2e6c3b5ebf9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _CHART2_NAMECONTAINER_HXX
29 #define _CHART2_NAMECONTAINER_HXX
31 #include <com/sun/star/container/XNameContainer.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
34 #include <com/sun/star/util/XCloneable.hpp>
35 #include <cppuhelper/implbase3.hxx>
36 #include "charttoolsdllapi.hxx"
38 #include <map>
40 //.............................................................................
41 namespace chart
43 //.............................................................................
45 OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createNameContainer(
46 const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName );
48 namespace impl
50 typedef ::cppu::WeakImplHelper3<
51 ::com::sun::star::container::XNameContainer,
52 ::com::sun::star::lang::XServiceInfo,
53 ::com::sun::star::util::XCloneable >
54 NameContainer_Base;
57 class NameContainer : public impl::NameContainer_Base
59 public:
60 NameContainer( const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName );
61 explicit NameContainer( const NameContainer & rOther );
62 virtual ~NameContainer();
64 // XServiceInfo
65 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
66 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
67 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
69 // XNameContainer
70 virtual void SAL_CALL insertByName( const rtl::OUString& aName, const com::sun::star::uno::Any& aElement ) throw( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::ElementExistException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException);
71 virtual void SAL_CALL removeByName( const rtl::OUString& Name ) throw( com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException);
73 // XNameReplace
74 virtual void SAL_CALL replaceByName( const rtl::OUString& aName, const com::sun::star::uno::Any& aElement ) throw( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException);
76 // XNameAccess
77 virtual com::sun::star::uno::Any SAL_CALL getByName( const rtl::OUString& aName ) throw( com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException);
78 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( com::sun::star::uno::RuntimeException);
79 virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw( com::sun::star::uno::RuntimeException);
81 // XElementAccess
82 virtual sal_Bool SAL_CALL hasElements( ) throw( com::sun::star::uno::RuntimeException);
83 virtual com::sun::star::uno::Type SAL_CALL getElementType( ) throw( com::sun::star::uno::RuntimeException);
85 // XCloneable
86 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw (::com::sun::star::uno::RuntimeException);
88 private: //methods
89 NameContainer();//no default contructor
91 private: //member
92 const ::com::sun::star::uno::Type m_aType;
93 const rtl::OUString m_aServicename;
94 const rtl::OUString m_aImplementationName;
96 typedef ::std::map< ::rtl::OUString, com::sun::star::uno::Any > tContentMap;
98 tContentMap m_aMap;
101 //.............................................................................
102 } //namespace chart
103 //.............................................................................
104 #endif