1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "InterfaceContainer.hxx"
22 #include <cppuhelper/component.hxx>
23 #include <cppuhelper/implbase2.hxx>
24 #include <comphelper/uno3.hxx>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/form/XForms.hpp>
28 //.........................................................................
31 //.........................................................................
33 //==================================================================
35 // Implementiert den UNO-Container fuer Formulare
36 // enthaelt alle zugeordneten Forms
37 // dieses Container kann selbst den Context fuer Formulare darstellen
38 // oder aussen einen Context uebergeben bekommen
39 //==================================================================
40 typedef ::cppu::OComponentHelper FormsCollectionComponentBase
;
41 typedef ::cppu::ImplHelper2
< ::com::sun::star::form::XForms
42 ,::com::sun::star::lang::XServiceInfo
> OFormsCollection_BASE
;
44 // else MSVC kills itself on some statements
45 class OFormsCollection
46 :public FormsCollectionComponentBase
47 ,public OInterfaceContainer
48 ,public OFormsCollection_BASE
50 ::osl::Mutex m_aMutex
;
51 OImplementationIdsRef m_aHoldIdHelper
;
52 ::comphelper::InterfaceRef m_xParent
; // Parent
55 OFormsCollection(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxFactory
);
56 OFormsCollection( const OFormsCollection
& _cloneSource
);
57 virtual ~OFormsCollection();
60 DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection
, FormsCollectionComponentBase
);
62 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation(const ::com::sun::star::uno::Type
& _rType
) throw(::com::sun::star::uno::RuntimeException
);
65 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
);
66 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
69 virtual OUString SAL_CALL
getServiceName() throw(::com::sun::star::uno::RuntimeException
);
72 virtual OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
);
73 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
);
74 virtual StringSequence SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
77 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone( ) throw (::com::sun::star::uno::RuntimeException
);
80 virtual void SAL_CALL
disposing();
82 // ::com::sun::star::container::XChild
83 virtual ::comphelper::InterfaceRef SAL_CALL
getParent() throw(::com::sun::star::uno::RuntimeException
);
84 virtual void SAL_CALL
setParent(const ::comphelper::InterfaceRef
& Parent
) throw(::com::sun::star::lang::NoSupportException
, ::com::sun::star::uno::RuntimeException
);
86 // prevent method hiding
87 using OInterfaceContainer::disposing
;
89 // inheritance ambiguity
90 virtual com::sun::star::uno::Type SAL_CALL
getElementType() throw (css::uno::RuntimeException
)
91 { return OInterfaceContainer::getElementType(); }
92 virtual sal_Bool SAL_CALL
hasElements() throw (css::uno::RuntimeException
)
93 { return OInterfaceContainer::hasElements(); }
94 virtual com::sun::star::uno::Any SAL_CALL
getByName(const rtl::OUString
& p1
)
95 throw (css::container::NoSuchElementException
,
96 css::lang::WrappedTargetException
, css::uno::RuntimeException
)
97 { return OInterfaceContainer::getByName(p1
); }
98 virtual com::sun::star::uno::Sequence
<rtl::OUString
> SAL_CALL
getElementNames() throw (css::uno::RuntimeException
)
99 { return OInterfaceContainer::getElementNames(); }
100 virtual sal_Bool SAL_CALL
hasByName(const rtl::OUString
& p1
) throw (css::uno::RuntimeException
)
101 { return OInterfaceContainer::hasByName(p1
); }
102 virtual void SAL_CALL
replaceByName(const rtl::OUString
& p1
, const com::sun::star::uno::Any
& p2
)
103 throw (css::lang::IllegalArgumentException
,
104 css::container::NoSuchElementException
,
105 css::lang::WrappedTargetException
, css::uno::RuntimeException
)
106 { OInterfaceContainer::replaceByName(p1
, p2
); }
107 virtual void SAL_CALL
insertByName(const rtl::OUString
& p1
, const com::sun::star::uno::Any
& p2
)
108 throw (css::lang::IllegalArgumentException
,
109 css::container::ElementExistException
,
110 css::lang::WrappedTargetException
, css::uno::RuntimeException
)
111 { OInterfaceContainer::insertByName(p1
, p2
); }
112 virtual void SAL_CALL
removeByName(const rtl::OUString
& p1
)
113 throw (css::container::NoSuchElementException
,
114 css::lang::WrappedTargetException
, css::uno::RuntimeException
)
115 { OInterfaceContainer::removeByName(p1
); }
116 virtual sal_Int32 SAL_CALL
getCount() throw (css::uno::RuntimeException
)
117 { return OInterfaceContainer::getCount(); }
118 virtual com::sun::star::uno::Any SAL_CALL
getByIndex(sal_Int32 p1
)
119 throw (css::lang::IndexOutOfBoundsException
,
120 css::lang::WrappedTargetException
, css::uno::RuntimeException
)
121 { return OInterfaceContainer::getByIndex(p1
); }
122 virtual void SAL_CALL
replaceByIndex(sal_Int32 p1
, const com::sun::star::uno::Any
& p2
)
123 throw (css::lang::IllegalArgumentException
,
124 css::lang::IndexOutOfBoundsException
,
125 css::lang::WrappedTargetException
, css::uno::RuntimeException
)
126 { return OInterfaceContainer::replaceByIndex(p1
, p2
); }
127 virtual void SAL_CALL
insertByIndex(sal_Int32 p1
, const com::sun::star::uno::Any
& p2
)
128 throw (css::lang::IllegalArgumentException
,
129 css::lang::IndexOutOfBoundsException
,
130 css::lang::WrappedTargetException
, css::uno::RuntimeException
)
131 { return OInterfaceContainer::insertByIndex(p1
, p2
); }
132 virtual void SAL_CALL
removeByIndex(sal_Int32 p1
)
133 throw (css::lang::IndexOutOfBoundsException
,
134 css::lang::WrappedTargetException
, css::uno::RuntimeException
)
135 { return OInterfaceContainer::removeByIndex(p1
); }
136 virtual com::sun::star::uno::Reference
<com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration() throw (css::uno::RuntimeException
)
137 { return OInterfaceContainer::createEnumeration(); }
138 virtual void SAL_CALL
registerScriptEvent(sal_Int32 p1
, const com::sun::star::script::ScriptEventDescriptor
& p2
)
139 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
140 { OInterfaceContainer::registerScriptEvent(p1
, p2
); }
141 virtual void SAL_CALL
registerScriptEvents(sal_Int32 p1
, const com::sun::star::uno::Sequence
<com::sun::star::script::ScriptEventDescriptor
>& p2
)
142 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
143 { OInterfaceContainer::registerScriptEvents(p1
, p2
); }
144 virtual void SAL_CALL
revokeScriptEvent(sal_Int32 p1
, const rtl::OUString
& p2
, const rtl::OUString
& p3
, const rtl::OUString
& p4
)
145 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
146 { OInterfaceContainer::revokeScriptEvent(p1
, p2
, p3
, p4
); }
147 virtual void SAL_CALL
revokeScriptEvents(sal_Int32 p1
)
148 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
149 { OInterfaceContainer::revokeScriptEvents(p1
); }
150 virtual void SAL_CALL
insertEntry(sal_Int32 p1
)
151 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
152 { OInterfaceContainer::insertEntry(p1
); }
153 virtual void SAL_CALL
removeEntry(sal_Int32 p1
)
154 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
155 { OInterfaceContainer::removeEntry(p1
); }
156 virtual com::sun::star::uno::Sequence
<com::sun::star::script::ScriptEventDescriptor
> SAL_CALL
getScriptEvents(sal_Int32 p1
)
157 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
158 { return OInterfaceContainer::getScriptEvents(p1
); }
159 virtual void SAL_CALL
attach(sal_Int32 p1
, const com::sun::star::uno::Reference
<com::sun::star::uno::XInterface
>& p2
, const com::sun::star::uno::Any
& p3
)
160 throw (css::lang::IllegalArgumentException
,
161 css::lang::ServiceNotRegisteredException
,
162 css::uno::RuntimeException
)
163 { OInterfaceContainer::attach(p1
, p2
, p3
); }
164 virtual void SAL_CALL
detach(sal_Int32 p1
, const com::sun::star::uno::Reference
<com::sun::star::uno::XInterface
>& p2
)
165 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
166 { OInterfaceContainer::detach(p1
, p2
); }
167 virtual void SAL_CALL
addScriptListener(const com::sun::star::uno::Reference
<com::sun::star::script::XScriptListener
>& p1
)
168 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
169 { OInterfaceContainer::addScriptListener(p1
); }
170 virtual void SAL_CALL
removeScriptListener(const com::sun::star::uno::Reference
<com::sun::star::script::XScriptListener
>& p1
)
171 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
)
172 { OInterfaceContainer::removeScriptListener(p1
); }
173 virtual void SAL_CALL
dispose() throw (css::uno::RuntimeException
)
174 { FormsCollectionComponentBase::dispose(); }
175 virtual void SAL_CALL
addEventListener(const com::sun::star::uno::Reference
<com::sun::star::lang::XEventListener
>& p1
) throw (css::uno::RuntimeException
)
176 { FormsCollectionComponentBase::addEventListener(p1
); }
177 virtual void SAL_CALL
removeEventListener(const com::sun::star::uno::Reference
<com::sun::star::lang::XEventListener
>& p1
) throw (css::uno::RuntimeException
)
178 { FormsCollectionComponentBase::removeEventListener(p1
); }
179 virtual void SAL_CALL
addContainerListener(const com::sun::star::uno::Reference
<com::sun::star::container::XContainerListener
>& p1
) throw (css::uno::RuntimeException
)
180 { OInterfaceContainer::addContainerListener(p1
); }
181 virtual void SAL_CALL
removeContainerListener(const com::sun::star::uno::Reference
<com::sun::star::container::XContainerListener
>& p1
) throw (css::uno::RuntimeException
)
182 { OInterfaceContainer::removeContainerListener(p1
); }
185 //.........................................................................
187 //.........................................................................
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */