Bump for 3.6-28
[LibreOffice.git] / chart2 / source / inc / NameContainer.hxx
blob9526fe5a895b3051961c9ac1c40d3355135c48d4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _CHART2_NAMECONTAINER_HXX
30 #define _CHART2_NAMECONTAINER_HXX
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/uno/XComponentContext.hpp>
35 #include <com/sun/star/util/XCloneable.hpp>
36 #include <cppuhelper/implbase3.hxx>
37 #include "charttoolsdllapi.hxx"
39 #include <map>
41 //.............................................................................
42 namespace chart
44 //.............................................................................
46 OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createNameContainer(
47 const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName );
49 namespace impl
51 typedef ::cppu::WeakImplHelper3<
52 ::com::sun::star::container::XNameContainer,
53 ::com::sun::star::lang::XServiceInfo,
54 ::com::sun::star::util::XCloneable >
55 NameContainer_Base;
58 class NameContainer : public impl::NameContainer_Base
60 public:
61 NameContainer( const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName );
62 explicit NameContainer( const NameContainer & rOther );
63 virtual ~NameContainer();
65 // XServiceInfo
66 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
67 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
68 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
70 // XNameContainer
71 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);
72 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);
74 // XNameReplace
75 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);
77 // XNameAccess
78 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);
79 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( com::sun::star::uno::RuntimeException);
80 virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw( com::sun::star::uno::RuntimeException);
82 // XElementAccess
83 virtual sal_Bool SAL_CALL hasElements( ) throw( com::sun::star::uno::RuntimeException);
84 virtual com::sun::star::uno::Type SAL_CALL getElementType( ) throw( com::sun::star::uno::RuntimeException);
86 // XCloneable
87 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw (::com::sun::star::uno::RuntimeException);
89 private: //methods
90 NameContainer();//no default contructor
92 private: //member
93 const ::com::sun::star::uno::Type m_aType;
94 const rtl::OUString m_aServicename;
95 const rtl::OUString m_aImplementationName;
97 typedef ::std::map< ::rtl::OUString, com::sun::star::uno::Any > tContentMap;
99 tContentMap m_aMap;
102 //.............................................................................
103 } //namespace chart
104 //.............................................................................
105 #endif
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */