1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <dsntypes.hxx>
23 #include "IItemSetHelper.hxx"
24 #include <vcl/wizardmachine.hxx>
27 namespace com::sun::star
{
35 class XMultiServiceFactory
;
39 using vcl::WizardTypes::WizardState
;
40 using vcl::WizardTypes::CommitPageReason
;
44 class ODsnTypeCollection
;
51 class ODbDataSourceAdministrationHelper
;
52 /** tab dialog for administrating the office wide registered data sources
54 class ODbTypeWizDialog
: public vcl::WizardMachine
, public IItemSetHelper
, public IDatabaseSettingsDialog
57 std::unique_ptr
<ODbDataSourceAdministrationHelper
> m_pImpl
;
58 std::unique_ptr
<SfxItemSet
> m_pOutSet
;
59 ::dbaccess::ODsnTypeCollection
*
60 m_pCollection
; /// the DSN type collection instance
64 /** ctor. The itemset given should have been created by <method>createItemSet</method> and should be destroyed
65 after the dialog has been destroyed
67 ODbTypeWizDialog(weld::Window
* pParent
68 ,SfxItemSet
const * _pItems
69 ,const css::uno::Reference
< css::uno::XComponentContext
>& _rxORB
70 ,const css::uno::Any
& _aDataSourceName
72 virtual ~ODbTypeWizDialog() override
;
74 virtual const SfxItemSet
* getOutputSet() const override
;
75 virtual SfxItemSet
* getWriteOutputSet() override
;
77 // forwards to ODbDataSourceAdministrationHelper
78 virtual css::uno::Reference
< css::uno::XComponentContext
> getORB() const override
;
79 virtual std::pair
< css::uno::Reference
< css::sdbc::XConnection
>,bool> createConnection() override
;
80 virtual css::uno::Reference
< css::sdbc::XDriver
> getDriver() override
;
81 virtual OUString
getDatasourceType(const SfxItemSet
& _rSet
) const override
;
82 virtual void clearPassword() override
;
83 virtual void saveDatasource() override
;
84 virtual void setTitle(const OUString
& _sTitle
) override
;
85 virtual void enableConfirmSettings( bool _bEnable
) override
;
88 /// to override to create new pages
89 virtual std::unique_ptr
<BuilderPage
> createPage(WizardState _nState
) override
;
90 virtual WizardState
determineNextState(WizardState _nCurrentState
) const override
;
91 virtual bool leaveState(WizardState _nState
) override
;
92 virtual ::vcl::IWizardPageController
* getPageController(BuilderPage
* pCurrentPage
) const override
;
93 virtual bool onFinish() override
;
96 DECL_LINK(OnTypeSelected
, OGeneralPage
&, void);
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */