Line data Source code
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 :
21 : #include "dbu_reghelper.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 :
30 : using namespace dbaui;
31 :
32 0 : extern "C" void SAL_CALL createRegistryInfo_ODBTypeWizDialogSetup()
33 : {
34 0 : static OMultiInstanceAutoRegistration< ODBTypeWizDialogSetup > aAutoRegistration;
35 0 : }
36 :
37 : //.........................................................................
38 : namespace dbaui
39 : {
40 : //.........................................................................
41 :
42 : using namespace ::com::sun::star::uno;
43 : using namespace ::com::sun::star::lang;
44 : using namespace ::com::sun::star::beans;
45 : using namespace ::com::sun::star::sdb;
46 : using namespace ::com::sun::star::sdbc;
47 :
48 : //=========================================================================
49 : //-------------------------------------------------------------------------
50 0 : ODBTypeWizDialogSetup::ODBTypeWizDialogSetup(const Reference< XMultiServiceFactory >& _rxORB)
51 : :ODatabaseAdministrationDialog(_rxORB)
52 : ,m_bOpenDatabase(sal_True)
53 0 : ,m_bStartTableWizard(sal_False)
54 : {
55 : registerProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenDatabase")), 3, PropertyAttribute::TRANSIENT,
56 0 : &m_bOpenDatabase, getBooleanCppuType());
57 :
58 : registerProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartTableWizard")), 4, PropertyAttribute::TRANSIENT,
59 0 : &m_bStartTableWizard, getBooleanCppuType());
60 0 : }
61 : //-------------------------------------------------------------------------
62 0 : Sequence<sal_Int8> SAL_CALL ODBTypeWizDialogSetup::getImplementationId( ) throw(RuntimeException)
63 : {
64 0 : static ::cppu::OImplementationId aId;
65 0 : return aId.getImplementationId();
66 : }
67 :
68 : //-------------------------------------------------------------------------
69 0 : Reference< XInterface > SAL_CALL ODBTypeWizDialogSetup::Create(const Reference< XMultiServiceFactory >& _rxFactory)
70 : {
71 0 : Reference < XInterface > xDBWizard = *(new ODBTypeWizDialogSetup(_rxFactory));
72 0 : return xDBWizard;
73 : }
74 :
75 : //-------------------------------------------------------------------------
76 0 : ::rtl::OUString SAL_CALL ODBTypeWizDialogSetup::getImplementationName() throw(RuntimeException)
77 : {
78 0 : return getImplementationName_Static();
79 : }
80 :
81 : //-------------------------------------------------------------------------
82 0 : ::rtl::OUString ODBTypeWizDialogSetup::getImplementationName_Static() throw(RuntimeException)
83 : {
84 0 : return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.ODBTypeWizDialogSetup"));
85 : }
86 :
87 : //-------------------------------------------------------------------------
88 0 : ::comphelper::StringSequence SAL_CALL ODBTypeWizDialogSetup::getSupportedServiceNames() throw(RuntimeException)
89 : {
90 0 : return getSupportedServiceNames_Static();
91 : }
92 :
93 : //-------------------------------------------------------------------------
94 0 : ::comphelper::StringSequence ODBTypeWizDialogSetup::getSupportedServiceNames_Static() throw(RuntimeException)
95 : {
96 0 : ::comphelper::StringSequence aSupported(1);
97 0 : aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatabaseWizardDialog"));
98 0 : return aSupported;
99 : }
100 :
101 : //-------------------------------------------------------------------------
102 0 : Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialogSetup::getPropertySetInfo() throw(RuntimeException)
103 : {
104 0 : return createPropertySetInfo( getInfoHelper() );
105 : }
106 :
107 : //-------------------------------------------------------------------------
108 0 : ::cppu::IPropertyArrayHelper& ODBTypeWizDialogSetup::getInfoHelper()
109 : {
110 0 : return *const_cast<ODBTypeWizDialogSetup*>(this)->getArrayHelper();
111 : }
112 :
113 : //------------------------------------------------------------------------------
114 0 : ::cppu::IPropertyArrayHelper* ODBTypeWizDialogSetup::createArrayHelper( ) const
115 : {
116 0 : Sequence< Property > aProps;
117 0 : describeProperties(aProps);
118 0 : return new ::cppu::OPropertyArrayHelper(aProps);
119 : }
120 : //------------------------------------------------------------------------------
121 0 : Dialog* ODBTypeWizDialogSetup::createDialog(Window* _pParent)
122 : {
123 0 : return new ODbTypeWizDialogSetup(_pParent, m_pDatasourceItems, m_aContext.getLegacyServiceFactory(), m_aInitialSelection);
124 : }
125 : // -----------------------------------------------------------------------------
126 0 : void ODBTypeWizDialogSetup::executedDialog(sal_Int16 _nExecutionResult)
127 : {
128 0 : if ( _nExecutionResult == RET_OK )
129 : {
130 0 : const ODbTypeWizDialogSetup* pDialog = static_cast< ODbTypeWizDialogSetup* >( m_pDialog );
131 0 : m_bOpenDatabase = pDialog->IsDatabaseDocumentToBeOpened();
132 0 : m_bStartTableWizard = pDialog->IsTableWizardToBeStarted();
133 : }
134 0 : }
135 :
136 : //.........................................................................
137 0 : } // namespace dbaui
138 : //.........................................................................
139 :
140 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|