/* -*- 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/. */ #ifndef INCLUDED_SVTOOLS_SERVERDETAILSCONTROLS_HXX #define INCLUDED_SVTOOLS_SERVERDETAILSCONTROLS_HXX #include #include #include #include #include #include #include #include #include #include #include #include #include class DetailsContainer { protected: Link m_aChangeHdl; VclPtr m_pDetailsGrid; VclPtr m_pHostBox; VclPtr m_pEDHost; VclPtr m_pFTHost; VclPtr m_pEDPort; VclPtr m_pFTPort; VclPtr m_pEDRoot; VclPtr m_pFTRoot; public: DetailsContainer( VclBuilderContainer* pBuilder ); virtual ~DetailsContainer( ); void setChangeHdl( const Link& rLink ) { m_aChangeHdl = rLink; } virtual void show( bool bShow = true ); virtual INetURLObject getUrl( ); /** Try to split the URL in the controls of that container. \param sUrl the URL to split \return true if the split worked, false otherwise. */ virtual bool setUrl( const INetURLObject& rUrl ); virtual void setUsername( const OUString& /*rUsername*/ ) { }; virtual void setPassword( const OUString& ) { }; virtual bool enableUserCredentials( ) { return true; }; protected: void notifyChange( ); DECL_LINK ( ValueChangeHdl, Edit&, void ); }; class HostDetailsContainer : public DetailsContainer { private: sal_uInt16 m_nDefaultPort; OUString m_sScheme; OUString m_sHost; public: HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme ); virtual void show( bool bShow = true ) override; virtual INetURLObject getUrl( ) override; virtual bool setUrl( const INetURLObject& rUrl ) override; protected: void setScheme( const OUString& sScheme ) { m_sScheme = sScheme; } /** Verifies that the scheme split from the URL can be handled by the container and set the proper controls accordingly if needed. */ virtual bool verifyScheme( const OUString& rScheme ); }; class DavDetailsContainer : public HostDetailsContainer { private: VclPtr m_pCBDavs; public: DavDetailsContainer( VclBuilderContainer* pBuilder ); virtual void show( bool bShow = true ) override; virtual bool enableUserCredentials( ) override { return false; }; protected: virtual bool verifyScheme( const OUString& rScheme ) override; private: DECL_LINK( ToggledDavsHdl, CheckBox&, void ); }; class SmbDetailsContainer : public DetailsContainer { private: VclPtr m_pEDShare; VclPtr m_pFTShare; public: SmbDetailsContainer( VclBuilderContainer* pBuilder ); virtual INetURLObject getUrl( ) override; virtual bool setUrl( const INetURLObject& rUrl ) override; virtual void show( bool bShow = true ) override; }; class CmisDetailsContainer : public DetailsContainer { private: OUString m_sUsername; OUString m_sPassword; css::uno::Reference< css::ucb::XCommandEnvironment > m_xCmdEnv; std::vector< OUString > m_aRepoIds; OUString m_sRepoId; OUString m_sBinding; VclPtr m_pRepositoryBox; VclPtr m_pFTRepository; VclPtr m_pLBRepository; VclPtr