bump product version to 4.1.6.2
[LibreOffice.git] / include / svtools / ServerDetailsControls.hxx
blob9447230a8fed9db58951519adc5bad6a6bc53ce1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #ifndef _SERVERDETAILSCONTROLS_HXX
10 #define _SERVERDETAILSCONTROLS_HXX
12 #include <map>
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
26 private:
27 Link m_aChangeHdl;
28 VclFrame* m_pFrame;
30 public:
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*/ ) { };
48 protected:
49 void notifyChange( );
50 DECL_LINK ( ValueChangeHdl, void * );
53 class HostDetailsContainer : public DetailsContainer
55 private:
56 sal_uInt16 m_nDefaultPort;
57 OUString m_sScheme;
59 protected:
60 Edit* m_pEDHost;
61 NumericField* m_pEDPort;
62 Edit* m_pEDPath;
64 public:
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 );
72 protected:
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
83 private:
84 CheckBox* m_pCBDavs;
86 public:
87 DavDetailsContainer( VclBuilderContainer* pBuilder );
88 ~DavDetailsContainer( ) { };
90 virtual void show( bool bShow = true );
92 protected:
93 virtual bool verifyScheme( const OUString& rScheme );
95 private:
96 DECL_LINK ( ToggledDavsHdl, CheckBox * pCheckBox );
99 class SmbDetailsContainer : public DetailsContainer
101 private:
102 Edit* m_pEDHost;
103 Edit* m_pEDShare;
104 Edit* m_pEDPath;
106 public:
107 SmbDetailsContainer( VclBuilderContainer* pBuilder );
108 ~SmbDetailsContainer( ) { };
110 virtual INetURLObject getUrl( );
111 virtual bool setUrl( const INetURLObject& rUrl );
114 class CmisDetailsContainer : public DetailsContainer
116 private:
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;
121 OUString m_sRepoId;
123 Edit* m_pEDBinding;
124 ListBox* m_pLBRepository;
125 Button* m_pBTRepoRefresh;
126 ListBox* m_pLBServerType;
127 Edit* m_pEDPath;
129 public:
130 CmisDetailsContainer( VclBuilderContainer* pBuilder );
131 ~CmisDetailsContainer( ) { };
133 virtual INetURLObject getUrl( );
134 virtual bool setUrl( const INetURLObject& rUrl );
135 virtual void setUsername( const OUString& rUsername );
137 private:
138 void selectRepository( );
139 DECL_LINK ( SelectServerTypeHdl, void * );
140 DECL_LINK ( RefreshReposHdl, void * );
141 DECL_LINK ( SelectRepoHdl, void * );
144 #endif
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */