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/.
12 #include <config_options.h>
13 #include <svtools/svtdllapi.h>
14 #include <vcl/weld.hxx>
20 class DetailsContainer
;
22 class UNLESS_MERGELIBS(SVT_DLLPUBLIC
) PlaceEditDialog final
: public weld::GenericDialogController
25 std::shared_ptr
<DetailsContainer
> m_xCurrentDetails
;
26 /** Vector holding the details UI control for each server type.
28 The elements in this vector need to match the order in the type listbox, e.g.
29 the m_aDetailsContainer[0] will be shown for the type corresponding to entry 0
32 std::vector
<std::shared_ptr
<DetailsContainer
>> m_aDetailsContainers
;
34 sal_Int32 m_nCurrentType
;
40 std::unique_ptr
<weld::Entry
> m_xEDServerName
;
41 std::unique_ptr
<weld::ComboBox
> m_xLBServerType
;
42 std::unique_ptr
<weld::Entry
> m_xEDUsername
;
43 std::unique_ptr
<weld::Label
> m_xFTUsernameLabel
;
44 std::unique_ptr
<weld::Button
> m_xBTOk
;
45 std::unique_ptr
<weld::Button
> m_xBTDelete
;
46 std::unique_ptr
<weld::Button
> m_xBTRepoRefresh
;
47 std::unique_ptr
<weld::CheckButton
> m_xCBPassword
;
48 std::unique_ptr
<weld::Entry
> m_xEDPassword
;
49 std::unique_ptr
<weld::Label
> m_xFTPasswordLabel
;
50 std::unique_ptr
<weld::Widget
> m_xTypeGrid
;
52 std::unique_ptr
<weld::Widget
> m_xRepositoryBox
;
53 std::unique_ptr
<weld::Label
> m_xFTRepository
;
54 std::unique_ptr
<weld::ComboBox
> m_xLBRepository
;
56 std::unique_ptr
<weld::Entry
> m_xEDShare
;
57 std::unique_ptr
<weld::Label
> m_xFTShare
;
59 std::unique_ptr
<weld::Widget
> m_xDetailsGrid
;
60 std::unique_ptr
<weld::Widget
> m_xHostBox
;
61 std::unique_ptr
<weld::Entry
> m_xEDHost
;
62 std::unique_ptr
<weld::Label
> m_xFTHost
;
63 std::unique_ptr
<weld::SpinButton
> m_xEDPort
;
64 std::unique_ptr
<weld::Label
> m_xFTPort
;
65 std::unique_ptr
<weld::Entry
> m_xEDRoot
;
66 std::unique_ptr
<weld::Label
> m_xFTRoot
;
68 std::unique_ptr
<weld::CheckButton
> m_xCBDavs
;
71 PlaceEditDialog(weld::Window
* pParent
);
72 PlaceEditDialog(weld::Window
* pParent
, const std::shared_ptr
<Place
>& rPlace
);
73 virtual ~PlaceEditDialog() override
;
75 // Returns a place instance with given information
76 std::shared_ptr
<Place
> GetPlace();
78 OUString
GetServerName() const { return m_xEDServerName
->get_text(); }
79 OUString
GetServerUrl();
80 OUString
GetPassword() const { return m_xEDPassword
->get_text(); };
81 OUString
GetUser() const { return m_xEDUsername
->get_text(); };
82 bool IsRememberChecked() const { return m_xCBPassword
->get_active(); }
84 void ShowPasswordControl() { m_bShowPassword
= true; }
89 DECL_DLLPRIVATE_LINK(OKHdl
, weld::Button
&, void);
90 DECL_DLLPRIVATE_LINK(DelHdl
, weld::Button
&, void);
91 DECL_DLLPRIVATE_LINK(EditHdl
, DetailsContainer
*, void);
92 DECL_DLLPRIVATE_LINK(ModifyHdl
, weld::Entry
&, void);
93 void SelectType(bool bSkipSeparator
);
94 DECL_DLLPRIVATE_LINK(SelectTypeHdl
, weld::ComboBox
&, void);
95 DECL_DLLPRIVATE_LINK(EditLabelHdl
, weld::Entry
&, void);
96 DECL_DLLPRIVATE_LINK(EditUsernameHdl
, weld::Entry
&, void);
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */