LibreOffice Module extensions (master) 1
pcrunodialogs.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/config.h>
21
22#include <com/sun/star/beans/NamedValue.hpp>
23#include <com/sun/star/beans/PropertyAttribute.hpp>
24#include <com/sun/star/awt/XWindow.hpp>
25#include <vcl/svapp.hxx>
26#include "pcrunodialogs.hxx"
27#include "formstrings.hxx"
28#include "pcrstrings.hxx"
29#include "taborder.hxx"
30#include "pcrcommon.hxx"
31
32
33namespace pcr
34{
35
36
37 using namespace ::com::sun::star::uno;
38 using namespace ::com::sun::star::lang;
39 using namespace ::com::sun::star::beans;
40
41
42 //= OTabOrderDialog
43
44
45 OTabOrderDialog::OTabOrderDialog( const Reference< XComponentContext >& _rxContext )
46 :OGenericUnoDialog( _rxContext )
47 {
48 registerProperty( PROPERTY_CONTROLCONTEXT, static_cast<sal_Int32>(OwnPropertyId::CONTROLCONTEXT),
49 PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT,
51
52 registerProperty( PROPERTY_TABBINGMODEL, static_cast<sal_Int32>(OwnPropertyId::TABBINGMODEL),
53 PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT,
54 &m_xTabbingModel, cppu::UnoType<decltype(m_xTabbingModel)>::get() );
55 }
56
58 {
59 if (m_xDialog)
60 {
61 ::osl::MutexGuard aGuard( m_aMutex );
62 if (m_xDialog)
64 }
65 }
66
67 Sequence<sal_Int8> SAL_CALL OTabOrderDialog::getImplementationId( )
68 {
69 return css::uno::Sequence<sal_Int8>();
70 }
71
73 {
74 return "org.openoffice.comp.form.ui.OTabOrderDialog";
75 }
76
77
78 css::uno::Sequence<OUString> SAL_CALL OTabOrderDialog::getSupportedServiceNames()
79 {
80 return { "com.sun.star.form.ui.TabOrderDialog", "com.sun.star.form.TabOrderDialog" };
81 }
82
83
84 Reference<XPropertySetInfo> SAL_CALL OTabOrderDialog::getPropertySetInfo()
85 {
86 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
87 return xInfo;
88 }
89
91 {
92 return *getArrayHelper();
93 }
94
96 {
97 Sequence< Property > aProps;
98 describeProperties( aProps );
99 return new ::cppu::OPropertyArrayHelper( aProps );
100 }
101
102 std::unique_ptr<weld::DialogController> OTabOrderDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
103 {
104 return std::make_unique<TabOrderDialog>(Application::GetFrameWeld(rParent), m_xTabbingModel, m_xControlContext, m_aContext);
105 }
106
107 void OTabOrderDialog::initialize( const Sequence< Any >& aArguments )
108 {
109 Reference<css::awt::XTabControllerModel> xTabbingModel;
110 Reference<css::awt::XControlContainer> xControlContext;
111 Reference<css::awt::XWindow> xParentWindow;
112 if (aArguments.getLength() == 3 && (aArguments[0] >>= xTabbingModel) && (aArguments[1] >>= xControlContext) && (aArguments[2] >>= xParentWindow))
113 {
114 Sequence< Any > aNewArguments{
115 Any(NamedValue(
116 "TabbingModel",
117 Any( xTabbingModel )
118 )),
119 Any(NamedValue(
120 "ControlContext",
121 Any( xControlContext )
122 )),
123 Any(NamedValue(
124 "ParentWindow",
125 Any( xParentWindow )
126 ))
127 };
129 }
130 else
132 }
133
134} // namespace pcr
135
136extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
138 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
139{
140 return cppu::acquire(new pcr::OTabOrderDialog(context));
141}
142
143/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
::cppu::IPropertyArrayHelper * getArrayHelper()
OTabOrderDialog(const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual std::unique_ptr< weld::DialogController > createDialog(const css::uno::Reference< css::awt::XWindow > &rParent) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
css::uno::Reference< css::awt::XControlContainer > m_xControlContext
virtual OUString SAL_CALL getImplementationName() override
virtual ~OTabOrderDialog() override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
css::uno::Reference< css::awt::XTabControllerModel > m_xTabbingModel
std::unique_ptr< weld::DialogController > m_xDialog
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
css::uno::Reference< css::uno::XComponentContext > m_aContext
constexpr OUStringLiteral PROPERTY_CONTROLCONTEXT
Definition: formstrings.hxx:27
Sequence< PropertyValue > aArguments
::osl::Mutex m_aMutex
Definition: logger.cxx:98
a property handler for any virtual string properties
Definition: browserline.cxx:39
constexpr OUStringLiteral PROPERTY_TABBINGMODEL
Definition: pcrstrings.hxx:29
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * extensions_propcrltr_OTabOrderDialog_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)