xref: /trunk/main/framework/inc/helper/propertysetcontainer.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef __FRAMEWORK_HELPER_PROPERTYSETCONTAINER_HXX_
25 #define __FRAMEWORK_HELPER_PROPERTYSETCONTAINER_HXX_
26 
27 /** Attention: stl headers must(!) be included at first. Otherwise it can make trouble
28                with solaris headers ...
29 */
30 #include <vector>
31 #include <cppuhelper/weak.hxx>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/container/XIndexContainer.hpp>
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <threadhelp/threadhelpbase.hxx>
36 #include <framework/fwedllapi.h>
37 
38 namespace framework
39 {
40 
41 class FWE_DLLPUBLIC PropertySetContainer : public com::sun::star::container::XIndexContainer    ,
42                              public ThreadHelpBase                              ,   // Struct for right initialization of mutex member! Must be first of baseclasses.
43                              public ::cppu::OWeakObject
44 {
45     public:
46         PropertySetContainer( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& );
47         virtual ~PropertySetContainer();
48 
49         // XInterface
50         virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType );
51         virtual void SAL_CALL acquire() throw ();
52         virtual void SAL_CALL release() throw ();
53 
54         // XIndexContainer
55         virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element );
56 
57         virtual void SAL_CALL removeByIndex( sal_Int32 Index );
58 
59         // XIndexReplace
60         virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element );
61 
62         // XIndexAccess
63         virtual sal_Int32 SAL_CALL getCount();
64 
65         virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
66 
67         // XElementAccess
getElementType()68         virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
69         {
70             return ::getCppuType((com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >*)0);
71         }
72 
73         virtual sal_Bool SAL_CALL hasElements();
74 
75     protected:
76         com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >    m_xServiceManager;
77 
78     private:
79         typedef std::vector< com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > > PropertySetVector;
80         PropertySetVector                                                               m_aPropertySetVector;
81 
82 };
83 
84 }
85 
86 #endif // __FRAMEWORK_CLASSES_PROPERTYSETCONTAINER_HXX_
87