1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include "InterfaceContainer.hxx"
29 #include "ids.hxx"
30 #include <cppuhelper/component.hxx>
31 #include <cppuhelper/implbase2.hxx>
32 #include <comphelper/uno3.hxx>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 
35 //.........................................................................
36 namespace frm
37 {
38 //.........................................................................
39 
40 //==================================================================
41 // OFormsCollection
42 // Implementiert den UNO-Container fuer Formulare
43 // enthaelt alle zugeordneten Forms
44 // dieses Container kann selbst den Context fuer Formulare darstellen
45 // oder aussen einen Context uebergeben bekommen
46 //==================================================================
47 typedef ::cppu::OComponentHelper FormsCollectionComponentBase;
48 typedef ::cppu::ImplHelper2<	::com::sun::star::container::XChild
49 								,::com::sun::star::lang::XServiceInfo > OFormsCollection_BASE;
50 
51 	// else MSVC kills itself on some statements
52 class OFormsCollection
53 		:public FormsCollectionComponentBase
54 		,public OInterfaceContainer
55 		,public OFormsCollection_BASE
56 {
57 	::osl::Mutex				m_aMutex;
58 	OImplementationIdsRef		m_aHoldIdHelper;
59 	::comphelper::InterfaceRef 	m_xParent;			// Parent
60 
61 public:
62 	OFormsCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
63     OFormsCollection( const OFormsCollection& _cloneSource );
64 	virtual ~OFormsCollection();
65 
66 public:
67 	DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection, FormsCollectionComponentBase);
68 
69 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException);
70 
71     // XTypeProvider
72 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
73     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
74 
75     // XPersistObject
76 	virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
77 
78     // XServiceInfo
79     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
80     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
81     virtual StringSequence SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
82 
83     // XCloneable
84     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone(  ) throw (::com::sun::star::uno::RuntimeException);
85 
86     // OComponentHelper
87 	virtual void SAL_CALL disposing();
88 
89     // ::com::sun::star::container::XChild
90 	virtual ::comphelper::InterfaceRef SAL_CALL getParent() throw(::com::sun::star::uno::RuntimeException);
91 	virtual void SAL_CALL setParent(const ::comphelper::InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
92 
93     // prevent method hiding
94     using OInterfaceContainer::disposing;
95 };
96 
97 //.........................................................................
98 }	// namespace frm
99 //.........................................................................
100 
101