bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / svtools / ServerDetailsControls.hxx
blobd569ac8e20ac3fa4e91c98dd9fcca4869707c8fc
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 INCLUDED_SVTOOLS_SERVERDETAILSCONTROLS_HXX
10 #define INCLUDED_SVTOOLS_SERVERDETAILSCONTROLS_HXX
12 #include <vector>
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; }
22 namespace weld {
23 class Button;
24 class ComboBox;
25 class Entry;
26 class SpinButton;
27 class ToggleButton;
30 class PlaceEditDialog;
32 class DetailsContainer
34 protected:
35 PlaceEditDialog* m_pDialog;
36 Link<DetailsContainer*,void> m_aChangeHdl;
38 public:
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; };
59 protected:
60 void notifyChange( );
61 DECL_LINK(ValueChangeHdl, weld::Entry&, void);
62 DECL_STATIC_LINK(DetailsContainer, FormatPortHdl, weld::SpinButton&, void);
65 class HostDetailsContainer : public DetailsContainer
67 private:
68 sal_uInt16 const m_nDefaultPort;
69 OUString m_sScheme;
70 OUString m_sHost;
72 public:
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;
79 protected:
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
90 public:
91 DavDetailsContainer(PlaceEditDialog* pDialog);
93 virtual void set_visible( bool bShow ) override;
94 virtual bool enableUserCredentials( ) override { return false; };
96 protected:
97 virtual bool verifyScheme( const OUString& rScheme ) override;
99 private:
100 DECL_LINK(ToggledDavsHdl, weld::ToggleButton&, void);
103 class SmbDetailsContainer : public DetailsContainer
105 private:
106 OUString m_sHost;
108 public:
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
118 private:
119 OUString m_sUsername;
120 OUString m_sPassword;
121 css::uno::Reference< css::ucb::XCommandEnvironment > m_xCmdEnv;
122 std::vector< OUString > m_aRepoIds;
123 OUString m_sRepoId;
124 OUString m_sBinding;
125 css::uno::Reference< css::awt::XWindow > m_xParentDialog;
127 public:
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;
136 private:
137 void selectRepository( );
138 DECL_LINK ( RefreshReposHdl, weld::Button&, void );
139 DECL_LINK ( SelectRepoHdl, weld::ComboBox&, void );
142 #endif
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */