Update ooo320-m1
[ooovba.git] / svx / source / unodraw / UnoNameItemTable.hxx
blob5d4effba940b4b533d5aaae5c65e3b3ad71272dd
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: UnoNameItemTable.hxx,v $
10 * $Revision: 1.13 $
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 _SVX_UNONAMEITEMTABLE_HXX_
32 #define _SVX_UNONAMEITEMTABLE_HXX_
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/container/XNameContainer.hpp>
37 #include <cppuhelper/implbase2.hxx>
39 #include <vector>
40 #include <svtools/lstner.hxx>
41 #include <svx/xit.hxx>
43 #include <svx/xdef.hxx>
45 class SdrModel;
46 class SfxItemPool;
47 class SfxItemSet;
49 typedef std::vector< SfxItemSet* > ItemPoolVector;
50 class SvxUnoNameItemTable : public cppu::WeakImplHelper2< com::sun::star::container::XNameContainer, com::sun::star::lang::XServiceInfo >,
51 public SfxListener
53 private:
54 SdrModel* mpModel;
55 SfxItemPool* mpModelPool;
56 USHORT mnWhich;
57 BYTE mnMemberId;
59 ItemPoolVector maItemSetVector;
61 void SAL_CALL ImplInsertByName( const rtl::OUString& aName, const com::sun::star::uno::Any& aElement );
63 public:
64 SvxUnoNameItemTable( SdrModel* pModel, USHORT nWhich, BYTE nMemberId ) throw();
65 virtual ~SvxUnoNameItemTable() throw();
67 virtual NameOrIndex* createItem() const throw() = 0;
68 virtual bool isValid( const NameOrIndex* pItem ) const;
70 void dispose();
72 // SfxListener
73 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw ();
75 // XServiceInfo
76 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw( com::sun::star::uno::RuntimeException);
78 // XNameContainer
79 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);
80 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);
82 // XNameReplace
83 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);
85 // XNameAccess
86 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);
87 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( com::sun::star::uno::RuntimeException);
88 virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw( com::sun::star::uno::RuntimeException);
90 // XElementAccess
91 virtual sal_Bool SAL_CALL hasElements( ) throw( com::sun::star::uno::RuntimeException);
94 #endif // _SVX_UNONAMEITEMTABLE_HXX_