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 _SERVERDETAILSCONTROLS_HXX
10 #define _SERVERDETAILSCONTROLS_HXX
14 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
16 #include <tools/urlobj.hxx>
17 #include <vcl/builder.hxx>
18 #include <vcl/button.hxx>
19 #include <vcl/edit.hxx>
20 #include <vcl/field.hxx>
21 #include <vcl/fixed.hxx>
22 #include <vcl/layout.hxx>
24 class DetailsContainer
31 DetailsContainer( VclBuilderContainer
* pBuilder
, const OString
& rFrame
);
32 virtual ~DetailsContainer( );
34 void setChangeHdl( const Link
& rLink
) { m_aChangeHdl
= rLink
; }
36 virtual void show( bool bShow
= true );
37 virtual INetURLObject
getUrl( );
39 /** Try to split the URL in the controls of that container.
41 \param sUrl the URL to split
42 \return true if the split worked, false otherwise.
44 virtual bool setUrl( const INetURLObject
& rUrl
);
46 virtual void setUsername( const OUString
& /*rUsername*/ ) { };
50 DECL_LINK ( ValueChangeHdl
, void * );
53 class HostDetailsContainer
: public DetailsContainer
56 sal_uInt16 m_nDefaultPort
;
61 NumericField
* m_pEDPort
;
65 HostDetailsContainer( VclBuilderContainer
* pBuilder
, sal_uInt16 nPort
, OUString sScheme
);
66 virtual ~HostDetailsContainer( ) { };
68 virtual void show( bool bShow
= true );
69 virtual INetURLObject
getUrl( );
70 virtual bool setUrl( const INetURLObject
& rUrl
);
73 void setScheme( OUString sScheme
) { m_sScheme
= sScheme
; }
75 /** Verifies that the schement split from the URL can be handled by
76 the container and set the proper controls accordingly if needed.
78 virtual bool verifyScheme( const OUString
& rScheme
);
81 class DavDetailsContainer
: public HostDetailsContainer
87 DavDetailsContainer( VclBuilderContainer
* pBuilder
);
88 ~DavDetailsContainer( ) { };
90 virtual void show( bool bShow
= true );
93 virtual bool verifyScheme( const OUString
& rScheme
);
96 DECL_LINK ( ToggledDavsHdl
, CheckBox
* pCheckBox
);
99 class SmbDetailsContainer
: public DetailsContainer
107 SmbDetailsContainer( VclBuilderContainer
* pBuilder
);
108 ~SmbDetailsContainer( ) { };
110 virtual INetURLObject
getUrl( );
111 virtual bool setUrl( const INetURLObject
& rUrl
);
114 class CmisDetailsContainer
: public DetailsContainer
117 OUString m_sUsername
;
118 com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
> m_xCmdEnv
;
119 std::vector
< OUString
> m_aServerTypesURLs
;
120 std::vector
< OUString
> m_aRepoIds
;
124 ListBox
* m_pLBRepository
;
125 Button
* m_pBTRepoRefresh
;
126 ListBox
* m_pLBServerType
;
130 CmisDetailsContainer( VclBuilderContainer
* pBuilder
);
131 ~CmisDetailsContainer( ) { };
133 virtual INetURLObject
getUrl( );
134 virtual bool setUrl( const INetURLObject
& rUrl
);
135 virtual void setUsername( const OUString
& rUsername
);
138 void selectRepository( );
139 DECL_LINK ( SelectServerTypeHdl
, void * );
140 DECL_LINK ( RefreshReposHdl
, void * );
141 DECL_LINK ( SelectRepoHdl
, void * );
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */