xref: /aoo4110/main/svx/inc/svx/unoshcol.hxx (revision b1cdbd2c)
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 #ifndef _SVX_UNOSHGRP_HXX
24 #define _SVX_UNOSHGRP_HXX
25 
26 #include <com/sun/star/lang/XComponent.hpp>
27 #include <com/sun/star/drawing/XShapes.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <osl/mutex.hxx>
30 #include <cppuhelper/interfacecontainer.hxx>
31 
32 #include <cppuhelper/implbase3.hxx>
33 #include "svx/svxdllapi.h"
34 
35 class XShapeList;
36 
37 class SvxShapeCollectionMutex
38 {
39 public:
40 	::osl::Mutex maMutex;
41 };
42 
43 SVX_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvxShapeCollection_NewInstance() throw();
44 
45 /***********************************************************************
46 *                                                                      *
47 ***********************************************************************/
48 class SVX_DLLPUBLIC SvxShapeCollection :	public ::cppu::WeakAggImplHelper3<
49 											::com::sun::star::drawing::XShapes,
50 											::com::sun::star::lang::XServiceInfo,
51 											::com::sun::star::lang::XComponent
52 											>,
53 							public SvxShapeCollectionMutex
54 {
55 private:
56 	cppu::OInterfaceContainerHelper maShapeContainer;
57 
58 	cppu::OBroadcastHelper mrBHelper;
59 
60 	SVX_DLLPRIVATE virtual void disposing() throw();
61 
62 public:
63 	SvxShapeCollection() throw();
64 	virtual ~SvxShapeCollection() throw();
65 
66 	// XInterface
67 	virtual void SAL_CALL release() throw();
68 
69 	// XComponent
70 	virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
71 	virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
72 	virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
73 
74 	// XIndexAccess
75     virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
76     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
77 
78 	// XElementAccess
79     virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
80     virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
81 
82 	// XShapes
83     virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
84     virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
85 
86 	// XServiceInfo
87     virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
88     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
89     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
90 	static com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static();
91 	static ::rtl::OUString getImplementationName_Static();
92 };
93 
94 ::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxShapeCollection_createInstance( const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
95 #endif
96 
97 
98