Use correct object
[LibreOffice.git] / dbaccess / source / ui / uno / DBTypeWizDlgSetup.cxx
blob4ed229a3b9d762ee19d90bf9430d9b2f3d224799
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 "DBTypeWizDlgSetup.hxx"
21 #include <dbwizsetup.hxx>
22 #include <com/sun/star/beans/PropertyAttribute.hpp>
23 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
24 #include <vcl/svapp.hxx>
26 using namespace dbaui;
28 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
29 org_openoffice_comp_dbu_ODBTypeWizDialogSetup_get_implementation(
30 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& )
32 return cppu::acquire(new ODBTypeWizDialogSetup(context));
35 namespace dbaui
38 using namespace ::com::sun::star::uno;
39 using namespace ::com::sun::star::beans;
41 ODBTypeWizDialogSetup::ODBTypeWizDialogSetup(const Reference< XComponentContext >& _rxORB)
42 :ODatabaseAdministrationDialog(_rxORB)
43 ,m_bOpenDatabase(true)
44 ,m_bStartTableWizard(false)
46 registerProperty(u"OpenDatabase"_ustr, 3, PropertyAttribute::TRANSIENT,
47 &m_bOpenDatabase, cppu::UnoType<bool>::get());
49 registerProperty(u"StartTableWizard"_ustr, 4, PropertyAttribute::TRANSIENT,
50 &m_bStartTableWizard, cppu::UnoType<bool>::get());
53 Sequence<sal_Int8> SAL_CALL ODBTypeWizDialogSetup::getImplementationId( )
55 return css::uno::Sequence<sal_Int8>();
58 OUString SAL_CALL ODBTypeWizDialogSetup::getImplementationName()
60 return u"org.openoffice.comp.dbu.ODBTypeWizDialogSetup"_ustr;
63 css::uno::Sequence<OUString> SAL_CALL ODBTypeWizDialogSetup::getSupportedServiceNames()
65 return { u"com.sun.star.sdb.DatabaseWizardDialog"_ustr };
68 Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialogSetup::getPropertySetInfo()
70 return createPropertySetInfo( getInfoHelper() );
73 ::cppu::IPropertyArrayHelper& ODBTypeWizDialogSetup::getInfoHelper()
75 return *getArrayHelper();
78 ::cppu::IPropertyArrayHelper* ODBTypeWizDialogSetup::createArrayHelper( ) const
80 Sequence< Property > aProps;
81 describeProperties(aProps);
82 return new ::cppu::OPropertyArrayHelper(aProps);
85 std::unique_ptr<weld::DialogController> ODBTypeWizDialogSetup::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
87 return std::make_unique<ODbTypeWizDialogSetup>(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(), m_aContext, m_aInitialSelection);
90 void ODBTypeWizDialogSetup::executedDialog(sal_Int16 nExecutionResult)
92 if (nExecutionResult == css::ui::dialogs::ExecutableDialogResults::OK)
94 const ODbTypeWizDialogSetup* pDialog = static_cast<ODbTypeWizDialogSetup*>(m_xDialog.get());
95 m_bOpenDatabase = pDialog->IsDatabaseDocumentToBeOpened();
96 m_bStartTableWizard = pDialog->IsTableWizardToBeStarted();
100 } // namespace dbaui
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */