LibreOffice Module extensions (master) 1
MasterDetailLinkDialog.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 <sal/log.hxx>
21#include <com/sun/star/beans/PropertyValue.hpp>
22#include <vcl/svapp.hxx>
24#include "formlinkdialog.hxx"
25
26namespace pcr
27{
28
29
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::lang;
32 using namespace ::com::sun::star::beans;
33
34 MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference< XComponentContext >& _rxContext )
35 :OGenericUnoDialog( _rxContext )
36 {
37 }
38
39 Sequence<sal_Int8> SAL_CALL MasterDetailLinkDialog::getImplementationId( )
40 {
41 return css::uno::Sequence<sal_Int8>();
42 }
43
44
46 {
47 return "org.openoffice.comp.form.ui.MasterDetailLinkDialog";
48 }
49
50
51 css::uno::Sequence<OUString> SAL_CALL MasterDetailLinkDialog::getSupportedServiceNames()
52 {
53 return { "com.sun.star.form.MasterDetailLinkDialog" };
54 }
55
56
57 Reference<XPropertySetInfo> SAL_CALL MasterDetailLinkDialog::getPropertySetInfo()
58 {
59 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
60 return xInfo;
61 }
62
63
65 {
66 return *getArrayHelper();
67 }
68
69
71 {
72 Sequence< Property > aProps;
73 describeProperties(aProps);
74 return new ::cppu::OPropertyArrayHelper(aProps);
75 }
76
77 std::unique_ptr<weld::DialogController> MasterDetailLinkDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
78 {
79 return std::make_unique<FormLinkDialog>(Application::GetFrameWeld(rParent), m_xDetail,
82 }
83
85 {
86 PropertyValue aProperty;
87 if (_rValue >>= aProperty)
88 {
89 if (aProperty.Name == "Detail")
90 {
91 if ( ! (aProperty.Value >>= m_xDetail) )
92 SAL_WARN("extensions.propctrlr", "implInitialize: unable to get property Detail");
93 return;
94 }
95 else if (aProperty.Name == "Master")
96 {
97 if ( ! (aProperty.Value >>= m_xMaster) )
98 SAL_WARN("extensions.propctrlr", "implInitialize: unable to get property Master");
99 return;
100 }
101 else if (aProperty.Name == "Explanation")
102 {
103 if ( ! (aProperty.Value >>= m_sExplanation) )
104 SAL_WARN("extensions.propctrlr", "implInitialize: unable to get property Explanation");
105 return;
106 }
107 else if (aProperty.Name == "DetailLabel")
108 {
109 if ( ! (aProperty.Value >>= m_sDetailLabel) )
110 SAL_WARN("extensions.propctrlr", "implInitialize: unable to get property DetailLabel");
111 return;
112 }
113 else if (aProperty.Name == "MasterLabel")
114 {
115 if ( ! (aProperty.Value >>= m_sMasterLabel) )
116 SAL_WARN("extensions.propctrlr", "implInitialize: unable to get property MasterLabel");
117 return;
118 }
119 }
121 }
122
123
124} // namespace pcr
125
126extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
128 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
129{
130 return cppu::acquire(new pcr::MasterDetailLinkDialog(context));
131}
132
133/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * extensions_propctrlr_MasterDetailLinkDialog_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
::cppu::IPropertyArrayHelper * getArrayHelper()
virtual std::unique_ptr< weld::DialogController > createDialog(const css::uno::Reference< css::awt::XWindow > &rParent) override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
css::uno::Reference< css::beans::XPropertySet > m_xDetail
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::beans::XPropertySet > m_xMaster
MasterDetailLinkDialog(const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual OUString SAL_CALL getImplementationName() override
virtual void implInitialize(const css::uno::Any &_rValue) override
virtual void implInitialize(const css::uno::Any &_rValue)
css::uno::Reference< css::uno::XComponentContext > m_aContext
#define SAL_WARN(area, stream)
a property handler for any virtual string properties
Definition: browserline.cxx:39