LibreOffice Module uui (master) 1
loginerr.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 <rtl/ustring.hxx>
23#include <vcl/errinf.hxx>
24
25#define LOGINERROR_FLAG_MODIFY_ACCOUNT 1
26#define LOGINERROR_FLAG_MODIFY_USER_NAME 2
27#define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4
28#define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8
29#define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
30#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
31#define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64
32
34{
35private:
36 OUString m_aServer;
37 OUString m_aAccount;
38 OUString m_aUserName;
39 OUString m_aPassword;
41 OUString m_aErrorText;
45
46public:
51 {
52 }
53
54 const OUString& GetServer() const { return m_aServer; }
55 const OUString& GetAccount() const { return m_aAccount; }
56 const OUString& GetUserName() const { return m_aUserName; }
57 const OUString& GetPassword() const { return m_aPassword; }
58 const OUString& GetPasswordToModify() const { return m_aPasswordToModify; }
60 const OUString& GetErrorText() const { return m_aErrorText; }
64
70 sal_uInt8 GetFlags() const { return m_nFlags; }
71 DialogMask GetResult() const { return m_nRet; }
72
73 void SetServer( const OUString& aServer )
74 { m_aServer = aServer; }
75 void SetAccount( const OUString& aAccount )
76 { m_aAccount = aAccount; }
77 void SetUserName( const OUString& aUserName )
78 { m_aUserName = aUserName; }
79 void SetPassword( const OUString& aPassword )
80 { m_aPassword = aPassword; }
81 void SetPasswordToModify( const OUString& aPassword )
82 { m_aPasswordToModify = aPassword; }
85 void SetErrorText( const OUString& aErrorText )
86 { m_aErrorText = aErrorText; }
87
88 inline void SetCanRememberPassword( bool bSet );
89 inline void SetIsRememberPassword( bool bSet );
90 inline void SetIsRememberPersistent( bool bSet );
91
92 inline void SetCanUseSystemCredentials( bool bSet );
93 inline void SetIsUseSystemCredentials( bool bSet );
94 inline void SetModifyAccount( bool bSet );
95 inline void SetModifyUserName( bool bSet );
96
97 void SetResult( DialogMask nRet )
98 { m_nRet = nRet; }
99};
100
102{
103 if ( bSet )
105 else
106 m_nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
107}
108
110{
111 if ( bSet )
113 else
114 m_nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
115}
116
118{
119 if ( bSet )
121 else
122 m_nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT;
123}
124
126{
127 if ( bSet )
129 else
130 m_nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
131}
132
134{
135 if ( bSet )
137 else
138 m_nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
139}
140
141inline void LoginErrorInfo::SetModifyAccount( bool bSet )
142{
143 if ( bSet )
145 else
146 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
147}
148
149inline void LoginErrorInfo::SetModifyUserName( bool bSet )
150{
151 if ( bSet )
153 else
154 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
155}
156
157
158/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetErrorText(const OUString &aErrorText)
Definition: loginerr.hxx:85
void SetCanUseSystemCredentials(bool bSet)
Definition: loginerr.hxx:125
const OUString & GetUserName() const
Definition: loginerr.hxx:56
void SetModifyUserName(bool bSet)
Definition: loginerr.hxx:149
void SetRecommendToOpenReadonly(bool bVal)
Definition: loginerr.hxx:83
const OUString & GetAccount() const
Definition: loginerr.hxx:55
OUString m_aPassword
Definition: loginerr.hxx:39
void SetPasswordToModify(const OUString &aPassword)
Definition: loginerr.hxx:81
bool GetCanUseSystemCredentials() const
Definition: loginerr.hxx:65
OUString m_aErrorText
Definition: loginerr.hxx:41
void SetIsRememberPersistent(bool bSet)
Definition: loginerr.hxx:117
void SetUserName(const OUString &aUserName)
Definition: loginerr.hxx:77
sal_uInt8 GetFlags() const
Definition: loginerr.hxx:70
bool GetIsRememberPersistent() const
Definition: loginerr.hxx:62
void SetIsRememberPassword(bool bSet)
Definition: loginerr.hxx:109
void SetPassword(const OUString &aPassword)
Definition: loginerr.hxx:79
void SetIsUseSystemCredentials(bool bSet)
Definition: loginerr.hxx:133
OUString m_aPasswordToModify
Definition: loginerr.hxx:40
OUString m_aUserName
Definition: loginerr.hxx:38
DialogMask GetResult() const
Definition: loginerr.hxx:71
bool GetCanRememberPassword() const
Definition: loginerr.hxx:61
const OUString & GetErrorText() const
Definition: loginerr.hxx:60
bool IsRecommendToOpenReadonly() const
Definition: loginerr.hxx:59
DialogMask m_nRet
Definition: loginerr.hxx:43
bool m_bRecommendToOpenReadonly
Definition: loginerr.hxx:44
bool GetIsUseSystemCredentials() const
Definition: loginerr.hxx:67
OUString m_aServer
Definition: loginerr.hxx:36
const OUString & GetPasswordToModify() const
Definition: loginerr.hxx:58
const OUString & GetServer() const
Definition: loginerr.hxx:54
void SetAccount(const OUString &aAccount)
Definition: loginerr.hxx:75
void SetCanRememberPassword(bool bSet)
Definition: loginerr.hxx:101
const OUString & GetPassword() const
Definition: loginerr.hxx:57
void SetServer(const OUString &aServer)
Definition: loginerr.hxx:73
OUString m_aAccount
Definition: loginerr.hxx:37
bool GetIsRememberPassword() const
Definition: loginerr.hxx:63
sal_uInt8 m_nFlags
Definition: loginerr.hxx:42
void SetResult(DialogMask nRet)
Definition: loginerr.hxx:97
void SetModifyAccount(bool bSet)
Definition: loginerr.hxx:141
DialogMask
#define LOGINERROR_FLAG_REMEMBER_PERSISTENT
Definition: loginerr.hxx:31
#define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
Definition: loginerr.hxx:28
#define LOGINERROR_FLAG_IS_USE_SYSCREDS
Definition: loginerr.hxx:30
#define LOGINERROR_FLAG_MODIFY_USER_NAME
Definition: loginerr.hxx:26
#define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
Definition: loginerr.hxx:27
#define LOGINERROR_FLAG_CAN_USE_SYSCREDS
Definition: loginerr.hxx:29
#define LOGINERROR_FLAG_MODIFY_ACCOUNT
Definition: loginerr.hxx:25
unsigned char sal_uInt8