LibreOffice Module uui (master) 1
logindlg.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <vcl/weld.hxx>
24
25
26enum class LoginFlags {
27 NONE = 0x0000,
28 NoSavePassword = 0x0008, // hide "save password"
29 NoErrorText = 0x0010, // hide message
30 UsernameReadonly = 0x0040, // "name" readonly
31 NoAccount = 0x0080, // hide "account"
32 NoUseSysCreds = 0x0100, // hide "use system credentials"
33};
34namespace o3tl {
35 template<> struct typed_flags<LoginFlags> : is_typed_flags<LoginFlags, 0x01d8> {};
36}
37
38
40{
41 std::unique_ptr<weld::Label> m_xErrorFT;
42 std::unique_ptr<weld::Label> m_xErrorInfo;
43 std::unique_ptr<weld::Label> m_xRequestInfo;
44 std::unique_ptr<weld::Label> m_xNameFT;
45 std::unique_ptr<weld::Entry> m_xNameED;
46 std::unique_ptr<weld::Label> m_xPasswordFT;
47 std::unique_ptr<weld::Entry> m_xPasswordED;
48 std::unique_ptr<weld::Label> m_xAccountFT;
49 std::unique_ptr<weld::Entry> m_xAccountED;
50 std::unique_ptr<weld::CheckButton> m_xSavePasswdBtn;
51 std::unique_ptr<weld::CheckButton> m_xUseSysCredsCB;
52 std::unique_ptr<weld::Button> m_xOKBtn;
53 OUString m_server;
54 OUString m_realm;
55
56 void HideControls_Impl( LoginFlags nFlags );
57 void EnableUseSysCredsControls_Impl( bool bUseSysCredsEnabled );
58 void SetRequest();
59
60 DECL_LINK(OKHdl_Impl, weld::Button&, void);
61 DECL_LINK(UseSysCredsHdl_Impl, weld::Toggleable&, void);
62
63public:
64 LoginDialog(weld::Window* pParent, LoginFlags nFlags,
65 OUString aServer, OUString aRealm);
66 virtual ~LoginDialog() override;
67
68 OUString GetName() const { return m_xNameED->get_text(); }
69 void SetName( const OUString& rNewName ) { m_xNameED->set_text( rNewName ); }
70 OUString GetPassword() const { return m_xPasswordED->get_text(); }
71 void SetPassword( const OUString& rNew );
72 OUString GetAccount() const { return m_xAccountED->get_text(); }
73 bool IsSavePassword() const { return m_xSavePasswdBtn->get_active(); }
74 void SetSavePassword( bool bSave ) { m_xSavePasswdBtn->set_active( bSave ); }
75 void SetSavePasswordText( const OUString& rTxt ) { m_xSavePasswdBtn->set_label( rTxt ); }
76 bool IsUseSystemCredentials() const { return m_xUseSysCredsCB->get_active(); }
77 void SetUseSystemCredentials( bool bUse );
78 void SetErrorText( const OUString& rTxt ) { m_xErrorInfo->set_label( rTxt ); }
79 void ClearPassword();
80 void ClearAccount();
81};
82
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xErrorInfo
Definition: logindlg.hxx:42
std::unique_ptr< weld::Label > m_xRequestInfo
Definition: logindlg.hxx:43
bool IsSavePassword() const
Definition: logindlg.hxx:73
std::unique_ptr< weld::CheckButton > m_xUseSysCredsCB
Definition: logindlg.hxx:51
std::unique_ptr< weld::Label > m_xErrorFT
Definition: logindlg.hxx:41
OUString GetName() const
Definition: logindlg.hxx:68
void HideControls_Impl(LoginFlags nFlags)
Definition: logindlg.cxx:41
OUString m_server
Definition: logindlg.hxx:53
void SetPassword(const OUString &rNew)
Definition: logindlg.cxx:35
std::unique_ptr< weld::Button > m_xOKBtn
Definition: logindlg.hxx:52
void SetUseSystemCredentials(bool bUse)
Definition: logindlg.cxx:144
void SetRequest()
Definition: logindlg.cxx:82
OUString GetPassword() const
Definition: logindlg.hxx:70
OUString GetAccount() const
Definition: logindlg.hxx:72
virtual ~LoginDialog() override
Definition: logindlg.cxx:31
std::unique_ptr< weld::Label > m_xAccountFT
Definition: logindlg.hxx:48
OUString m_realm
Definition: logindlg.hxx:54
void EnableUseSysCredsControls_Impl(bool bUseSysCredsEnabled)
Definition: logindlg.cxx:69
DECL_LINK(OKHdl_Impl, weld::Button &, void)
std::unique_ptr< weld::Label > m_xPasswordFT
Definition: logindlg.hxx:46
std::unique_ptr< weld::Entry > m_xPasswordED
Definition: logindlg.hxx:47
std::unique_ptr< weld::Entry > m_xAccountED
Definition: logindlg.hxx:49
bool IsUseSystemCredentials() const
Definition: logindlg.hxx:76
void ClearAccount()
Definition: logindlg.cxx:163
std::unique_ptr< weld::Label > m_xNameFT
Definition: logindlg.hxx:44
void ClearPassword()
Definition: logindlg.cxx:153
void SetErrorText(const OUString &rTxt)
Definition: logindlg.hxx:78
std::unique_ptr< weld::CheckButton > m_xSavePasswdBtn
Definition: logindlg.hxx:50
std::unique_ptr< weld::Entry > m_xNameED
Definition: logindlg.hxx:45
LoginDialog(weld::Window *pParent, LoginFlags nFlags, OUString aServer, OUString aRealm)
Definition: logindlg.cxx:114
void SetSavePasswordText(const OUString &rTxt)
Definition: logindlg.hxx:75
void SetSavePassword(bool bSave)
Definition: logindlg.hxx:74
void SetName(const OUString &rNewName)
Definition: logindlg.hxx:69
DECL_LINK(UseSysCredsHdl_Impl, weld::Toggleable &, void)
LoginFlags
Definition: logindlg.hxx:26
NONE