Update ooo320-m1
[ooovba.git] / chart2 / source / inc / NameContainer.hxx
blob711bf5f3d5ca63adf6ce3f6e963e964855687d29
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: NameContainer.hxx,v $
10 * $Revision: 1.4 $
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 _CHART2_NAMECONTAINER_HXX
32 #define _CHART2_NAMECONTAINER_HXX
34 #include <com/sun/star/container/XNameContainer.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <com/sun/star/util/XCloneable.hpp>
38 #include <cppuhelper/implbase3.hxx>
39 #include "charttoolsdllapi.hxx"
41 #include <map>
43 //.............................................................................
44 namespace chart
46 //.............................................................................
48 OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createNameContainer(
49 const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName );
51 namespace impl
53 typedef ::cppu::WeakImplHelper3<
54 ::com::sun::star::container::XNameContainer,
55 ::com::sun::star::lang::XServiceInfo,
56 ::com::sun::star::util::XCloneable >
57 NameContainer_Base;
60 class NameContainer : public impl::NameContainer_Base
62 public:
63 NameContainer( const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName );
64 explicit NameContainer( const NameContainer & rOther );
65 virtual ~NameContainer();
67 // XServiceInfo
68 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
69 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
70 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
72 // XNameContainer
73 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);
74 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);
76 // XNameReplace
77 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);
79 // XNameAccess
80 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);
81 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( com::sun::star::uno::RuntimeException);
82 virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw( com::sun::star::uno::RuntimeException);
84 // XElementAccess
85 virtual sal_Bool SAL_CALL hasElements( ) throw( com::sun::star::uno::RuntimeException);
86 virtual com::sun::star::uno::Type SAL_CALL getElementType( ) throw( com::sun::star::uno::RuntimeException);
88 // XCloneable
89 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw (::com::sun::star::uno::RuntimeException);
91 private: //methods
92 NameContainer();//no default contructor
94 private: //member
95 const ::com::sun::star::uno::Type m_aType;
96 const rtl::OUString m_aServicename;
97 const rtl::OUString m_aImplementationName;
99 typedef ::std::map< ::rtl::OUString, com::sun::star::uno::Any > tContentMap;
101 tContentMap m_aMap;
104 //.............................................................................
105 } //namespace chart
106 //.............................................................................
107 #endif