2012-05-03 16:55:22 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
2013-04-19 21:10:42 +01:00
|
|
|
* This file is part of the LibreOffice project.
|
2012-05-03 16:55:22 +02:00
|
|
|
*
|
2013-04-19 21:10:42 +01:00
|
|
|
* 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/.
|
2012-05-03 16:55:22 +02:00
|
|
|
*/
|
2013-10-23 19:14:56 +02:00
|
|
|
#ifndef INCLUDED_SVTOOLS_SERVERDETAILSCONTROLS_HXX
|
|
|
|
#define INCLUDED_SVTOOLS_SERVERDETAILSCONTROLS_HXX
|
2012-05-03 16:55:22 +02:00
|
|
|
|
2012-08-03 18:12:51 -04:30
|
|
|
#include <map>
|
|
|
|
|
2012-07-11 11:37:25 +02:00
|
|
|
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
|
2015-08-26 13:48:59 +02:00
|
|
|
#include <com/sun/star/task/PasswordContainer.hpp>
|
|
|
|
#include <com/sun/star/task/XPasswordContainer2.hpp>
|
2012-07-11 11:37:25 +02:00
|
|
|
|
2012-05-03 16:55:22 +02:00
|
|
|
#include <tools/urlobj.hxx>
|
2012-11-13 11:14:24 +01:00
|
|
|
#include <vcl/builder.hxx>
|
2012-08-03 18:12:51 -04:30
|
|
|
#include <vcl/button.hxx>
|
2012-05-03 16:55:22 +02:00
|
|
|
#include <vcl/edit.hxx>
|
|
|
|
#include <vcl/field.hxx>
|
|
|
|
#include <vcl/fixed.hxx>
|
2012-11-13 11:14:24 +01:00
|
|
|
#include <vcl/layout.hxx>
|
2015-06-26 17:54:11 +02:00
|
|
|
#include <vcl/msgbox.hxx>
|
2012-05-03 16:55:22 +02:00
|
|
|
|
|
|
|
class DetailsContainer
|
|
|
|
{
|
2015-08-06 11:11:00 +02:00
|
|
|
protected:
|
2015-08-17 10:16:50 +02:00
|
|
|
Link<DetailsContainer*,void> m_aChangeHdl;
|
2015-08-06 11:11:00 +02:00
|
|
|
VclPtr<VclGrid> m_pDetailsGrid;
|
|
|
|
VclPtr<VclHBox> m_pHostBox;
|
|
|
|
VclPtr<Edit> m_pEDHost;
|
|
|
|
VclPtr<FixedText> m_pFTHost;
|
|
|
|
VclPtr<NumericField> m_pEDPort;
|
|
|
|
VclPtr<FixedText> m_pFTPort;
|
|
|
|
VclPtr<Edit> m_pEDRoot;
|
|
|
|
VclPtr<FixedText> m_pFTRoot;
|
|
|
|
bool m_bIsActive;
|
2012-05-03 16:55:22 +02:00
|
|
|
|
|
|
|
public:
|
2015-08-06 11:11:00 +02:00
|
|
|
DetailsContainer( VclBuilderContainer* pBuilder );
|
2012-05-03 16:55:22 +02:00
|
|
|
virtual ~DetailsContainer( );
|
|
|
|
|
2015-08-17 10:16:50 +02:00
|
|
|
void setChangeHdl( const Link<DetailsContainer*,void>& rLink ) { m_aChangeHdl = rLink; }
|
2012-05-03 16:55:22 +02:00
|
|
|
|
|
|
|
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 );
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual void setUsername( const OUString& /*rUsername*/ ) { };
|
2015-08-26 13:48:59 +02:00
|
|
|
virtual void setPassword( const OUString& ) { };
|
2012-07-11 11:37:25 +02:00
|
|
|
|
2015-08-05 11:56:06 +02:00
|
|
|
virtual void setActive( bool bActive = true );
|
|
|
|
|
2012-05-03 16:55:22 +02:00
|
|
|
protected:
|
|
|
|
void notifyChange( );
|
|
|
|
DECL_LINK ( ValueChangeHdl, void * );
|
|
|
|
};
|
|
|
|
|
|
|
|
class HostDetailsContainer : public DetailsContainer
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
sal_uInt16 m_nDefaultPort;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_sScheme;
|
2015-08-06 11:11:00 +02:00
|
|
|
OUString m_sHost;
|
2012-11-13 11:14:24 +01:00
|
|
|
|
2012-05-03 16:55:22 +02:00
|
|
|
public:
|
2014-03-13 13:12:33 +02:00
|
|
|
HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme );
|
2012-05-03 16:55:22 +02:00
|
|
|
virtual ~HostDetailsContainer( ) { };
|
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void show( bool bShow = true ) SAL_OVERRIDE;
|
|
|
|
virtual INetURLObject getUrl( ) SAL_OVERRIDE;
|
|
|
|
virtual bool setUrl( const INetURLObject& rUrl ) SAL_OVERRIDE;
|
2012-05-03 16:55:22 +02:00
|
|
|
|
|
|
|
protected:
|
2014-03-13 13:12:33 +02:00
|
|
|
void setScheme( const OUString& sScheme ) { m_sScheme = sScheme; }
|
2012-05-03 16:55:22 +02:00
|
|
|
|
2015-09-29 17:55:09 +02:00
|
|
|
/** Verifies that the scheme split from the URL can be handled by
|
2012-05-03 16:55:22 +02:00
|
|
|
the container and set the proper controls accordingly if needed.
|
|
|
|
*/
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual bool verifyScheme( const OUString& rScheme );
|
2012-05-03 16:55:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class DavDetailsContainer : public HostDetailsContainer
|
|
|
|
{
|
2012-11-13 11:14:24 +01:00
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<CheckBox> m_pCBDavs;
|
2012-11-13 11:14:24 +01:00
|
|
|
|
2012-05-03 16:55:22 +02:00
|
|
|
public:
|
2012-11-13 11:14:24 +01:00
|
|
|
DavDetailsContainer( VclBuilderContainer* pBuilder );
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~DavDetailsContainer( ) { };
|
2012-05-03 16:55:22 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void show( bool bShow = true ) SAL_OVERRIDE;
|
2012-05-03 16:55:22 +02:00
|
|
|
|
|
|
|
protected:
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual bool verifyScheme( const OUString& rScheme ) SAL_OVERRIDE;
|
2012-05-03 16:55:22 +02:00
|
|
|
|
|
|
|
private:
|
2015-09-11 13:27:40 +02:00
|
|
|
DECL_LINK_TYPED( ToggledDavsHdl, CheckBox&, void );
|
2012-05-03 16:55:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class SmbDetailsContainer : public DetailsContainer
|
|
|
|
{
|
2012-11-13 11:14:24 +01:00
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<Edit> m_pEDShare;
|
2015-08-06 11:11:00 +02:00
|
|
|
VclPtr<FixedText> m_pFTShare;
|
2012-11-13 11:14:24 +01:00
|
|
|
|
2012-05-03 16:55:22 +02:00
|
|
|
public:
|
2012-11-13 11:14:24 +01:00
|
|
|
SmbDetailsContainer( VclBuilderContainer* pBuilder );
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~SmbDetailsContainer( ) { };
|
2012-05-03 16:55:22 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual INetURLObject getUrl( ) SAL_OVERRIDE;
|
|
|
|
virtual bool setUrl( const INetURLObject& rUrl ) SAL_OVERRIDE;
|
2015-08-06 11:11:00 +02:00
|
|
|
virtual void show( bool bShow = true ) SAL_OVERRIDE;
|
2012-05-03 16:55:22 +02:00
|
|
|
};
|
|
|
|
|
2012-05-31 14:18:55 +02:00
|
|
|
class CmisDetailsContainer : public DetailsContainer
|
|
|
|
{
|
2012-07-11 11:37:25 +02:00
|
|
|
private:
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_sUsername;
|
2015-08-26 13:48:59 +02:00
|
|
|
OUString m_sPassword;
|
2012-07-11 11:37:25 +02:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
|
2013-04-07 12:06:47 +02:00
|
|
|
std::vector< OUString > m_aRepoIds;
|
|
|
|
OUString m_sRepoId;
|
2015-05-27 12:12:14 +02:00
|
|
|
OUString m_sBinding;
|
2012-07-11 11:37:25 +02:00
|
|
|
|
2015-08-06 11:11:00 +02:00
|
|
|
VclPtr<VclHBox> m_pRepositoryBox;
|
|
|
|
VclPtr<FixedText> m_pFTRepository;
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<ListBox> m_pLBRepository;
|
|
|
|
VclPtr<Button> m_pBTRepoRefresh;
|
2012-11-13 11:14:24 +01:00
|
|
|
|
2012-05-31 14:18:55 +02:00
|
|
|
public:
|
2015-07-16 10:08:51 +02:00
|
|
|
CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding );
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~CmisDetailsContainer( ) { };
|
2012-05-31 14:18:55 +02:00
|
|
|
|
2015-07-16 10:06:26 +02:00
|
|
|
virtual void show( bool bShow = true ) SAL_OVERRIDE;
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual INetURLObject getUrl( ) SAL_OVERRIDE;
|
|
|
|
virtual bool setUrl( const INetURLObject& rUrl ) SAL_OVERRIDE;
|
|
|
|
virtual void setUsername( const OUString& rUsername ) SAL_OVERRIDE;
|
2015-08-26 13:48:59 +02:00
|
|
|
virtual void setPassword( const OUString& rPass ) SAL_OVERRIDE;
|
2012-07-11 11:37:25 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void selectRepository( );
|
2015-08-19 09:11:34 +02:00
|
|
|
DECL_LINK_TYPED ( RefreshReposHdl, Button*, void );
|
2015-10-04 15:05:38 +02:00
|
|
|
DECL_LINK_TYPED ( SelectRepoHdl, ListBox&, void );
|
2012-05-31 14:18:55 +02:00
|
|
|
};
|
|
|
|
|
2012-05-03 16:55:22 +02:00
|
|
|
#endif
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|