Revert "Related tdf#158739: blacklist Nvidia RTX 4050 for Skia hardware"
[LibreOffice.git] / uui / source / loginerr.hxx
blobfb8f17a8228d594f1c4e8acaa806478f3d9ead6c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <rtl/ustring.hxx>
23 #include <vcl/errinf.hxx>
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
33 class LoginErrorInfo
35 private:
36 OUString m_aServer;
37 OUString m_aAccount;
38 OUString m_aUserName;
39 OUString m_aPassword;
40 OUString m_aPasswordToModify;
41 OUString m_aErrorText;
42 sal_uInt8 m_nFlags;
43 DialogMask m_nRet;
44 bool m_bRecommendToOpenReadonly;
46 public:
47 LoginErrorInfo()
48 : m_nFlags(LOGINERROR_FLAG_MODIFY_USER_NAME)
49 , m_nRet(DialogMask::ButtonsCancel)
50 , m_bRecommendToOpenReadonly(false)
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; }
59 bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; }
60 const OUString& GetErrorText() const { return m_aErrorText; }
61 bool GetCanRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); }
62 bool GetIsRememberPersistent() const { return ( m_nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); }
63 bool GetIsRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); }
65 bool GetCanUseSystemCredentials() const
66 { return ( m_nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); }
67 bool GetIsUseSystemCredentials() const
68 { return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
69 LOGINERROR_FLAG_IS_USE_SYSCREDS; }
70 sal_uInt8 GetFlags() const { return m_nFlags; }
71 DialogMask GetResult() const { return m_nRet; }
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; }
83 void SetRecommendToOpenReadonly( bool bVal )
84 { m_bRecommendToOpenReadonly = bVal; }
85 void SetErrorText( const OUString& aErrorText )
86 { m_aErrorText = aErrorText; }
88 inline void SetCanRememberPassword( bool bSet );
89 inline void SetIsRememberPassword( bool bSet );
90 inline void SetIsRememberPersistent( bool bSet );
92 inline void SetCanUseSystemCredentials( bool bSet );
93 inline void SetIsUseSystemCredentials( bool bSet );
94 inline void SetModifyAccount( bool bSet );
95 inline void SetModifyUserName( bool bSet );
97 void SetResult( DialogMask nRet )
98 { m_nRet = nRet; }
101 inline void LoginErrorInfo::SetCanRememberPassword( bool bSet )
103 if ( bSet )
104 m_nFlags |= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
105 else
106 m_nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
109 inline void LoginErrorInfo::SetIsRememberPassword( bool bSet )
111 if ( bSet )
112 m_nFlags |= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
113 else
114 m_nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
117 inline void LoginErrorInfo::SetIsRememberPersistent( bool bSet )
119 if ( bSet )
120 m_nFlags |= LOGINERROR_FLAG_REMEMBER_PERSISTENT;
121 else
122 m_nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT;
125 inline void LoginErrorInfo::SetCanUseSystemCredentials( bool bSet )
127 if ( bSet )
128 m_nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS;
129 else
130 m_nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
133 inline void LoginErrorInfo::SetIsUseSystemCredentials( bool bSet )
135 if ( bSet )
136 m_nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS;
137 else
138 m_nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
141 inline void LoginErrorInfo::SetModifyAccount( bool bSet )
143 if ( bSet )
144 m_nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT;
145 else
146 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
149 inline void LoginErrorInfo::SetModifyUserName( bool bSet )
151 if ( bSet )
152 m_nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME;
153 else
154 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */