LibreOffice Module forms (master) 1
FormsCollection.cxx
Go to the documentation of this file.
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 "FormsCollection.hxx"
23#include <sal/log.hxx>
24#include <com/sun/star/form/XForm.hpp>
25#include <rtl/ref.hxx>
26
27using namespace frm;
28using namespace ::com::sun::star::lang;
29using namespace ::com::sun::star::uno;
30using namespace ::com::sun::star::form;
31using namespace ::com::sun::star::container;
32using namespace ::com::sun::star::util;
33
34OUString SAL_CALL OFormsCollection::getServiceName()
35{
36 return "com.sun.star.form.Forms";
37}
38
40{
41 return css::uno::Sequence<sal_Int8>();
42}
43
44Sequence<Type> SAL_CALL OFormsCollection::getTypes()
45{
47}
48
49OFormsCollection::OFormsCollection(const Reference<XComponentContext>& _rxFactory)
50 : ::cppu::OComponentHelper( m_aMutex )
51 ,OInterfaceContainer( _rxFactory, m_aMutex, cppu::UnoType<XForm>::get() )
53{
54}
55
57 : ::cppu::OComponentHelper( m_aMutex )
58 ,OInterfaceContainer( m_aMutex, _cloneSource )
60{
61}
62
64{
65 if (!::cppu::OComponentHelper::rBHelper.bDisposed)
66 {
67 acquire();
68 dispose();
69 }
70}
71
73{
75 if (!aReturn.hasValue())
76 {
78
79 if (!aReturn.hasValue())
81 }
82
83 return aReturn;
84}
85
87{
88 return "com.sun.star.form.OFormsCollection";
89}
90
91sal_Bool SAL_CALL OFormsCollection::supportsService( const OUString& _rServiceName )
92{
93 return cppu::supportsService(this, _rServiceName);
94}
95
96css::uno::Sequence<OUString> SAL_CALL OFormsCollection::getSupportedServiceNames()
97{
98 return { "com.sun.star.form.Forms", "com.sun.star.form.FormComponents" };
99}
100
101// XCloneable
102Reference< XCloneable > SAL_CALL OFormsCollection::createClone( )
103{
105 pClone->clonedFrom( *this );
106 return static_cast<OInterfaceContainer*>(pClone.get());
107}
108
109// OComponentHelper
110
112{
113 {
114 SAL_INFO( "forms.component", "forms::OFormsCollection::disposing" );
116 }
118 m_xParent = nullptr;
119}
120
121//XChild
122
123void OFormsCollection::setParent(const css::uno::Reference<css::uno::XInterface>& Parent)
124{
125 ::osl::MutexGuard aGuard( m_aMutex );
127}
128
129css::uno::Reference<css::uno::XInterface> OFormsCollection::getParent()
130{
131 return m_xParent;
132}
133
134extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
135com_sun_star_form_OFormsCollection_get_implementation(css::uno::XComponentContext* context,
136 css::uno::Sequence<css::uno::Any> const &)
137{
138 return cppu::acquire(new frm::OFormsCollection(context));
139}
140
141/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_form_OFormsCollection_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL disposing()
virtual css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL disposing() override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::uno::XInterface > m_xParent
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
virtual void SAL_CALL dispose() override
virtual ~OFormsCollection() override
OFormsCollection(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
virtual void SAL_CALL disposing()
std::mutex m_aMutex
#define SAL_INFO(area, stream)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
Type
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
unsigned char sal_Bool