Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include "InterfaceContainer.hxx"
21 : #include "ids.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>
27 :
28 : //.........................................................................
29 : namespace frm
30 : {
31 : //.........................................................................
32 :
33 : //==================================================================
34 : // OFormsCollection
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;
43 :
44 : // else MSVC kills itself on some statements
45 : class OFormsCollection
46 : :public FormsCollectionComponentBase
47 : ,public OInterfaceContainer
48 : ,public OFormsCollection_BASE
49 : {
50 : ::osl::Mutex m_aMutex;
51 : OImplementationIdsRef m_aHoldIdHelper;
52 : ::comphelper::InterfaceRef m_xParent; // Parent
53 :
54 : public:
55 : OFormsCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
56 : OFormsCollection( const OFormsCollection& _cloneSource );
57 : virtual ~OFormsCollection();
58 :
59 : public:
60 32202 : DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection, FormsCollectionComponentBase);
61 :
62 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException);
63 :
64 : // XTypeProvider
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);
67 :
68 : // XPersistObject
69 : virtual OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
70 :
71 : // XServiceInfo
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);
75 :
76 : // XCloneable
77 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
78 :
79 : // OComponentHelper
80 : virtual void SAL_CALL disposing();
81 :
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);
85 :
86 : // prevent method hiding
87 : using OInterfaceContainer::disposing;
88 :
89 : // inheritance ambiguity
90 0 : virtual com::sun::star::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException)
91 0 : { return OInterfaceContainer::getElementType(); }
92 237 : virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException)
93 237 : { return OInterfaceContainer::hasElements(); }
94 3 : 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 3 : { return OInterfaceContainer::getByName(p1); }
98 0 : virtual com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL getElementNames() throw (css::uno::RuntimeException)
99 0 : { return OInterfaceContainer::getElementNames(); }
100 25 : virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& p1) throw (css::uno::RuntimeException)
101 25 : { return OInterfaceContainer::hasByName(p1); }
102 0 : 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 0 : { OInterfaceContainer::replaceByName(p1, p2); }
107 156 : 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 156 : { OInterfaceContainer::insertByName(p1, p2); }
112 0 : virtual void SAL_CALL removeByName(const rtl::OUString& p1)
113 : throw (css::container::NoSuchElementException,
114 : css::lang::WrappedTargetException, css::uno::RuntimeException)
115 0 : { OInterfaceContainer::removeByName(p1); }
116 1627 : virtual sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException)
117 1627 : { return OInterfaceContainer::getCount(); }
118 606 : 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 606 : { return OInterfaceContainer::getByIndex(p1); }
122 0 : 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 0 : { return OInterfaceContainer::replaceByIndex(p1, p2); }
127 1 : 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 1 : { return OInterfaceContainer::insertByIndex(p1, p2); }
132 0 : virtual void SAL_CALL removeByIndex(sal_Int32 p1)
133 : throw (css::lang::IndexOutOfBoundsException,
134 : css::lang::WrappedTargetException, css::uno::RuntimeException)
135 0 : { return OInterfaceContainer::removeByIndex(p1); }
136 0 : virtual com::sun::star::uno::Reference<com::sun::star::container::XEnumeration> SAL_CALL createEnumeration() throw (css::uno::RuntimeException)
137 0 : { return OInterfaceContainer::createEnumeration(); }
138 0 : virtual void SAL_CALL registerScriptEvent(sal_Int32 p1, const com::sun::star::script::ScriptEventDescriptor& p2)
139 : throw (css::lang::IllegalArgumentException, css::uno::RuntimeException)
140 0 : { OInterfaceContainer::registerScriptEvent(p1, p2); }
141 0 : 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 0 : { OInterfaceContainer::registerScriptEvents(p1, p2); }
144 0 : 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 0 : { OInterfaceContainer::revokeScriptEvent(p1, p2, p3, p4); }
147 0 : virtual void SAL_CALL revokeScriptEvents(sal_Int32 p1)
148 : throw (css::lang::IllegalArgumentException, css::uno::RuntimeException)
149 0 : { OInterfaceContainer::revokeScriptEvents(p1); }
150 0 : virtual void SAL_CALL insertEntry(sal_Int32 p1)
151 : throw (css::lang::IllegalArgumentException, css::uno::RuntimeException)
152 0 : { OInterfaceContainer::insertEntry(p1); }
153 0 : virtual void SAL_CALL removeEntry(sal_Int32 p1)
154 : throw (css::lang::IllegalArgumentException, css::uno::RuntimeException)
155 0 : { OInterfaceContainer::removeEntry(p1); }
156 0 : 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 0 : { return OInterfaceContainer::getScriptEvents(p1); }
159 71 : 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 71 : { OInterfaceContainer::attach(p1, p2, p3); }
164 71 : 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 71 : { OInterfaceContainer::detach(p1, p2); }
167 422 : 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 422 : { OInterfaceContainer::addScriptListener(p1); }
170 420 : 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 420 : { OInterfaceContainer::removeScriptListener(p1); }
173 210 : virtual void SAL_CALL dispose() throw (css::uno::RuntimeException)
174 210 : { FormsCollectionComponentBase::dispose(); }
175 0 : virtual void SAL_CALL addEventListener(const com::sun::star::uno::Reference<com::sun::star::lang::XEventListener>& p1) throw (css::uno::RuntimeException)
176 0 : { FormsCollectionComponentBase::addEventListener(p1); }
177 0 : virtual void SAL_CALL removeEventListener(const com::sun::star::uno::Reference<com::sun::star::lang::XEventListener>& p1) throw (css::uno::RuntimeException)
178 0 : { FormsCollectionComponentBase::removeEventListener(p1); }
179 339 : virtual void SAL_CALL addContainerListener(const com::sun::star::uno::Reference<com::sun::star::container::XContainerListener>& p1) throw (css::uno::RuntimeException)
180 339 : { OInterfaceContainer::addContainerListener(p1); }
181 338 : virtual void SAL_CALL removeContainerListener(const com::sun::star::uno::Reference<com::sun::star::container::XContainerListener>& p1) throw (css::uno::RuntimeException)
182 338 : { OInterfaceContainer::removeContainerListener(p1); }
183 : };
184 :
185 : //.........................................................................
186 : } // namespace frm
187 : //.........................................................................
188 :
189 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|