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/uno/Reference.hxx>
16 #include <tools/link.hxx>
17 #include <tools/urlobj.hxx>
19 namespace com :: sun :: star :: ucb
{ class XCommandEnvironment
; }
20 namespace com :: sun :: star :: awt
{ class XWindow
; }
30 class PlaceEditDialog
;
32 class DetailsContainer
35 PlaceEditDialog
* m_pDialog
;
36 Link
<DetailsContainer
*,void> m_aChangeHdl
;
39 DetailsContainer(PlaceEditDialog
* pDialog
);
40 virtual ~DetailsContainer( );
42 void setChangeHdl( const Link
<DetailsContainer
*,void>& rLink
) { m_aChangeHdl
= rLink
; }
44 virtual void set_visible( bool bShow
);
45 virtual INetURLObject
getUrl( );
47 /** Try to split the URL in the controls of that container.
49 \param sUrl the URL to split
50 \return true if the split worked, false otherwise.
52 virtual bool setUrl( const INetURLObject
& rUrl
);
54 virtual void setUsername( const OUString
& /*rUsername*/ ) { };
55 virtual void setPassword( const OUString
& ) { };
57 virtual bool enableUserCredentials( ) { return true; };
61 DECL_LINK(ValueChangeHdl
, weld::Entry
&, void);
62 DECL_STATIC_LINK(DetailsContainer
, FormatPortHdl
, weld::SpinButton
&, void);
65 class HostDetailsContainer
: public DetailsContainer
68 sal_uInt16
const m_nDefaultPort
;
73 HostDetailsContainer(PlaceEditDialog
* pDialog
, sal_uInt16 nPort
, const OUString
& sScheme
);
75 virtual void set_visible( bool bShow
) override
;
76 virtual INetURLObject
getUrl( ) override
;
77 virtual bool setUrl( const INetURLObject
& rUrl
) override
;
80 void setScheme( const OUString
& sScheme
) { m_sScheme
= sScheme
; }
82 /** Verifies that the scheme split from the URL can be handled by
83 the container and set the proper controls accordingly if needed.
85 virtual bool verifyScheme( const OUString
& rScheme
);
88 class DavDetailsContainer
: public HostDetailsContainer
91 DavDetailsContainer(PlaceEditDialog
* pDialog
);
93 virtual void set_visible( bool bShow
) override
;
94 virtual bool enableUserCredentials( ) override
{ return false; };
97 virtual bool verifyScheme( const OUString
& rScheme
) override
;
100 DECL_LINK(ToggledDavsHdl
, weld::ToggleButton
&, void);
103 class SmbDetailsContainer
: public DetailsContainer
109 SmbDetailsContainer(PlaceEditDialog
* pDialog
);
111 virtual INetURLObject
getUrl( ) override
;
112 virtual bool setUrl( const INetURLObject
& rUrl
) override
;
113 virtual void set_visible( bool bShow
) override
;
116 class CmisDetailsContainer
: public DetailsContainer
119 OUString m_sUsername
;
120 OUString m_sPassword
;
121 css::uno::Reference
< css::ucb::XCommandEnvironment
> m_xCmdEnv
;
122 std::vector
< OUString
> m_aRepoIds
;
125 css::uno::Reference
< css::awt::XWindow
> m_xParentDialog
;
128 CmisDetailsContainer(PlaceEditDialog
* pDialog
, OUString
const & sBinding
);
130 virtual void set_visible( bool bShow
) override
;
131 virtual INetURLObject
getUrl( ) override
;
132 virtual bool setUrl( const INetURLObject
& rUrl
) override
;
133 virtual void setUsername( const OUString
& rUsername
) override
;
134 virtual void setPassword( const OUString
& rPass
) override
;
137 void selectRepository( );
138 DECL_LINK ( RefreshReposHdl
, weld::Button
&, void );
139 DECL_LINK ( SelectRepoHdl
, weld::ComboBox
&, void );
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */