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 #pragma once 21 22 #include <InterfaceContainer.hxx> 23 #include <cppuhelper/component.hxx> 24 #include <cppuhelper/implbase2.hxx> 25 #include <comphelper/uno3.hxx> 26 #include <com/sun/star/lang/XServiceInfo.hpp> 27 #include <com/sun/star/form/XForms.hpp> 28 29 30 namespace frm 31 { 32 33 // OFormsCollection 34 // Implements the UNO Container for Forms and contains all assigned Forms. 35 // It can either represent the Context for Forms or be passed a Context. 36 37 typedef ::cppu::ImplHelper2< css::form::XForms 38 ,css::lang::XServiceInfo > OFormsCollection_BASE; 39 class OFormsCollection 40 :public ::cppu::OComponentHelper 41 ,public OInterfaceContainer 42 ,public OFormsCollection_BASE 43 { 44 ::osl::Mutex m_aMutex; 45 css::uno::Reference<css::uno::XInterface> m_xParent; // Parent 46 47 public: 48 explicit OFormsCollection(const css::uno::Reference< css::uno::XComponentContext>& _rxFactory); 49 OFormsCollection( const OFormsCollection& _cloneSource ); 50 virtual ~OFormsCollection() override; 51 52 public: 53 DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection, ::cppu::OComponentHelper) 54 55 virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type& _rType) override; 56 57 // XTypeProvider 58 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; 59 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; 60 61 // XPersistObject 62 virtual OUString SAL_CALL getServiceName() override; 63 64 // XServiceInfo 65 virtual OUString SAL_CALL getImplementationName( ) override; 66 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; 67 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames( ) override; 68 69 // XCloneable 70 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; 71 72 // OComponentHelper 73 virtual void SAL_CALL disposing() override; 74 75 // css::container::XChild 76 virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getParent() override; 77 virtual void SAL_CALL setParent(const css::uno::Reference<css::uno::XInterface>& Parent) override; 78 79 // prevent method hiding 80 using OInterfaceContainer::disposing; 81 82 // inheritance ambiguity getElementType()83 virtual css::uno::Type SAL_CALL getElementType() override 84 { return OInterfaceContainer::getElementType(); } hasElements()85 virtual sal_Bool SAL_CALL hasElements() override 86 { return OInterfaceContainer::hasElements(); } getByName(const OUString & p1)87 virtual css::uno::Any SAL_CALL getByName(const OUString& p1) override 88 { return OInterfaceContainer::getByName(p1); } getElementNames()89 virtual css::uno::Sequence<OUString> SAL_CALL getElementNames() override 90 { return OInterfaceContainer::getElementNames(); } hasByName(const OUString & p1)91 virtual sal_Bool SAL_CALL hasByName(const OUString& p1) override 92 { return OInterfaceContainer::hasByName(p1); } replaceByName(const OUString & p1,const css::uno::Any & p2)93 virtual void SAL_CALL replaceByName(const OUString& p1, const css::uno::Any& p2) override 94 { OInterfaceContainer::replaceByName(p1, p2); } insertByName(const OUString & p1,const css::uno::Any & p2)95 virtual void SAL_CALL insertByName(const OUString& p1, const css::uno::Any& p2) override 96 { OInterfaceContainer::insertByName(p1, p2); } removeByName(const OUString & p1)97 virtual void SAL_CALL removeByName(const OUString& p1) override 98 { OInterfaceContainer::removeByName(p1); } getCount()99 virtual sal_Int32 SAL_CALL getCount() override 100 { return OInterfaceContainer::getCount(); } getByIndex(sal_Int32 p1)101 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 p1) override 102 { return OInterfaceContainer::getByIndex(p1); } replaceByIndex(sal_Int32 p1,const css::uno::Any & p2)103 virtual void SAL_CALL replaceByIndex(sal_Int32 p1, const css::uno::Any& p2) override 104 { return OInterfaceContainer::replaceByIndex(p1, p2); } insertByIndex(sal_Int32 p1,const css::uno::Any & p2)105 virtual void SAL_CALL insertByIndex(sal_Int32 p1, const css::uno::Any& p2) override 106 { return OInterfaceContainer::insertByIndex(p1, p2); } removeByIndex(sal_Int32 p1)107 virtual void SAL_CALL removeByIndex(sal_Int32 p1) override 108 { return OInterfaceContainer::removeByIndex(p1); } createEnumeration()109 virtual css::uno::Reference<css::container::XEnumeration> SAL_CALL createEnumeration() override 110 { return OInterfaceContainer::createEnumeration(); } registerScriptEvent(sal_Int32 p1,const css::script::ScriptEventDescriptor & p2)111 virtual void SAL_CALL registerScriptEvent(sal_Int32 p1, const css::script::ScriptEventDescriptor& p2) override 112 { OInterfaceContainer::registerScriptEvent(p1, p2); } registerScriptEvents(sal_Int32 p1,const css::uno::Sequence<css::script::ScriptEventDescriptor> & p2)113 virtual void SAL_CALL registerScriptEvents(sal_Int32 p1, const css::uno::Sequence<css::script::ScriptEventDescriptor>& p2) override 114 { OInterfaceContainer::registerScriptEvents(p1, p2); } revokeScriptEvent(sal_Int32 p1,const OUString & p2,const OUString & p3,const OUString & p4)115 virtual void SAL_CALL revokeScriptEvent(sal_Int32 p1, const OUString& p2, const OUString& p3, const OUString& p4) override 116 { OInterfaceContainer::revokeScriptEvent(p1, p2, p3, p4); } revokeScriptEvents(sal_Int32 p1)117 virtual void SAL_CALL revokeScriptEvents(sal_Int32 p1) override 118 { OInterfaceContainer::revokeScriptEvents(p1); } insertEntry(sal_Int32 p1)119 virtual void SAL_CALL insertEntry(sal_Int32 p1) override 120 { OInterfaceContainer::insertEntry(p1); } removeEntry(sal_Int32 p1)121 virtual void SAL_CALL removeEntry(sal_Int32 p1) override 122 { OInterfaceContainer::removeEntry(p1); } getScriptEvents(sal_Int32 p1)123 virtual css::uno::Sequence<css::script::ScriptEventDescriptor> SAL_CALL getScriptEvents(sal_Int32 p1) override 124 { return OInterfaceContainer::getScriptEvents(p1); } attach(sal_Int32 p1,const css::uno::Reference<css::uno::XInterface> & p2,const css::uno::Any & p3)125 virtual void SAL_CALL attach(sal_Int32 p1, const css::uno::Reference<css::uno::XInterface>& p2, const css::uno::Any& p3) override 126 { OInterfaceContainer::attach(p1, p2, p3); } detach(sal_Int32 p1,const css::uno::Reference<css::uno::XInterface> & p2)127 virtual void SAL_CALL detach(sal_Int32 p1, const css::uno::Reference<css::uno::XInterface>& p2) override 128 { OInterfaceContainer::detach(p1, p2); } addScriptListener(const css::uno::Reference<css::script::XScriptListener> & p1)129 virtual void SAL_CALL addScriptListener(const css::uno::Reference<css::script::XScriptListener>& p1) override 130 { OInterfaceContainer::addScriptListener(p1); } removeScriptListener(const css::uno::Reference<css::script::XScriptListener> & p1)131 virtual void SAL_CALL removeScriptListener(const css::uno::Reference<css::script::XScriptListener>& p1) override 132 { OInterfaceContainer::removeScriptListener(p1); } dispose()133 virtual void SAL_CALL dispose() override 134 { ::cppu::OComponentHelper::dispose(); } addEventListener(const css::uno::Reference<css::lang::XEventListener> & p1)135 virtual void SAL_CALL addEventListener(const css::uno::Reference<css::lang::XEventListener>& p1) override 136 { ::cppu::OComponentHelper::addEventListener(p1); } removeEventListener(const css::uno::Reference<css::lang::XEventListener> & p1)137 virtual void SAL_CALL removeEventListener(const css::uno::Reference<css::lang::XEventListener>& p1) override 138 { ::cppu::OComponentHelper::removeEventListener(p1); } addContainerListener(const css::uno::Reference<css::container::XContainerListener> & p1)139 virtual void SAL_CALL addContainerListener(const css::uno::Reference<css::container::XContainerListener>& p1) override 140 { OInterfaceContainer::addContainerListener(p1); } removeContainerListener(const css::uno::Reference<css::container::XContainerListener> & p1)141 virtual void SAL_CALL removeContainerListener(const css::uno::Reference<css::container::XContainerListener>& p1) override 142 { OInterfaceContainer::removeContainerListener(p1); } 143 }; 144 145 146 } // namespace frm 147 148 149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 150