Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / extensions / source / propctrlr / pcrunodialogs.cxx
blobe54b9438a8fa07f9756f462e7758a8188d4f566a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <sal/config.h>
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 <toolkit/helper/vclunohelper.hxx>
26 #include <vcl/svapp.hxx>
27 #include "pcrservices.hxx"
28 #include "pcrunodialogs.hxx"
29 #include "formstrings.hxx"
30 #include "pcrstrings.hxx"
31 #include "taborder.hxx"
32 #include "pcrcommon.hxx"
34 extern "C" void createRegistryInfo_OTabOrderDialog()
36 ::pcr::OAutoRegistration< ::pcr::OTabOrderDialog > aAutoRegistration;
40 namespace pcr
44 using namespace ::com::sun::star::uno;
45 using namespace ::com::sun::star::lang;
46 using namespace ::com::sun::star::beans;
49 //= OTabOrderDialog
52 OTabOrderDialog::OTabOrderDialog( const Reference< XComponentContext >& _rxContext )
53 :OGenericUnoDialog( _rxContext )
55 registerProperty( PROPERTY_CONTROLCONTEXT, OWN_PROPERTY_ID_CONTROLCONTEXT,
56 PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT,
57 &m_xControlContext, cppu::UnoType<decltype(m_xControlContext)>::get() );
59 registerProperty( PROPERTY_TABBINGMODEL, OWN_PROPERTY_ID_TABBINGMODEL,
60 PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT,
61 &m_xTabbingModel, cppu::UnoType<decltype(m_xTabbingModel)>::get() );
64 OTabOrderDialog::~OTabOrderDialog()
66 if (m_xDialog)
68 ::osl::MutexGuard aGuard( m_aMutex );
69 if (m_xDialog)
70 destroyDialog();
74 Sequence<sal_Int8> SAL_CALL OTabOrderDialog::getImplementationId( )
76 return css::uno::Sequence<sal_Int8>();
80 Reference< XInterface > OTabOrderDialog::Create( const Reference< XComponentContext >& _rxContext )
82 return *( new OTabOrderDialog( _rxContext ) );
86 OUString SAL_CALL OTabOrderDialog::getImplementationName()
88 return getImplementationName_static();
92 OUString OTabOrderDialog::getImplementationName_static()
94 return "org.openoffice.comp.form.ui.OTabOrderDialog";
98 css::uno::Sequence<OUString> SAL_CALL OTabOrderDialog::getSupportedServiceNames()
100 return getSupportedServiceNames_static();
104 css::uno::Sequence<OUString> OTabOrderDialog::getSupportedServiceNames_static()
106 return css::uno::Sequence<OUString>{ "com.sun.star.form.ui.TabOrderDialog", "com.sun.star.form.TabOrderDialog" };
110 Reference<XPropertySetInfo> SAL_CALL OTabOrderDialog::getPropertySetInfo()
112 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
113 return xInfo;
116 ::cppu::IPropertyArrayHelper& OTabOrderDialog::getInfoHelper()
118 return *getArrayHelper();
121 ::cppu::IPropertyArrayHelper* OTabOrderDialog::createArrayHelper( ) const
123 Sequence< Property > aProps;
124 describeProperties( aProps );
125 return new ::cppu::OPropertyArrayHelper( aProps );
128 std::unique_ptr<weld::DialogController> OTabOrderDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
130 return std::make_unique<TabOrderDialog>(Application::GetFrameWeld(rParent), m_xTabbingModel, m_xControlContext, m_aContext);
133 void OTabOrderDialog::initialize( const Sequence< Any >& aArguments )
135 Reference<css::awt::XTabControllerModel> xTabbingModel;
136 Reference<css::awt::XControlContainer> xControlContext;
137 Reference<css::awt::XWindow> xParentWindow;
138 if (aArguments.getLength() == 3 && (aArguments[0] >>= xTabbingModel) && (aArguments[1] >>= xControlContext) && (aArguments[2] >>= xParentWindow))
140 Sequence< Any > aNewArguments( 3 );
141 aNewArguments[0] <<= NamedValue(
142 "TabbingModel",
143 makeAny( xTabbingModel )
145 aNewArguments[1] <<= NamedValue(
146 "ControlContext",
147 makeAny( xControlContext )
149 aNewArguments[2] <<= NamedValue(
150 "ParentWindow",
151 makeAny( xParentWindow )
153 OTabOrderDialog_DBase::initialize(aNewArguments);
155 else
156 OTabOrderDialog_DBase::initialize(aArguments);
160 } // namespace pcr
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */