build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / dbaccess / source / ui / uno / DBTypeWizDlgSetup.cxx
blob26f34a031b1bdafa4e4681277113b6fe53115ba0
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 "dbu_reghelper.hxx"
21 #include "uiservices.hxx"
22 #include <com/sun/star/document/XEventListener.hpp>
23 #include <com/sun/star/container/XSet.hpp>
24 #include "DBTypeWizDlgSetup.hxx"
25 #include "dbwizsetup.hxx"
26 #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
27 #include <com/sun/star/sdbc/XDataSource.hpp>
28 #include <vcl/msgbox.hxx>
29 #include <comphelper/processfactory.hxx>
31 using namespace dbaui;
33 extern "C" void SAL_CALL createRegistryInfo_ODBTypeWizDialogSetup()
35 static OMultiInstanceAutoRegistration< ODBTypeWizDialogSetup > aAutoRegistration;
38 namespace dbaui
41 using namespace ::com::sun::star::uno;
42 using namespace ::com::sun::star::lang;
43 using namespace ::com::sun::star::beans;
44 using namespace ::com::sun::star::sdb;
45 using namespace ::com::sun::star::sdbc;
47 ODBTypeWizDialogSetup::ODBTypeWizDialogSetup(const Reference< XComponentContext >& _rxORB)
48 :ODatabaseAdministrationDialog(_rxORB)
49 ,m_bOpenDatabase(true)
50 ,m_bStartTableWizard(false)
52 registerProperty("OpenDatabase", 3, PropertyAttribute::TRANSIENT,
53 &m_bOpenDatabase, cppu::UnoType<bool>::get());
55 registerProperty("StartTableWizard", 4, PropertyAttribute::TRANSIENT,
56 &m_bStartTableWizard, cppu::UnoType<bool>::get());
59 Sequence<sal_Int8> SAL_CALL ODBTypeWizDialogSetup::getImplementationId( ) throw(RuntimeException, std::exception)
61 return css::uno::Sequence<sal_Int8>();
64 Reference< XInterface > SAL_CALL ODBTypeWizDialogSetup::Create(const Reference< XMultiServiceFactory >& _rxFactory)
66 Reference < XInterface > xDBWizard = *(new ODBTypeWizDialogSetup( comphelper::getComponentContext(_rxFactory) ));
67 return xDBWizard;
70 OUString SAL_CALL ODBTypeWizDialogSetup::getImplementationName() throw(RuntimeException, std::exception)
72 return getImplementationName_Static();
75 OUString ODBTypeWizDialogSetup::getImplementationName_Static() throw(RuntimeException)
77 return OUString("org.openoffice.comp.dbu.ODBTypeWizDialogSetup");
80 css::uno::Sequence<OUString> SAL_CALL ODBTypeWizDialogSetup::getSupportedServiceNames() throw(RuntimeException, std::exception)
82 return getSupportedServiceNames_Static();
85 css::uno::Sequence<OUString> ODBTypeWizDialogSetup::getSupportedServiceNames_Static() throw(RuntimeException)
87 css::uno::Sequence<OUString> aSupported { "com.sun.star.sdb.DatabaseWizardDialog" };
88 return aSupported;
91 Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialogSetup::getPropertySetInfo() throw(RuntimeException, std::exception)
93 return createPropertySetInfo( getInfoHelper() );
96 ::cppu::IPropertyArrayHelper& ODBTypeWizDialogSetup::getInfoHelper()
98 return *getArrayHelper();
101 ::cppu::IPropertyArrayHelper* ODBTypeWizDialogSetup::createArrayHelper( ) const
103 Sequence< Property > aProps;
104 describeProperties(aProps);
105 return new ::cppu::OPropertyArrayHelper(aProps);
108 VclPtr<Dialog> ODBTypeWizDialogSetup::createDialog(vcl::Window* _pParent)
110 return VclPtr<ODbTypeWizDialogSetup>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
113 void ODBTypeWizDialogSetup::executedDialog(sal_Int16 _nExecutionResult)
115 if ( _nExecutionResult == RET_OK )
117 const ODbTypeWizDialogSetup* pDialog = static_cast< ODbTypeWizDialogSetup* >( m_pDialog.get() );
118 m_bOpenDatabase = pDialog->IsDatabaseDocumentToBeOpened();
119 m_bStartTableWizard = pDialog->IsTableWizardToBeStarted();
123 } // namespace dbaui
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */