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 #ifndef INCLUDED_FORMS_SOURCE_COMPONENT_FORMSCOLLECTION_HXX
21 #define INCLUDED_FORMS_SOURCE_COMPONENT_FORMSCOLLECTION_HXX
23 #include "InterfaceContainer.hxx"
24 #include <cppuhelper/component.hxx>
25 #include <cppuhelper/implbase2.hxx>
26 #include <comphelper/uno3.hxx>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/form/XForms.hpp>
35 // Implements the UNO Container for Forms and contains all assigend Forms.
36 // It can either represent the Context for Forms or be passed a Context.
38 typedef ::cppu::OComponentHelper FormsCollectionComponentBase
;
39 typedef ::cppu::ImplHelper2
< ::com::sun::star::form::XForms
40 ,::com::sun::star::lang::XServiceInfo
> OFormsCollection_BASE
;
42 // else MSVC kills itself on some statements
43 class OFormsCollection
44 :public FormsCollectionComponentBase
45 ,public OInterfaceContainer
46 ,public OFormsCollection_BASE
48 ::osl::Mutex m_aMutex
;
49 ::comphelper::InterfaceRef m_xParent
; // Parent
52 OFormsCollection(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxFactory
);
53 OFormsCollection( const OFormsCollection
& _cloneSource
);
54 virtual ~OFormsCollection();
57 DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection
, FormsCollectionComponentBase
)
59 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation(const ::com::sun::star::uno::Type
& _rType
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
62 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
63 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
66 virtual OUString SAL_CALL
getServiceName() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
69 virtual OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
70 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
71 virtual StringSequence SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
74 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
77 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
79 // ::com::sun::star::container::XChild
80 virtual ::comphelper::InterfaceRef SAL_CALL
getParent() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual void SAL_CALL
setParent(const ::comphelper::InterfaceRef
& Parent
) throw(::com::sun::star::lang::NoSupportException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 // prevent method hiding
84 using OInterfaceContainer::disposing
;
86 // inheritance ambiguity
87 virtual com::sun::star::uno::Type SAL_CALL
getElementType() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
88 { return OInterfaceContainer::getElementType(); }
89 virtual sal_Bool SAL_CALL
hasElements() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
90 { return OInterfaceContainer::hasElements(); }
91 virtual com::sun::star::uno::Any SAL_CALL
getByName(const rtl::OUString
& p1
)
92 throw (css::container::NoSuchElementException
,
93 css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
94 { return OInterfaceContainer::getByName(p1
); }
95 virtual com::sun::star::uno::Sequence
<rtl::OUString
> SAL_CALL
getElementNames() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
96 { return OInterfaceContainer::getElementNames(); }
97 virtual sal_Bool SAL_CALL
hasByName(const rtl::OUString
& p1
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
98 { return OInterfaceContainer::hasByName(p1
); }
99 virtual void SAL_CALL
replaceByName(const rtl::OUString
& p1
, const com::sun::star::uno::Any
& p2
)
100 throw (css::lang::IllegalArgumentException
,
101 css::container::NoSuchElementException
,
102 css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
103 { OInterfaceContainer::replaceByName(p1
, p2
); }
104 virtual void SAL_CALL
insertByName(const rtl::OUString
& p1
, const com::sun::star::uno::Any
& p2
)
105 throw (css::lang::IllegalArgumentException
,
106 css::container::ElementExistException
,
107 css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
108 { OInterfaceContainer::insertByName(p1
, p2
); }
109 virtual void SAL_CALL
removeByName(const rtl::OUString
& p1
)
110 throw (css::container::NoSuchElementException
,
111 css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
112 { OInterfaceContainer::removeByName(p1
); }
113 virtual sal_Int32 SAL_CALL
getCount() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
114 { return OInterfaceContainer::getCount(); }
115 virtual com::sun::star::uno::Any SAL_CALL
getByIndex(sal_Int32 p1
)
116 throw (css::lang::IndexOutOfBoundsException
,
117 css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
118 { return OInterfaceContainer::getByIndex(p1
); }
119 virtual void SAL_CALL
replaceByIndex(sal_Int32 p1
, const com::sun::star::uno::Any
& p2
)
120 throw (css::lang::IllegalArgumentException
,
121 css::lang::IndexOutOfBoundsException
,
122 css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
123 { return OInterfaceContainer::replaceByIndex(p1
, p2
); }
124 virtual void SAL_CALL
insertByIndex(sal_Int32 p1
, const com::sun::star::uno::Any
& p2
)
125 throw (css::lang::IllegalArgumentException
,
126 css::lang::IndexOutOfBoundsException
,
127 css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
128 { return OInterfaceContainer::insertByIndex(p1
, p2
); }
129 virtual void SAL_CALL
removeByIndex(sal_Int32 p1
)
130 throw (css::lang::IndexOutOfBoundsException
,
131 css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
132 { return OInterfaceContainer::removeByIndex(p1
); }
133 virtual com::sun::star::uno::Reference
<com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
134 { return OInterfaceContainer::createEnumeration(); }
135 virtual void SAL_CALL
registerScriptEvent(sal_Int32 p1
, const com::sun::star::script::ScriptEventDescriptor
& p2
)
136 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
137 { OInterfaceContainer::registerScriptEvent(p1
, p2
); }
138 virtual void SAL_CALL
registerScriptEvents(sal_Int32 p1
, const com::sun::star::uno::Sequence
<com::sun::star::script::ScriptEventDescriptor
>& p2
)
139 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
140 { OInterfaceContainer::registerScriptEvents(p1
, p2
); }
141 virtual void SAL_CALL
revokeScriptEvent(sal_Int32 p1
, const rtl::OUString
& p2
, const rtl::OUString
& p3
, const rtl::OUString
& p4
)
142 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
143 { OInterfaceContainer::revokeScriptEvent(p1
, p2
, p3
, p4
); }
144 virtual void SAL_CALL
revokeScriptEvents(sal_Int32 p1
)
145 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
146 { OInterfaceContainer::revokeScriptEvents(p1
); }
147 virtual void SAL_CALL
insertEntry(sal_Int32 p1
)
148 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
149 { OInterfaceContainer::insertEntry(p1
); }
150 virtual void SAL_CALL
removeEntry(sal_Int32 p1
)
151 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
152 { OInterfaceContainer::removeEntry(p1
); }
153 virtual com::sun::star::uno::Sequence
<com::sun::star::script::ScriptEventDescriptor
> SAL_CALL
getScriptEvents(sal_Int32 p1
)
154 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
155 { return OInterfaceContainer::getScriptEvents(p1
); }
156 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
)
157 throw (css::lang::IllegalArgumentException
,
158 css::lang::ServiceNotRegisteredException
,
159 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
160 { OInterfaceContainer::attach(p1
, p2
, p3
); }
161 virtual void SAL_CALL
detach(sal_Int32 p1
, const com::sun::star::uno::Reference
<com::sun::star::uno::XInterface
>& p2
)
162 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
163 { OInterfaceContainer::detach(p1
, p2
); }
164 virtual void SAL_CALL
addScriptListener(const com::sun::star::uno::Reference
<com::sun::star::script::XScriptListener
>& p1
)
165 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
166 { OInterfaceContainer::addScriptListener(p1
); }
167 virtual void SAL_CALL
removeScriptListener(const com::sun::star::uno::Reference
<com::sun::star::script::XScriptListener
>& p1
)
168 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
169 { OInterfaceContainer::removeScriptListener(p1
); }
170 virtual void SAL_CALL
dispose() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
171 { FormsCollectionComponentBase::dispose(); }
172 virtual void SAL_CALL
addEventListener(const com::sun::star::uno::Reference
<com::sun::star::lang::XEventListener
>& p1
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
173 { FormsCollectionComponentBase::addEventListener(p1
); }
174 virtual void SAL_CALL
removeEventListener(const com::sun::star::uno::Reference
<com::sun::star::lang::XEventListener
>& p1
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
175 { FormsCollectionComponentBase::removeEventListener(p1
); }
176 virtual void SAL_CALL
addContainerListener(const com::sun::star::uno::Reference
<com::sun::star::container::XContainerListener
>& p1
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
177 { OInterfaceContainer::addContainerListener(p1
); }
178 virtual void SAL_CALL
removeContainerListener(const com::sun::star::uno::Reference
<com::sun::star::container::XContainerListener
>& p1
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
179 { OInterfaceContainer::removeContainerListener(p1
); }
186 #endif // INCLUDED_FORMS_SOURCE_COMPONENT_FORMSCOLLECTION_HXX
188 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */