update dev300-m58
[ooovba.git] / framework / inc / helper / propertysetcontainer.hxx
blobb16e90730cdab05bdf56786ad353c38ab65ff546
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: propertysetcontainer.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 __FRAMEWORK_HELPER_PROPERTYSETCONTAINER_HXX_
32 #define __FRAMEWORK_HELPER_PROPERTYSETCONTAINER_HXX_
34 /** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
35 with solaris headers ...
37 #include <vector>
38 #include <cppuhelper/weak.hxx>
39 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
40 #include <com/sun/star/container/XIndexContainer.hpp>
41 #include <com/sun/star/beans/XPropertySet.hpp>
42 #include <threadhelp/threadhelpbase.hxx>
44 namespace framework
47 class PropertySetContainer : public com::sun::star::container::XIndexContainer ,
48 public ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
49 public ::cppu::OWeakObject
51 public:
52 PropertySetContainer( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& );
53 virtual ~PropertySetContainer();
55 // XInterface
56 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
57 throw (::com::sun::star::uno::RuntimeException);
58 virtual void SAL_CALL acquire() throw ();
59 virtual void SAL_CALL release() throw ();
61 // XIndexContainer
62 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
63 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
65 virtual void SAL_CALL removeByIndex( sal_Int32 Index )
66 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
68 // XIndexReplace
69 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
70 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
72 // XIndexAccess
73 virtual sal_Int32 SAL_CALL getCount()
74 throw (::com::sun::star::uno::RuntimeException);
76 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
77 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
79 // XElementAccess
80 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
81 throw (::com::sun::star::uno::RuntimeException)
83 return ::getCppuType((com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >*)0);
86 virtual sal_Bool SAL_CALL hasElements()
87 throw (::com::sun::star::uno::RuntimeException);
89 protected:
90 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
92 private:
93 typedef std::vector< com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > > PropertySetVector;
94 PropertySetVector m_aPropertySetVector;
100 #endif // __FRAMEWORK_CLASSES_PROPERTYSETCONTAINER_HXX_