bump product version to 5.0.4.1
[LibreOffice.git] / extensions / source / propctrlr / pcrunodialogs.cxx
blob98c4b49ad590634ab1d761a55d9a0ed6d5a068e5
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>
24 #include "pcrservices.hxx"
25 #include "pcrunodialogs.hxx"
26 #include "formstrings.hxx"
27 #include "pcrstrings.hxx"
28 #include "taborder.hxx"
29 #include "pcrcommon.hxx"
31 extern "C" void SAL_CALL createRegistryInfo_OTabOrderDialog()
33 ::pcr::OAutoRegistration< ::pcr::OTabOrderDialog > aAutoRegistration;
37 namespace pcr
41 using namespace ::com::sun::star::uno;
42 using namespace ::com::sun::star::lang;
43 using namespace ::com::sun::star::beans;
46 //= OTabOrderDialog
49 OTabOrderDialog::OTabOrderDialog( const Reference< XComponentContext >& _rxContext )
50 :OGenericUnoDialog( _rxContext )
52 registerProperty( PROPERTY_CONTROLCONTEXT, OWN_PROPERTY_ID_CONTROLCONTEXT,
53 PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT,
54 &m_xControlContext, cppu::UnoType<decltype(m_xControlContext)>::get() );
56 registerProperty( PROPERTY_TABBINGMODEL, OWN_PROPERTY_ID_TABBINGMODEL,
57 PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT,
58 &m_xTabbingModel, cppu::UnoType<decltype(m_xTabbingModel)>::get() );
62 OTabOrderDialog::~OTabOrderDialog()
64 if ( m_pDialog )
66 ::osl::MutexGuard aGuard( m_aMutex );
67 if ( m_pDialog )
68 destroyDialog();
73 Sequence<sal_Int8> SAL_CALL OTabOrderDialog::getImplementationId( ) throw(RuntimeException, std::exception)
75 return css::uno::Sequence<sal_Int8>();
79 Reference< XInterface > SAL_CALL OTabOrderDialog::Create( const Reference< XComponentContext >& _rxContext )
81 return *( new OTabOrderDialog( _rxContext ) );
85 OUString SAL_CALL OTabOrderDialog::getImplementationName() throw(RuntimeException, std::exception)
87 return getImplementationName_static();
91 OUString OTabOrderDialog::getImplementationName_static() throw(RuntimeException)
93 return OUString("org.openoffice.comp.form.ui.OTabOrderDialog");
97 ::comphelper::StringSequence SAL_CALL OTabOrderDialog::getSupportedServiceNames() throw(RuntimeException, std::exception)
99 return getSupportedServiceNames_static();
103 ::comphelper::StringSequence OTabOrderDialog::getSupportedServiceNames_static() throw(RuntimeException)
105 ::comphelper::StringSequence aSupported(2);
106 aSupported.getArray()[0] = "com.sun.star.form.ui.TabOrderDialog";
107 aSupported.getArray()[1] = "com.sun.star.form.TabOrderDialog";
108 return aSupported;
112 Reference<XPropertySetInfo> SAL_CALL OTabOrderDialog::getPropertySetInfo() throw(RuntimeException, std::exception)
114 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
115 return xInfo;
119 ::cppu::IPropertyArrayHelper& OTabOrderDialog::getInfoHelper()
121 return *getArrayHelper();
125 ::cppu::IPropertyArrayHelper* OTabOrderDialog::createArrayHelper( ) const
127 Sequence< Property > aProps;
128 describeProperties( aProps );
129 return new ::cppu::OPropertyArrayHelper( aProps );
133 VclPtr<Dialog> OTabOrderDialog::createDialog( vcl::Window* _pParent )
135 return VclPtr<TabOrderDialog>::Create( _pParent, m_xTabbingModel, m_xControlContext, m_aContext );
138 void OTabOrderDialog::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException, std::exception)
140 Reference<css::awt::XTabControllerModel> xTabbingModel;
141 Reference<css::awt::XControlContainer> xControlContext;
142 Reference<css::awt::XWindow> xParentWindow;
143 if (aArguments.getLength() == 3 && (aArguments[0] >>= xTabbingModel) && (aArguments[1] >>= xControlContext) && (aArguments[2] >>= xParentWindow))
145 Sequence< Any > aNewArguments( 3 );
146 aNewArguments[0] <<= NamedValue(
147 OUString( "TabbingModel" ),
148 makeAny( xTabbingModel )
150 aNewArguments[1] <<= NamedValue(
151 OUString( "ControlContext" ),
152 makeAny( xControlContext )
154 aNewArguments[2] <<= NamedValue(
155 OUString( "ParentWindow" ),
156 makeAny( xParentWindow )
158 OTabOrderDialog_DBase::initialize(aNewArguments);
160 else
161 OTabOrderDialog_DBase::initialize(aArguments);
167 } // namespace pcr
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */