LibreOffice Module dbaccess (master) 1
dbwizsetup.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <dsntypes.hxx>
23#include "IItemSetHelper.hxx"
24#include <tools/urlobj.hxx>
25#include <memory>
26#include <vcl/roadmapwizard.hxx>
27
28namespace com::sun::star {
29 namespace beans {
30 class XPropertySet;
31 }
32 namespace sdbc {
33 class XConnection;
34 }
35 namespace lang {
36 class XMultiServiceFactory;
37 }
38}
39
42
43namespace dbaui
44{
45
46class OGenericAdministrationPage;
47
48// ODbTypeWizDialogSetup
49class OGeneralPage;
50class OGeneralPageWizard;
51class ODbDataSourceAdministrationHelper;
54class OMySQLIntroPageSetup;
55class OFinalDBPageSetup;
56
58{
59private:
60 std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
61 std::unique_ptr<SfxItemSet> m_pOutSet;
62 OUString m_sURL;
63 OUString m_sOldURL;
70 OUString m_sRM_ADOText;
81 OUString m_sWorkPath;
85
88
89public:
94 ,SfxItemSet const * _pItems
95 ,const css::uno::Reference< css::uno::XComponentContext >& _rxORB
96 ,const css::uno::Any& _aDataSourceName
97 );
98 virtual ~ODbTypeWizDialogSetup() override;
99
100 virtual const SfxItemSet* getOutputSet() const override;
101 virtual SfxItemSet* getWriteOutputSet() override;
102
103 // forwards to ODbDataSourceAdministrationHelper
104 virtual css::uno::Reference< css::uno::XComponentContext > getORB() const override;
105 virtual std::pair< css::uno::Reference< css::sdbc::XConnection >,bool> createConnection() override;
106 virtual css::uno::Reference< css::sdbc::XDriver > getDriver() override;
107 virtual OUString getDatasourceType(const SfxItemSet& _rSet) const override;
108 virtual void clearPassword() override;
109 virtual void setTitle(const OUString& _sTitle) override;
110 virtual void enableConfirmSettings( bool _bEnable ) override;
111 virtual void saveDatasource() override;
112 virtual OUString getStateDisplayName( WizardState _nState ) const override;
113
116 bool IsDatabaseDocumentToBeOpened() const;
117
120 bool IsTableWizardToBeStarted() const;
121
124 void SetFinalPage(OFinalDBPageSetup* pPage);
125
126private:
128 virtual std::unique_ptr<BuilderPage> createPage(WizardState _nState) override;
129 virtual bool leaveState(WizardState _nState) override;
130 virtual void enterState(WizardState _nState) override;
131 virtual ::vcl::IWizardPageController* getPageController(BuilderPage* pCurrentPage) const override;
132 virtual bool onFinish() override;
133
134 void resetPages(const css::uno::Reference< css::beans::XPropertySet >& _rxDatasource);
135
148 void declareAuthDepPath( const OUString& _sURL, PathId _nPathId, const vcl::RoadmapWizardTypes::WizardPath& _rPaths);
149
150 void RegisterDataSourceByLocation(std::u16string_view sPath);
153 OUString createUniqueFileName(const INetURLObject& rURL);
154 void CreateDatabase();
157
159 bool callSaveAsDialog();
160 DECL_LINK(OnTypeSelected, OGeneralPage&, void);
161 DECL_LINK(OnChangeCreationMode, OGeneralPageWizard&, void);
162 DECL_LINK(OnRecentDocumentSelected, OGeneralPageWizard&, void);
163 DECL_LINK(OnSingleDocumentChosen, OGeneralPageWizard&, void);
164 DECL_LINK(ImplClickHdl, OMySQLIntroPageSetup*, void);
165 DECL_LINK(ImplModifiedHdl, OGenericAdministrationPage const *, void);
166};
167
168} // namespace dbaui
169
170/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void clearPassword() override
Definition: dbwizsetup.cxx:438
DECL_LINK(OnChangeCreationMode, OGeneralPageWizard &, void)
virtual OUString getStateDisplayName(WizardState _nState) const override
Definition: dbwizsetup.cxx:187
void SetFinalPage(OFinalDBPageSetup *pPage)
Definition: dbwizsetup.cxx:458
OUString createUniqueFileName(const INetURLObject &rURL)
Definition: dbwizsetup.cxx:834
bool IsTableWizardToBeStarted() const
returns <TRUE> if the table wizard should be opened, otherwise <FALSE>.
Definition: dbwizsetup.cxx:732
virtual const SfxItemSet * getOutputSet() const override
Definition: dbwizsetup.cxx:371
virtual bool leaveState(WizardState _nState) override
Definition: dbwizsetup.cxx:635
void SetGeneralPage(OGeneralPageWizard *pPage)
Definition: dbwizsetup.cxx:449
virtual css::uno::Reference< css::uno::XComponentContext > getORB() const override
Definition: dbwizsetup.cxx:386
DECL_LINK(OnSingleDocumentChosen, OGeneralPageWizard &, void)
virtual css::uno::Reference< css::sdbc::XDriver > getDriver() override
Definition: dbwizsetup.cxx:391
OGeneralPageWizard * m_pGeneralPage
Definition: dbwizsetup.hxx:82
DECL_LINK(ImplModifiedHdl, OGenericAdministrationPage const *, void)
virtual std::unique_ptr< BuilderPage > createPage(WizardState _nState) override
to override to create new pages
Definition: dbwizsetup.cxx:463
virtual SfxItemSet * getWriteOutputSet() override
Definition: dbwizsetup.cxx:376
::dbaccess::ODsnTypeCollection * m_pCollection
Definition: dbwizsetup.hxx:87
void declareAuthDepPath(const OUString &_sURL, PathId _nPathId, const vcl::RoadmapWizardTypes::WizardPath &_rPaths)
declares a path with or without authentication, as indicated by the database type
Definition: dbwizsetup.cxx:170
virtual void enableConfirmSettings(bool _bEnable) override
enables or disables the user's possibility to confirm the settings
Definition: dbwizsetup.cxx:652
void resetPages(const css::uno::Reference< css::beans::XPropertySet > &_rxDatasource)
Definition: dbwizsetup.cxx:357
virtual void saveDatasource() override
Definition: dbwizsetup.cxx:628
virtual void setTitle(const OUString &_sTitle) override
Definition: dbwizsetup.cxx:647
virtual std::pair< css::uno::Reference< css::sdbc::XConnection >, bool > createConnection() override
Definition: dbwizsetup.cxx:381
virtual ~ODbTypeWizDialogSetup() override
Definition: dbwizsetup.cxx:253
std::unique_ptr< SfxItemSet > m_pOutSet
Definition: dbwizsetup.hxx:61
virtual OUString getDatasourceType(const SfxItemSet &_rSet) const override
Definition: dbwizsetup.cxx:417
OFinalDBPageSetup * m_pFinalPage
Definition: dbwizsetup.hxx:84
ODbTypeWizDialogSetup(weld::Window *pParent, SfxItemSet const *_pItems, const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Any &_aDataSourceName)
the DSN type collection instance
Definition: dbwizsetup.cxx:92
virtual bool onFinish() override
Definition: dbwizsetup.cxx:968
OMySQLIntroPageSetup * m_pMySQLIntroPage
Definition: dbwizsetup.hxx:83
bool IsDatabaseDocumentToBeOpened() const
returns <TRUE> if the database should be opened, otherwise <FALSE>.
Definition: dbwizsetup.cxx:721
DECL_LINK(OnTypeSelected, OGeneralPage &, void)
virtual void enterState(WizardState _nState) override
Definition: dbwizsetup.cxx:611
void RegisterDataSourceByLocation(std::u16string_view sPath)
Definition: dbwizsetup.cxx:770
void SetIntroPage(OMySQLIntroPageSetup *pPage)
Definition: dbwizsetup.cxx:443
virtual ::vcl::IWizardPageController * getPageController(BuilderPage *pCurrentPage) const override
Definition: dbwizsetup.cxx:854
::dbaccess::DATASOURCE_TYPE VerifyDataSourceType(const ::dbaccess::DATASOURCE_TYPE DatabaseType) const
Definition: dbwizsetup.cxx:396
OUString m_sRM_DocumentOrSpreadSheetText
Definition: dbwizsetup.hxx:77
void createUniqueFolderName(INetURLObject *pURL)
Definition: dbwizsetup.cxx:817
std::unique_ptr< ODbDataSourceAdministrationHelper > m_pImpl
Definition: dbwizsetup.hxx:60
DECL_LINK(ImplClickHdl, OMySQLIntroPageSetup *, void)
DECL_LINK(OnRecentDocumentSelected, OGeneralPageWizard &, void)
class SAL_NO_VTABLE XPropertySet
DATASOURCE_TYPE
known datasource types
Definition: dsntypes.hxx:36
::std::vector< WizardTypes::WizardState > WizardPath
sal_Int16 WizardState