LibreOffice Module svtools (master) 1
PlaceEditDialog.hxx
Go to the documentation of this file.
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
10#pragma once
11
12#include <config_options.h>
13#include <svtools/svtdllapi.h>
14#include <vcl/weld.hxx>
15
16#include <memory>
17#include <vector>
18
19class Place;
21
22class UNLESS_MERGELIBS(SVT_DLLPUBLIC) PlaceEditDialog final : public weld::GenericDialogController
23{
24private:
25 std::shared_ptr<DetailsContainer> m_xCurrentDetails;
32 std::vector<std::shared_ptr<DetailsContainer>> m_aDetailsContainers;
33
34 sal_Int32 m_nCurrentType;
35
36 bool m_bLabelChanged;
37 bool m_bShowPassword;
38
39public:
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;
51
52 std::unique_ptr<weld::Widget> m_xRepositoryBox;
53 std::unique_ptr<weld::Label> m_xFTRepository;
54 std::unique_ptr<weld::ComboBox> m_xLBRepository;
55
56 std::unique_ptr<weld::Entry> m_xEDShare;
57 std::unique_ptr<weld::Label> m_xFTShare;
58
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;
67
68 std::unique_ptr<weld::CheckButton> m_xCBDavs;
69
70public:
71 PlaceEditDialog(weld::Window* pParent);
72 PlaceEditDialog(weld::Window* pParent, const std::shared_ptr<Place>& rPlace);
73 virtual ~PlaceEditDialog() override;
74
75 // Returns a place instance with given information
76 std::shared_ptr<Place> GetPlace();
77
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(); }
83
84 void ShowPasswordControl() { m_bShowPassword = true; }
85
86private:
87 void InitDetails();
88
90 DECL_DLLPRIVATE_LINK(DelHdl, weld::Button&, 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);
97};
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: place.hxx:16