blob: fb8f17a8228d594f1c4e8acaa806478f3d9ead6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#pragma once
#include <rtl/ustring.hxx>
#include <vcl/errinf.hxx>
#define LOGINERROR_FLAG_MODIFY_ACCOUNT 1
#define LOGINERROR_FLAG_MODIFY_USER_NAME 2
#define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4
#define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8
#define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
#define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64
class LoginErrorInfo
{
private:
OUString m_aServer;
OUString m_aAccount;
OUString m_aUserName;
OUString m_aPassword;
OUString m_aPasswordToModify;
OUString m_aErrorText;
sal_uInt8 m_nFlags;
DialogMask m_nRet;
bool m_bRecommendToOpenReadonly;
public:
LoginErrorInfo()
: m_nFlags(LOGINERROR_FLAG_MODIFY_USER_NAME)
, m_nRet(DialogMask::ButtonsCancel)
, m_bRecommendToOpenReadonly(false)
{
}
const OUString& GetServer() const { return m_aServer; }
const OUString& GetAccount() const { return m_aAccount; }
const OUString& GetUserName() const { return m_aUserName; }
const OUString& GetPassword() const { return m_aPassword; }
const OUString& GetPasswordToModify() const { return m_aPasswordToModify; }
bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; }
const OUString& GetErrorText() const { return m_aErrorText; }
bool GetCanRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); }
bool GetIsRememberPersistent() const { return ( m_nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); }
bool GetIsRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); }
bool GetCanUseSystemCredentials() const
{ return ( m_nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); }
bool GetIsUseSystemCredentials() const
{ return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
LOGINERROR_FLAG_IS_USE_SYSCREDS; }
sal_uInt8 GetFlags() const { return m_nFlags; }
DialogMask GetResult() const { return m_nRet; }
void SetServer( const OUString& aServer )
{ m_aServer = aServer; }
void SetAccount( const OUString& aAccount )
{ m_aAccount = aAccount; }
void SetUserName( const OUString& aUserName )
{ m_aUserName = aUserName; }
void SetPassword( const OUString& aPassword )
{ m_aPassword = aPassword; }
void SetPasswordToModify( const OUString& aPassword )
{ m_aPasswordToModify = aPassword; }
void SetRecommendToOpenReadonly( bool bVal )
{ m_bRecommendToOpenReadonly = bVal; }
void SetErrorText( const OUString& aErrorText )
{ m_aErrorText = aErrorText; }
inline void SetCanRememberPassword( bool bSet );
inline void SetIsRememberPassword( bool bSet );
inline void SetIsRememberPersistent( bool bSet );
inline void SetCanUseSystemCredentials( bool bSet );
inline void SetIsUseSystemCredentials( bool bSet );
inline void SetModifyAccount( bool bSet );
inline void SetModifyUserName( bool bSet );
void SetResult( DialogMask nRet )
{ m_nRet = nRet; }
};
inline void LoginErrorInfo::SetCanRememberPassword( bool bSet )
{
if ( bSet )
m_nFlags |= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
else
m_nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
}
inline void LoginErrorInfo::SetIsRememberPassword( bool bSet )
{
if ( bSet )
m_nFlags |= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
else
m_nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
}
inline void LoginErrorInfo::SetIsRememberPersistent( bool bSet )
{
if ( bSet )
m_nFlags |= LOGINERROR_FLAG_REMEMBER_PERSISTENT;
else
m_nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT;
}
inline void LoginErrorInfo::SetCanUseSystemCredentials( bool bSet )
{
if ( bSet )
m_nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS;
else
m_nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
}
inline void LoginErrorInfo::SetIsUseSystemCredentials( bool bSet )
{
if ( bSet )
m_nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS;
else
m_nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
}
inline void LoginErrorInfo::SetModifyAccount( bool bSet )
{
if ( bSet )
m_nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT;
else
m_nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
}
inline void LoginErrorInfo::SetModifyUserName( bool bSet )
{
if ( bSet )
m_nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME;
else
m_nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|