Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / inc / dbwiz.hxx
blob93046dd5b02ae942a4c6e93c906554088e37b9ec
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 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX
23 #include <sfx2/tabdlg.hxx>
24 #include "dsntypes.hxx"
25 #include "IItemSetHelper.hxx"
26 #include <comphelper/uno3.hxx>
27 #include <svtools/wizardmachine.hxx>
28 #include "moduledbu.hxx"
29 #include <memory>
31 namespace com { namespace sun { namespace star {
32 namespace beans {
33 class XPropertySet;
35 namespace sdbc {
36 class XConnection;
38 namespace lang {
39 class XMultiServiceFactory;
41 }}}
43 namespace dbaccess
45 class ODsnTypeCollection;
47 namespace dbaui
50 // ODbTypeWizDialog
51 class OGeneralPage;
52 class ODbDataSourceAdministrationHelper;
53 /** tab dialog for administrating the office wide registered data sources
55 class ODbTypeWizDialog : public svt::OWizardMachine , public IItemSetHelper, public IDatabaseSettingsDialog,public dbaui::OModuleClient
57 private:
58 OModuleClient m_aModuleClient;
59 ::std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
60 SfxItemSet* m_pOutSet;
61 ::dbaccess::ODsnTypeCollection*
62 m_pCollection; /// the DSN type collection instance
63 OUString m_eType;
65 public:
66 /** ctor. The itemset given should have been created by <method>createItemSet</method> and should be destroyed
67 after the dialog has been destroyed
69 ODbTypeWizDialog(vcl::Window* pParent
70 ,SfxItemSet* _pItems
71 ,const css::uno::Reference< css::uno::XComponentContext >& _rxORB
72 ,const css::uno::Any& _aDataSourceName
74 virtual ~ODbTypeWizDialog();
75 virtual void dispose() override;
77 virtual const SfxItemSet* getOutputSet() const override;
78 virtual SfxItemSet* getWriteOutputSet() override;
80 // forwards to ODbDataSourceAdministrationHelper
81 virtual css::uno::Reference< css::uno::XComponentContext > getORB() const override;
82 virtual ::std::pair< css::uno::Reference< css::sdbc::XConnection >,sal_Bool> createConnection() override;
83 virtual css::uno::Reference< css::sdbc::XDriver > getDriver() override;
84 virtual OUString getDatasourceType(const SfxItemSet& _rSet) const override;
85 virtual void clearPassword() override;
86 virtual void saveDatasource() override;
87 virtual void setTitle(const OUString& _sTitle) override;
88 virtual void enableConfirmSettings( bool _bEnable ) override;
90 protected:
91 /// to override to create new pages
92 virtual VclPtr<TabPage> createPage(WizardState _nState) override;
93 virtual WizardState determineNextState(WizardState _nCurrentState) const override;
94 virtual bool leaveState(WizardState _nState) override;
95 virtual ::svt::IWizardPageController*
96 getPageController( TabPage* _pCurrentPage ) const override;
97 virtual bool onFinish() override;
99 protected:
101 enum ApplyResult
103 AR_LEAVE_MODIFIED, // something was modified and has successfully been committed
104 AR_LEAVE_UNCHANGED, // no changes were made
105 AR_KEEP // don't leave the page (e.g. because an error occurred)
108 private:
109 DECL_LINK_TYPED(OnTypeSelected, OGeneralPage&, void);
112 } // namespace dbaui
114 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */