1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_UUI_SOURCE_LOGINERR_HXX
21 #define INCLUDED_UUI_SOURCE_LOGINERR_HXX
23 #include <rtl/ustring.hxx>
26 #define LOGINERROR_FLAG_MODIFY_ACCOUNT 1
27 #define LOGINERROR_FLAG_MODIFY_USER_NAME 2
28 #define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4
29 #define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8
30 #define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
31 #define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
32 #define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64
41 OUString m_aPasswordToModify
;
42 OUString m_aErrorText
;
45 bool m_bRecommendToOpenReadonly
;
49 : m_nFlags(LOGINERROR_FLAG_MODIFY_USER_NAME
)
50 , m_nRet(DialogMask::ButtonsCancel
)
51 , m_bRecommendToOpenReadonly(false)
55 const OUString
& GetServer() const { return m_aServer
; }
56 const OUString
& GetAccount() const { return m_aAccount
; }
57 const OUString
& GetUserName() const { return m_aUserName
; }
58 const OUString
& GetPassword() const { return m_aPassword
; }
59 const OUString
& GetPasswordToModify() const { return m_aPasswordToModify
; }
60 bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly
; }
61 const OUString
& GetErrorText() const { return m_aErrorText
; }
62 bool GetCanRememberPassword() const { return ( m_nFlags
& LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
); }
63 bool GetIsRememberPersistent() const { return ( m_nFlags
& LOGINERROR_FLAG_REMEMBER_PERSISTENT
); }
64 bool GetIsRememberPassword() const { return ( m_nFlags
& LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
); }
66 bool GetCanUseSystemCredentials() const
67 { return ( m_nFlags
& LOGINERROR_FLAG_CAN_USE_SYSCREDS
); }
68 bool GetIsUseSystemCredentials() const
69 { return ( m_nFlags
& LOGINERROR_FLAG_IS_USE_SYSCREDS
) ==
70 LOGINERROR_FLAG_IS_USE_SYSCREDS
; }
71 sal_uInt8
GetFlags() const { return m_nFlags
; }
72 DialogMask
GetResult() const { return m_nRet
; }
74 void SetServer( const OUString
& aServer
)
75 { m_aServer
= aServer
; }
76 void SetAccount( const OUString
& aAccount
)
77 { m_aAccount
= aAccount
; }
78 void SetUserName( const OUString
& aUserName
)
79 { m_aUserName
= aUserName
; }
80 void SetPassword( const OUString
& aPassword
)
81 { m_aPassword
= aPassword
; }
82 void SetPasswordToModify( const OUString
& aPassword
)
83 { m_aPasswordToModify
= aPassword
; }
84 void SetRecommendToOpenReadonly( bool bVal
)
85 { m_bRecommendToOpenReadonly
= bVal
; }
86 void SetErrorText( const OUString
& aErrorText
)
87 { m_aErrorText
= aErrorText
; }
89 inline void SetCanRememberPassword( bool bSet
);
90 inline void SetIsRememberPassword( bool bSet
);
91 inline void SetIsRememberPersistent( bool bSet
);
93 inline void SetCanUseSystemCredentials( bool bSet
);
94 inline void SetIsUseSystemCredentials( bool bSet
);
95 inline void SetModifyAccount( bool bSet
);
96 inline void SetModifyUserName( bool bSet
);
98 void SetResult( DialogMask nRet
)
102 inline void LoginErrorInfo::SetCanRememberPassword( bool bSet
)
105 m_nFlags
|= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
;
107 m_nFlags
&= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
;
110 inline void LoginErrorInfo::SetIsRememberPassword( bool bSet
)
113 m_nFlags
|= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
;
115 m_nFlags
&= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
;
118 inline void LoginErrorInfo::SetIsRememberPersistent( bool bSet
)
121 m_nFlags
|= LOGINERROR_FLAG_REMEMBER_PERSISTENT
;
123 m_nFlags
&= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT
;
126 inline void LoginErrorInfo::SetCanUseSystemCredentials( bool bSet
)
129 m_nFlags
|= LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
131 m_nFlags
&= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
134 inline void LoginErrorInfo::SetIsUseSystemCredentials( bool bSet
)
137 m_nFlags
|= LOGINERROR_FLAG_IS_USE_SYSCREDS
;
139 m_nFlags
&= ~LOGINERROR_FLAG_IS_USE_SYSCREDS
;
142 inline void LoginErrorInfo::SetModifyAccount( bool bSet
)
145 m_nFlags
|= LOGINERROR_FLAG_MODIFY_ACCOUNT
;
147 m_nFlags
&= ~LOGINERROR_FLAG_MODIFY_ACCOUNT
;
150 inline void LoginErrorInfo::SetModifyUserName( bool bSet
)
153 m_nFlags
|= LOGINERROR_FLAG_MODIFY_USER_NAME
;
155 m_nFlags
&= ~LOGINERROR_FLAG_MODIFY_USER_NAME
;
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */