/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_DBACCESS_SOURCE_UI_DLG_DBSETUPCONNECTIONPAGES_HXX #define INCLUDED_DBACCESS_SOURCE_UI_DLG_DBSETUPCONNECTIONPAGES_HXX #include "ConnectionPageSetup.hxx" #include "adminpages.hxx" #include "admincontrols.hxx" #include "TextConnectionHelper.hxx" namespace dbaui { class ODbTypeWizDialogSetup; // OSpreadSheetConnectionPageSetup class OSpreadSheetConnectionPageSetup final : public OConnectionTabPageSetup { public: virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static std::unique_ptr CreateDocumentOrSpreadSheetTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet); OSpreadSheetConnectionPageSetup(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs); virtual ~OSpreadSheetConnectionPageSetup() override; private: std::unique_ptr m_xPasswordrequired; virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; }; // OTextConnectionPage class OTextConnectionPageSetup : public OConnectionTabPageSetup { public: virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static std::unique_ptr CreateTextTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet ); OTextConnectionPageSetup(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs); virtual ~OTextConnectionPageSetup() override; protected: virtual bool prepareLeave() override; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; bool checkTestConnection() override; private: DECL_LINK(ImplGetExtensionHdl, OTextConnectionHelper*, void); std::unique_ptr m_xSubContainer; std::unique_ptr m_xTextConnectionHelper; }; // OLDAPConnectionPageSetup class OLDAPConnectionPageSetup : public OGenericAdministrationPage { public: virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static std::unique_ptr CreateLDAPTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet ); OLDAPConnectionPageSetup( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs ); virtual ~OLDAPConnectionPageSetup() override; virtual void callModifiedHdl(weld::Widget* pControl = nullptr) override; protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; private: std::unique_ptr m_xFTHelpText; std::unique_ptr m_xFTHostServer; std::unique_ptr m_xETHostServer; std::unique_ptr m_xFTBaseDN; std::unique_ptr m_xETBaseDN; std::unique_ptr m_xFTPortNumber; std::unique_ptr m_xNFPortNumber; std::unique_ptr m_xFTDefaultPortNumber; std::unique_ptr m_xCBUseSSL; }; // MySQLNativeSetupPage class MySQLNativeSetupPage : public OGenericAdministrationPage { private: std::unique_ptr m_xHelpText; std::unique_ptr m_xSettingsContainer; std::unique_ptr m_xMySQLSettings; public: MySQLNativeSetupPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs); virtual ~MySQLNativeSetupPage() override; static std::unique_ptr Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttrSet); protected: virtual void fillControls( std::vector< std::unique_ptr >& _rControlList ) override; virtual void fillWindows( std::vector< std::unique_ptr >& _rControlList ) override; virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void callModifiedHdl(weld::Widget* pControl = nullptr) override; }; // OGeneralSpecialJDBCConnectionPageSetup class OGeneralSpecialJDBCConnectionPageSetup final : public OGenericAdministrationPage { public: OGeneralSpecialJDBCConnectionPageSetup(weld::Container* pPage, weld::DialogController* pController , const SfxItemSet& _rCoreAttrs , sal_uInt16 _nPortId , const char* pDefaultPortResId , const char* pHelpTextResId , const char* pHeaderTextResId , const char* pDriverClassId ); virtual ~OGeneralSpecialJDBCConnectionPageSetup() override; static std::unique_ptr CreateMySQLJDBCTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet ); static std::unique_ptr CreateOracleJDBCTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet ); private: virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; virtual void callModifiedHdl(weld::Widget* pControl = nullptr) override; DECL_LINK(OnTestJavaClickHdl, weld::Button&, void); OUString m_sDefaultJdbcDriverName; sal_uInt16 m_nPortId; std::unique_ptr m_xHeaderText; std::unique_ptr m_xFTHelpText; std::unique_ptr m_xFTDatabasename; std::unique_ptr m_xETDatabasename; std::unique_ptr m_xFTHostname; std::unique_ptr m_xETHostname; std::unique_ptr m_xFTPortNumber; std::unique_ptr m_xFTDefaultPortNumber; std::unique_ptr m_xNFPortNumber; std::unique_ptr m_xFTDriverClass; std::unique_ptr m_xETDriverClass; std::unique_ptr m_xPBTestJavaDriver; }; // OJDBCConnectionPageSetup class OJDBCConnectionPageSetup final : public OConnectionTabPageSetup { public: OJDBCConnectionPageSetup(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs); virtual ~OJDBCConnectionPageSetup() override; static std::unique_ptr CreateJDBCTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttrSet); private: virtual bool checkTestConnection() override; virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; DECL_LINK(OnTestJavaClickHdl, weld::Button&, void); DECL_LINK(OnEditModified, weld::Entry&, void); std::unique_ptr m_xFTDriverClass; std::unique_ptr m_xETDriverClass; std::unique_ptr m_xPBTestJavaDriver; }; // OMySQLIntroPageSetup class OMySQLIntroPageSetup : public OGenericAdministrationPage { public: enum ConnectionType { VIA_ODBC, VIA_JDBC, VIA_NATIVE }; OMySQLIntroPageSetup(weld::Container* pPage, ODbTypeWizDialogSetup* pController, const SfxItemSet& rCoreAttrs); virtual ~OMySQLIntroPageSetup() override; static std::unique_ptr CreateMySQLIntroTabPage(weld::Container* pPage, ODbTypeWizDialogSetup* pController, const SfxItemSet& rAttrSet); ConnectionType getMySQLMode() const; void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; } protected: virtual bool FillItemSet(SfxItemSet* _rSet) override; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; private: std::unique_ptr m_xODBCDatabase; std::unique_ptr m_xJDBCDatabase; std::unique_ptr m_xNATIVEDatabase; Link maClickHdl; DECL_LINK(OnSetupModeSelected, weld::ToggleButton&, void); }; // OAuthentificationPageSetup class OAuthentificationPageSetup final : public OGenericAdministrationPage { public: virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static std::unique_ptr CreateAuthentificationTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet); OAuthentificationPageSetup(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs); virtual ~OAuthentificationPageSetup() override; private: std::unique_ptr m_xFTHelpText; std::unique_ptr m_xFTUserName; std::unique_ptr m_xETUserName; std::unique_ptr m_xCBPasswordRequired; std::unique_ptr m_xPBTestConnection; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; }; // OFinalDBPageSetup class OFinalDBPageSetup : public OGenericAdministrationPage { public: virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static std::unique_ptr CreateFinalDBTabPageSetup(weld::Container* pPage, ODbTypeWizDialogSetup* pController, const SfxItemSet& _rAttrSet); OFinalDBPageSetup(weld::Container* pPage, ODbTypeWizDialogSetup* pController, const SfxItemSet& _rCoreAttrs); virtual ~OFinalDBPageSetup() override; bool IsDatabaseDocumentToBeRegistered() const; bool IsDatabaseDocumentToBeOpened() const; bool IsTableWizardToBeStarted() const; void enableTableWizardCheckBox( bool _bSupportsTableCreation); DECL_LINK(OnOpenSelected, weld::ToggleButton&, void); protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; private: std::unique_ptr m_xFTFinalHeader; std::unique_ptr m_xFTFinalHelpText; std::unique_ptr m_xRBRegisterDataSource; std::unique_ptr m_xRBDontregisterDataSource; std::unique_ptr m_xFTAdditionalSettings; std::unique_ptr m_xCBOpenAfterwards; std::unique_ptr m_xCBStartTableWizard; std::unique_ptr m_xFTFinalText; }; } // namespace dbaui #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */