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 m_LOGINERR_HXX
21 #define m_LOGINERR_HXX
23 #include <tools/string.hxx>
25 //=========================================================================
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 String m_aPasswordToModify
;
48 bool m_bRecommendToOpenReadonly
;
52 : m_nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME
),
53 m_nRet( ERRCODE_BUTTON_CANCEL
)
57 const String
& GetTitle() const { return m_aTitle
; }
58 const String
& GetServer() const { return m_aServer
; }
59 const String
& GetAccount() const { return m_aAccount
; }
60 const String
& GetUserName() const { return m_aUserName
; }
61 const String
& GetPassword() const { return m_aPassword
; }
62 const String
& GetPasswordToModify() const { return m_aPasswordToModify
; }
63 bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly
; }
64 const String
& GetPath() const { return m_aPath
; }
65 const String
& GetErrorText() const { return m_aErrorText
; }
66 sal_Bool
GetCanRememberPassword() const { return ( m_nFlags
& LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
); }
67 sal_Bool
GetIsRememberPersistent() const { return ( m_nFlags
& LOGINERROR_FLAG_REMEMBER_PERSISTENT
); }
68 sal_Bool
GetIsRememberPassword() const { return ( m_nFlags
& LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
); }
70 sal_Bool
GetCanUseSystemCredentials() const
71 { return ( m_nFlags
& LOGINERROR_FLAG_CAN_USE_SYSCREDS
); }
72 sal_Bool
GetIsUseSystemCredentials() const
73 { return ( m_nFlags
& LOGINERROR_FLAG_IS_USE_SYSCREDS
) ==
74 LOGINERROR_FLAG_IS_USE_SYSCREDS
; }
75 sal_uInt8
GetFlags() const { return m_nFlags
; }
76 sal_uInt16
GetResult() const { return m_nRet
; }
78 void SetTitle( const String
& aTitle
)
79 { m_aTitle
= aTitle
; }
80 void SetServer( const String
& aServer
)
81 { m_aServer
= aServer
; }
82 void SetAccount( const String
& aAccount
)
83 { m_aAccount
= aAccount
; }
84 void SetUserName( const String
& aUserName
)
85 { m_aUserName
= aUserName
; }
86 void SetPassword( const String
& aPassword
)
87 { m_aPassword
= aPassword
; }
88 void SetPasswordToModify( const String
& aPassword
)
89 { m_aPasswordToModify
= aPassword
; }
90 void SetRecommendToOpenReadonly( bool bVal
)
91 { m_bRecommendToOpenReadonly
= bVal
; }
92 void SetPath( const String
& aPath
)
94 void SetErrorText( const String
& aErrorText
)
95 { m_aErrorText
= aErrorText
; }
96 void SetFlags( sal_uInt8 nFlags
)
97 { m_nFlags
= nFlags
; }
99 inline void SetCanRememberPassword( sal_Bool bSet
);
100 inline void SetIsRememberPassword( sal_Bool bSet
);
101 inline void SetIsRememberPersistent( sal_Bool bSet
);
103 inline void SetCanUseSystemCredentials( sal_Bool bSet
);
104 inline void SetIsUseSystemCredentials( sal_Bool bSet
);
105 inline void SetModifyAccount( sal_Bool bSet
);
106 inline void SetModifyUserName( sal_Bool bSet
);
108 void SetResult( sal_uInt16 nRet
)
112 inline void LoginErrorInfo::SetCanRememberPassword( sal_Bool bSet
)
115 m_nFlags
|= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
;
117 m_nFlags
&= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
;
120 inline void LoginErrorInfo::SetIsRememberPassword( sal_Bool bSet
)
123 m_nFlags
|= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
;
125 m_nFlags
&= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
;
128 inline void LoginErrorInfo::SetIsRememberPersistent( sal_Bool bSet
)
131 m_nFlags
|= LOGINERROR_FLAG_REMEMBER_PERSISTENT
;
133 m_nFlags
&= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT
;
136 inline void LoginErrorInfo::SetCanUseSystemCredentials( sal_Bool bSet
)
139 m_nFlags
|= LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
141 m_nFlags
&= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
144 inline void LoginErrorInfo::SetIsUseSystemCredentials( sal_Bool bSet
)
147 m_nFlags
|= LOGINERROR_FLAG_IS_USE_SYSCREDS
;
149 m_nFlags
&= ~LOGINERROR_FLAG_IS_USE_SYSCREDS
;
152 inline void LoginErrorInfo::SetModifyAccount( sal_Bool bSet
)
155 m_nFlags
|= LOGINERROR_FLAG_MODIFY_ACCOUNT
;
157 m_nFlags
&= ~LOGINERROR_FLAG_MODIFY_ACCOUNT
;
160 inline void LoginErrorInfo::SetModifyUserName( sal_Bool bSet
)
163 m_nFlags
|= LOGINERROR_FLAG_MODIFY_USER_NAME
;
165 m_nFlags
&= ~LOGINERROR_FLAG_MODIFY_USER_NAME
;
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */