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>
27 #define LOGINERROR_FLAG_MODIFY_ACCOUNT 1
28 #define LOGINERROR_FLAG_MODIFY_USER_NAME 2
29 #define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4
30 #define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8
31 #define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
32 #define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
33 #define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64
43 OUString m_aPasswordToModify
;
45 OUString m_aErrorText
;
48 bool m_bRecommendToOpenReadonly
;
52 : m_nFlags(LOGINERROR_FLAG_MODIFY_USER_NAME
)
53 , m_nRet(ERRCODE_BUTTON_CANCEL
)
54 , m_bRecommendToOpenReadonly(false)
58 const OUString
& GetTitle() const { return m_aTitle
; }
59 const OUString
& GetServer() const { return m_aServer
; }
60 const OUString
& GetAccount() const { return m_aAccount
; }
61 const OUString
& GetUserName() const { return m_aUserName
; }
62 const OUString
& GetPassword() const { return m_aPassword
; }
63 const OUString
& GetPasswordToModify() const { return m_aPasswordToModify
; }
64 bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly
; }
65 const OUString
& GetPath() const { return m_aPath
; }
66 const OUString
& GetErrorText() const { return m_aErrorText
; }
67 bool GetCanRememberPassword() const { return ( m_nFlags
& LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
); }
68 bool GetIsRememberPersistent() const { return ( m_nFlags
& LOGINERROR_FLAG_REMEMBER_PERSISTENT
); }
69 bool GetIsRememberPassword() const { return ( m_nFlags
& LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
); }
71 bool GetCanUseSystemCredentials() const
72 { return ( m_nFlags
& LOGINERROR_FLAG_CAN_USE_SYSCREDS
); }
73 bool GetIsUseSystemCredentials() const
74 { return ( m_nFlags
& LOGINERROR_FLAG_IS_USE_SYSCREDS
) ==
75 LOGINERROR_FLAG_IS_USE_SYSCREDS
; }
76 sal_uInt8
GetFlags() const { return m_nFlags
; }
77 sal_uInt16
GetResult() const { return m_nRet
; }
79 void SetTitle( const OUString
& aTitle
)
80 { m_aTitle
= aTitle
; }
81 void SetServer( const OUString
& aServer
)
82 { m_aServer
= aServer
; }
83 void SetAccount( const OUString
& aAccount
)
84 { m_aAccount
= aAccount
; }
85 void SetUserName( const OUString
& aUserName
)
86 { m_aUserName
= aUserName
; }
87 void SetPassword( const OUString
& aPassword
)
88 { m_aPassword
= aPassword
; }
89 void SetPasswordToModify( const OUString
& aPassword
)
90 { m_aPasswordToModify
= aPassword
; }
91 void SetRecommendToOpenReadonly( bool bVal
)
92 { m_bRecommendToOpenReadonly
= bVal
; }
93 void SetPath( const OUString
& aPath
)
95 void SetErrorText( const OUString
& aErrorText
)
96 { m_aErrorText
= aErrorText
; }
97 void SetFlags( sal_uInt8 nFlags
)
98 { m_nFlags
= nFlags
; }
100 inline void SetCanRememberPassword( bool bSet
);
101 inline void SetIsRememberPassword( bool bSet
);
102 inline void SetIsRememberPersistent( bool bSet
);
104 inline void SetCanUseSystemCredentials( bool bSet
);
105 inline void SetIsUseSystemCredentials( bool bSet
);
106 inline void SetModifyAccount( bool bSet
);
107 inline void SetModifyUserName( bool bSet
);
109 void SetResult( sal_uInt16 nRet
)
113 inline void LoginErrorInfo::SetCanRememberPassword( bool bSet
)
116 m_nFlags
|= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
;
118 m_nFlags
&= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
;
121 inline void LoginErrorInfo::SetIsRememberPassword( bool bSet
)
124 m_nFlags
|= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
;
126 m_nFlags
&= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
;
129 inline void LoginErrorInfo::SetIsRememberPersistent( bool bSet
)
132 m_nFlags
|= LOGINERROR_FLAG_REMEMBER_PERSISTENT
;
134 m_nFlags
&= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT
;
137 inline void LoginErrorInfo::SetCanUseSystemCredentials( bool bSet
)
140 m_nFlags
|= LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
142 m_nFlags
&= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
145 inline void LoginErrorInfo::SetIsUseSystemCredentials( bool bSet
)
148 m_nFlags
|= LOGINERROR_FLAG_IS_USE_SYSCREDS
;
150 m_nFlags
&= ~LOGINERROR_FLAG_IS_USE_SYSCREDS
;
153 inline void LoginErrorInfo::SetModifyAccount( bool bSet
)
156 m_nFlags
|= LOGINERROR_FLAG_MODIFY_ACCOUNT
;
158 m_nFlags
&= ~LOGINERROR_FLAG_MODIFY_ACCOUNT
;
161 inline void LoginErrorInfo::SetModifyUserName( bool bSet
)
164 m_nFlags
|= LOGINERROR_FLAG_MODIFY_USER_NAME
;
166 m_nFlags
&= ~LOGINERROR_FLAG_MODIFY_USER_NAME
;
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */