/* -*- 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 #include "TextConnectionHelper.hxx" #include #include #include namespace dbaui { // OSpreadSheetConnectionPageSetup class OSpreadSheetConnectionPageSetup final : public OConnectionTabPageSetup { public: virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static VclPtr CreateDocumentOrSpreadSheetTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); OSpreadSheetConnectionPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); virtual ~OSpreadSheetConnectionPageSetup() override; virtual void dispose() override; private: VclPtr m_pPasswordrequired; 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: VclPtr m_pTextConnectionHelper; virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static VclPtr CreateTextTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); OTextConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); virtual ~OTextConnectionPageSetup() override; virtual void dispose() 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); }; // OLDAPConnectionPageSetup class OLDAPConnectionPageSetup : public OGenericAdministrationPage { public: virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static VclPtr CreateLDAPTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); OLDAPConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); virtual ~OLDAPConnectionPageSetup() override; virtual void dispose() override; virtual void callModifiedHdl(void* 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: VclPtr m_pFTHelpText; VclPtr m_pFTHostServer; VclPtr m_pETHostServer; VclPtr m_pFTBaseDN; VclPtr m_pETBaseDN; VclPtr m_pFTPortNumber; VclPtr m_pNFPortNumber; VclPtr m_pFTDefaultPortNumber; VclPtr m_pCBUseSSL; }; // MySQLNativeSetupPage class MySQLNativeSetupPage : public OGenericAdministrationPage { private: VclPtr m_pHelpText; VclPtr m_aMySQLSettings; public: MySQLNativeSetupPage( vcl::Window* _pParent, const SfxItemSet& _rCoreAttrs ); virtual ~MySQLNativeSetupPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, 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(void* pControl = nullptr) override; }; // OGeneralSpecialJDBCConnectionPageSetup class OGeneralSpecialJDBCConnectionPageSetup final : public OGenericAdministrationPage { public: OGeneralSpecialJDBCConnectionPageSetup( vcl::Window* pParent , const SfxItemSet& _rCoreAttrs , sal_uInt16 _nPortId , const char* pDefaultPortResId , const char* pHelpTextResId , const char* pHeaderTextResId , const char* pDriverClassId ); virtual ~OGeneralSpecialJDBCConnectionPageSetup() override; virtual void dispose() override; static VclPtr CreateMySQLJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); static VclPtr CreateOracleJDBCTabPage( vcl::Window* pParent, 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(void* pControl = nullptr) override; DECL_LINK(OnTestJavaClickHdl, Button*, void); VclPtr m_pHeaderText; VclPtr m_pFTHelpText; VclPtr m_pFTDatabasename; VclPtr m_pETDatabasename; VclPtr m_pFTHostname; VclPtr m_pETHostname; VclPtr m_pFTPortNumber; VclPtr m_pFTDefaultPortNumber; VclPtr m_pNFPortNumber; VclPtr m_pFTDriverClass; VclPtr m_pETDriverClass; VclPtr m_pPBTestJavaDriver; OUString m_sDefaultJdbcDriverName; sal_uInt16 m_nPortId; }; // OJDBCConnectionPageSetup class OJDBCConnectionPageSetup final : public OConnectionTabPageSetup { public: OJDBCConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); virtual ~OJDBCConnectionPageSetup() override; virtual void dispose() override; static VclPtr CreateJDBCTabPage( vcl::Window* pParent, 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, Button*, void); DECL_LINK(OnEditModified, Edit&, void); VclPtr m_pFTDriverClass; VclPtr m_pETDriverClass; VclPtr m_pPBTestJavaDriver; }; // OJDBCConnectionPageSetup class OMySQLIntroPageSetup : public OGenericAdministrationPage { public: enum ConnectionType { VIA_ODBC, VIA_JDBC, VIA_NATIVE }; OMySQLIntroPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); virtual ~OMySQLIntroPageSetup() override; virtual void dispose() override; static VclPtr CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet ); ConnectionType getMySQLMode(); 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: VclPtr m_pODBCDatabase; VclPtr m_pJDBCDatabase; VclPtr m_pNATIVEDatabase; Link maClickHdl; DECL_LINK(OnSetupModeSelected, RadioButton&, void); }; // OAuthentificationPageSetup class OAuthentificationPageSetup final : public OGenericAdministrationPage { public: virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; static VclPtr CreateAuthentificationTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); OAuthentificationPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); virtual ~OAuthentificationPageSetup() override; virtual void dispose() override; private: VclPtr m_pFTHelpText; VclPtr m_pFTUserName; VclPtr m_pETUserName; VclPtr m_pCBPasswordRequired; VclPtr m_pPBTestConnection; 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 VclPtr CreateFinalDBTabPageSetup( vcl::Window* pParent, const SfxItemSet& _rAttrSet); VclPtr m_pFTFinalHeader; VclPtr m_pFTFinalHelpText; VclPtr m_pRBRegisterDataSource; VclPtr m_pRBDontregisterDataSource; VclPtr m_pFTAdditionalSettings; VclPtr m_pCBOpenAfterwards; VclPtr m_pCBStartTableWizard; VclPtr m_pFTFinalText; OFinalDBPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); virtual ~OFinalDBPageSetup() override; virtual void dispose() override; bool IsDatabaseDocumentToBeRegistered(); bool IsDatabaseDocumentToBeOpened(); bool IsTableWizardToBeStarted(); void enableTableWizardCheckBox( bool _bSupportsTableCreation); DECL_LINK(OnOpenSelected, Button*, 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; }; } // namespace dbaui #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */