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 #ifndef INCLUDED_SVTOOLS_SERVERDETAILSCONTROLS_HXX
10 #define INCLUDED_SVTOOLS_SERVERDETAILSCONTROLS_HXX
14 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
15 #include <com/sun/star/task/PasswordContainer.hpp>
16 #include <com/sun/star/task/XPasswordContainer2.hpp>
18 #include <tools/urlobj.hxx>
19 #include <vcl/weld.hxx>
21 class PlaceEditDialog
;
23 class DetailsContainer
26 PlaceEditDialog
* m_pDialog
;
27 Link
<DetailsContainer
*,void> m_aChangeHdl
;
30 DetailsContainer(PlaceEditDialog
* pDialog
);
31 virtual ~DetailsContainer( );
33 void setChangeHdl( const Link
<DetailsContainer
*,void>& rLink
) { m_aChangeHdl
= rLink
; }
35 virtual void show( bool bShow
= true );
36 virtual INetURLObject
getUrl( );
38 /** Try to split the URL in the controls of that container.
40 \param sUrl the URL to split
41 \return true if the split worked, false otherwise.
43 virtual bool setUrl( const INetURLObject
& rUrl
);
45 virtual void setUsername( const OUString
& /*rUsername*/ ) { };
46 virtual void setPassword( const OUString
& ) { };
48 virtual bool enableUserCredentials( ) { return true; };
52 DECL_LINK(ValueChangeHdl
, weld::Entry
&, void);
53 DECL_LINK(FormatPortHdl
, weld::SpinButton
&, void);
56 class HostDetailsContainer
: public DetailsContainer
59 sal_uInt16
const m_nDefaultPort
;
64 HostDetailsContainer(PlaceEditDialog
* pDialog
, sal_uInt16 nPort
, const OUString
& sScheme
);
66 virtual void show( bool bShow
= true ) override
;
67 virtual INetURLObject
getUrl( ) override
;
68 virtual bool setUrl( const INetURLObject
& rUrl
) override
;
71 void setScheme( const OUString
& sScheme
) { m_sScheme
= sScheme
; }
73 /** Verifies that the scheme split from the URL can be handled by
74 the container and set the proper controls accordingly if needed.
76 virtual bool verifyScheme( const OUString
& rScheme
);
79 class DavDetailsContainer
: public HostDetailsContainer
82 DavDetailsContainer(PlaceEditDialog
* pDialog
);
84 virtual void show( bool bShow
= true ) override
;
85 virtual bool enableUserCredentials( ) override
{ return false; };
88 virtual bool verifyScheme( const OUString
& rScheme
) override
;
91 DECL_LINK(ToggledDavsHdl
, weld::ToggleButton
&, void);
94 class SmbDetailsContainer
: public DetailsContainer
100 SmbDetailsContainer(PlaceEditDialog
* pDialog
);
102 virtual INetURLObject
getUrl( ) override
;
103 virtual bool setUrl( const INetURLObject
& rUrl
) override
;
104 virtual void show( bool bShow
= true ) override
;
107 class CmisDetailsContainer
: public DetailsContainer
110 OUString m_sUsername
;
111 OUString m_sPassword
;
112 css::uno::Reference
< css::ucb::XCommandEnvironment
> m_xCmdEnv
;
113 std::vector
< OUString
> m_aRepoIds
;
116 css::uno::Reference
< css::awt::XWindow
> m_xParentDialog
;
119 CmisDetailsContainer(PlaceEditDialog
* pDialog
, OUString
const & sBinding
);
121 virtual void show( bool bShow
= true ) override
;
122 virtual INetURLObject
getUrl( ) override
;
123 virtual bool setUrl( const INetURLObject
& rUrl
) override
;
124 virtual void setUsername( const OUString
& rUsername
) override
;
125 virtual void setPassword( const OUString
& rPass
) override
;
128 void selectRepository( );
129 DECL_LINK ( RefreshReposHdl
, weld::Button
&, void );
130 DECL_LINK ( SelectRepoHdl
, weld::ComboBox
&, void );
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */