Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : : *
5 : : * The contents of this file are subject to the Mozilla Public License Version
6 : : * 1.1 (the "License"); you may not use this file except in compliance with
7 : : * the License or as specified alternatively below. You may obtain a copy of
8 : : * the License at http://www.mozilla.org/MPL/
9 : : *
10 : : * Software distributed under the License is distributed on an "AS IS" basis,
11 : : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : : * for the specific language governing rights and limitations under the
13 : : * License.
14 : : *
15 : : * Major Contributor(s):
16 : : * [ Copyright (C) 2012 SUSE <cbosdonnat@suse.com> (initial developer) ]
17 : : *
18 : : * All Rights Reserved.
19 : : *
20 : : * For minor contributions see the git repository.
21 : : *
22 : : * Alternatively, the contents of this file may be used under the terms of
23 : : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 : : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 : : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 : : * instead of those above.
27 : : */
28 : : #ifndef _SERVERDETAILSCONTROLS_HXX
29 : : #define _SERVERDETAILSCONTROLS_HXX
30 : :
31 : : #include <map>
32 : :
33 : : #include <com/sun/star/ucb/XCommandEnvironment.hpp>
34 : :
35 : : #include <tools/urlobj.hxx>
36 : : #include <vcl/button.hxx>
37 : : #include <vcl/edit.hxx>
38 : : #include <vcl/field.hxx>
39 : : #include <vcl/fixed.hxx>
40 : :
41 : : class DetailsContainer
42 : : {
43 : : private:
44 : : std::map< sal_uInt16, Control* > m_aControls;
45 : : bool m_bShown;
46 : : Link m_aChangeHdl;
47 : :
48 : : public:
49 : : DetailsContainer( );
50 : : virtual ~DetailsContainer( );
51 : :
52 : : virtual void addControl( sal_uInt16 nId, Control* pControl );
53 : : Control* getControl( sal_uInt16 nId );
54 : : Rectangle getBounds( );
55 : :
56 : : void setChangeHdl( const Link& rLink ) { m_aChangeHdl = rLink; }
57 : :
58 : : virtual void show( bool bShow = true );
59 : : virtual INetURLObject getUrl( );
60 : :
61 : : /** Try to split the URL in the controls of that container.
62 : :
63 : : \param sUrl the URL to split
64 : : \return true if the split worked, false otherwise.
65 : : */
66 : : virtual bool setUrl( const INetURLObject& rUrl );
67 : :
68 : : virtual void setUsername( const rtl::OUString& /*rUsername*/ ) { };
69 : :
70 : : protected:
71 : : void notifyChange( );
72 : :
73 : : private:
74 : : DECL_LINK ( ValueChangeHdl, void * );
75 : : };
76 : :
77 : : class HostDetailsContainer : public DetailsContainer
78 : : {
79 : : private:
80 : : sal_uInt16 m_nDefaultPort;
81 : : rtl::OUString m_sScheme;
82 : :
83 : : public:
84 : : HostDetailsContainer( sal_uInt16 nPort, rtl::OUString sScheme );
85 [ # # ]: 0 : virtual ~HostDetailsContainer( ) { };
86 : :
87 : : virtual void show( bool bShow = true );
88 : : virtual INetURLObject getUrl( );
89 : : virtual bool setUrl( const INetURLObject& rUrl );
90 : :
91 : : protected:
92 : : void setScheme( rtl::OUString sScheme ) { m_sScheme = sScheme; }
93 : :
94 : : /** Verifies that the schement split from the URL can be handled by
95 : : the container and set the proper controls accordingly if needed.
96 : : */
97 : : virtual bool verifyScheme( const rtl::OUString& rScheme );
98 : : };
99 : :
100 : : class DavDetailsContainer : public HostDetailsContainer
101 : : {
102 : : public:
103 : : DavDetailsContainer( );
104 [ # # ]: 0 : ~DavDetailsContainer( ) { };
105 : :
106 : : virtual void addControl( sal_uInt16 nId, Control* pControl );
107 : : virtual void show( bool bShow = true );
108 : :
109 : : protected:
110 : : virtual bool verifyScheme( const rtl::OUString& rScheme );
111 : :
112 : : private:
113 : : DECL_LINK ( ToggledDavsHdl, CheckBox * pCheckBox );
114 : : };
115 : :
116 : : class SmbDetailsContainer : public DetailsContainer
117 : : {
118 : : public:
119 : : SmbDetailsContainer( ) : DetailsContainer( ) { };
120 [ # # ]: 0 : ~SmbDetailsContainer( ) { };
121 : :
122 : : virtual INetURLObject getUrl( );
123 : : virtual bool setUrl( const INetURLObject& rUrl );
124 : : };
125 : :
126 : : class CmisDetailsContainer : public DetailsContainer
127 : : {
128 : : private:
129 : : rtl::OUString m_sUsername;
130 : : com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
131 : : std::vector< rtl::OUString > m_aRepoIds;
132 : : rtl::OUString m_sRepoId;
133 : :
134 : : public:
135 : : CmisDetailsContainer( );
136 [ # # ]: 0 : ~CmisDetailsContainer( ) { };
137 : :
138 : : virtual INetURLObject getUrl( );
139 : : virtual bool setUrl( const INetURLObject& rUrl );
140 : : virtual void setUsername( const rtl::OUString& rUsername );
141 : : virtual void addControl( sal_uInt16 nId, Control* pControl );
142 : :
143 : : private:
144 : : void selectRepository( );
145 : : DECL_LINK ( RefreshReposHdl, void * );
146 : : DECL_LINK ( SelectRepoHdl, void * );
147 : : };
148 : :
149 : : #endif
150 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|