Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : * This file incorporates work covered by the following license notice:
10 : *
11 : */
12 : #ifndef _SERVERDETAILSCONTROLS_HXX
13 : #define _SERVERDETAILSCONTROLS_HXX
14 :
15 : #include <map>
16 :
17 : #include <com/sun/star/ucb/XCommandEnvironment.hpp>
18 :
19 : #include <tools/urlobj.hxx>
20 : #include <vcl/builder.hxx>
21 : #include <vcl/button.hxx>
22 : #include <vcl/edit.hxx>
23 : #include <vcl/field.hxx>
24 : #include <vcl/fixed.hxx>
25 : #include <vcl/layout.hxx>
26 :
27 : class DetailsContainer
28 : {
29 : private:
30 : Link m_aChangeHdl;
31 : VclFrame* m_pFrame;
32 :
33 : public:
34 : DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame );
35 : virtual ~DetailsContainer( );
36 :
37 0 : void setChangeHdl( const Link& rLink ) { m_aChangeHdl = rLink; }
38 :
39 : virtual void show( bool bShow = true );
40 : virtual INetURLObject getUrl( );
41 :
42 : /** Try to split the URL in the controls of that container.
43 :
44 : \param sUrl the URL to split
45 : \return true if the split worked, false otherwise.
46 : */
47 : virtual bool setUrl( const INetURLObject& rUrl );
48 :
49 0 : virtual void setUsername( const OUString& /*rUsername*/ ) { };
50 :
51 : protected:
52 : void notifyChange( );
53 : DECL_LINK ( ValueChangeHdl, void * );
54 : };
55 :
56 : class HostDetailsContainer : public DetailsContainer
57 : {
58 : private:
59 : sal_uInt16 m_nDefaultPort;
60 : OUString m_sScheme;
61 :
62 : protected:
63 : Edit* m_pEDHost;
64 : NumericField* m_pEDPort;
65 : Edit* m_pEDPath;
66 :
67 : public:
68 : HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, OUString sScheme );
69 0 : virtual ~HostDetailsContainer( ) { };
70 :
71 : virtual void show( bool bShow = true );
72 : virtual INetURLObject getUrl( );
73 : virtual bool setUrl( const INetURLObject& rUrl );
74 :
75 : protected:
76 0 : void setScheme( OUString sScheme ) { m_sScheme = sScheme; }
77 :
78 : /** Verifies that the schement split from the URL can be handled by
79 : the container and set the proper controls accordingly if needed.
80 : */
81 : virtual bool verifyScheme( const OUString& rScheme );
82 : };
83 :
84 : class DavDetailsContainer : public HostDetailsContainer
85 : {
86 : private:
87 : CheckBox* m_pCBDavs;
88 :
89 : public:
90 : DavDetailsContainer( VclBuilderContainer* pBuilder );
91 0 : ~DavDetailsContainer( ) { };
92 :
93 : virtual void show( bool bShow = true );
94 :
95 : protected:
96 : virtual bool verifyScheme( const OUString& rScheme );
97 :
98 : private:
99 : DECL_LINK ( ToggledDavsHdl, CheckBox * pCheckBox );
100 : };
101 :
102 : class SmbDetailsContainer : public DetailsContainer
103 : {
104 : private:
105 : Edit* m_pEDHost;
106 : Edit* m_pEDShare;
107 : Edit* m_pEDPath;
108 :
109 : public:
110 : SmbDetailsContainer( VclBuilderContainer* pBuilder );
111 0 : ~SmbDetailsContainer( ) { };
112 :
113 : virtual INetURLObject getUrl( );
114 : virtual bool setUrl( const INetURLObject& rUrl );
115 : };
116 :
117 : class CmisDetailsContainer : public DetailsContainer
118 : {
119 : private:
120 : OUString m_sUsername;
121 : com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
122 : std::vector< OUString > m_aServerTypesURLs;
123 : std::vector< OUString > m_aRepoIds;
124 : OUString m_sRepoId;
125 :
126 : Edit* m_pEDBinding;
127 : ListBox* m_pLBRepository;
128 : Button* m_pBTRepoRefresh;
129 : ListBox* m_pLBServerType;
130 : Edit* m_pEDPath;
131 :
132 : public:
133 : CmisDetailsContainer( VclBuilderContainer* pBuilder );
134 0 : ~CmisDetailsContainer( ) { };
135 :
136 : virtual INetURLObject getUrl( );
137 : virtual bool setUrl( const INetURLObject& rUrl );
138 : virtual void setUsername( const OUString& rUsername );
139 :
140 : private:
141 : void selectRepository( );
142 : DECL_LINK ( SelectServerTypeHdl, void * );
143 : DECL_LINK ( RefreshReposHdl, void * );
144 : DECL_LINK ( SelectRepoHdl, void * );
145 : };
146 :
147 : #endif
148 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|