1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef m_LOGINERR_HXX
29 #define m_LOGINERR_HXX
31 #include <tools/string.hxx>
33 //=========================================================================
35 #define LOGINERROR_FLAG_MODIFY_ACCOUNT 1
36 #define LOGINERROR_FLAG_MODIFY_USER_NAME 2
37 #define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4
38 #define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8
39 #define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
40 #define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
41 #define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64
51 String m_aPasswordToModify
;
56 bool m_bRecommendToOpenReadonly
;
60 : m_nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME
),
61 m_nRet( ERRCODE_BUTTON_CANCEL
)
65 const String
& GetTitle() const { return m_aTitle
; }
66 const String
& GetServer() const { return m_aServer
; }
67 const String
& GetAccount() const { return m_aAccount
; }
68 const String
& GetUserName() const { return m_aUserName
; }
69 const String
& GetPassword() const { return m_aPassword
; }
70 const String
& GetPasswordToModify() const { return m_aPasswordToModify
; }
71 bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly
; }
72 const String
& GetPath() const { return m_aPath
; }
73 const String
& GetErrorText() const { return m_aErrorText
; }
74 sal_Bool
GetCanRememberPassword() const { return ( m_nFlags
& LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
); }
75 sal_Bool
GetIsRememberPersistent() const { return ( m_nFlags
& LOGINERROR_FLAG_REMEMBER_PERSISTENT
); }
76 sal_Bool
GetIsRememberPassword() const { return ( m_nFlags
& LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
); }
78 sal_Bool
GetCanUseSystemCredentials() const
79 { return ( m_nFlags
& LOGINERROR_FLAG_CAN_USE_SYSCREDS
); }
80 sal_Bool
GetIsUseSystemCredentials() const
81 { return ( m_nFlags
& LOGINERROR_FLAG_IS_USE_SYSCREDS
) ==
82 LOGINERROR_FLAG_IS_USE_SYSCREDS
; }
83 sal_uInt8
GetFlags() const { return m_nFlags
; }
84 sal_uInt16
GetResult() const { return m_nRet
; }
86 void SetTitle( const String
& aTitle
)
87 { m_aTitle
= aTitle
; }
88 void SetServer( const String
& aServer
)
89 { m_aServer
= aServer
; }
90 void SetAccount( const String
& aAccount
)
91 { m_aAccount
= aAccount
; }
92 void SetUserName( const String
& aUserName
)
93 { m_aUserName
= aUserName
; }
94 void SetPassword( const String
& aPassword
)
95 { m_aPassword
= aPassword
; }
96 void SetPasswordToModify( const String
& aPassword
)
97 { m_aPasswordToModify
= aPassword
; }
98 void SetRecommendToOpenReadonly( bool bVal
)
99 { m_bRecommendToOpenReadonly
= bVal
; }
100 void SetPath( const String
& aPath
)
102 void SetErrorText( const String
& aErrorText
)
103 { m_aErrorText
= aErrorText
; }
104 void SetFlags( sal_uInt8 nFlags
)
105 { m_nFlags
= nFlags
; }
107 inline void SetCanRememberPassword( sal_Bool bSet
);
108 inline void SetIsRememberPassword( sal_Bool bSet
);
109 inline void SetIsRememberPersistent( sal_Bool bSet
);
111 inline void SetCanUseSystemCredentials( sal_Bool bSet
);
112 inline void SetIsUseSystemCredentials( sal_Bool bSet
);
113 inline void SetModifyAccount( sal_Bool bSet
);
114 inline void SetModifyUserName( sal_Bool bSet
);
116 void SetResult( sal_uInt16 nRet
)
120 inline void LoginErrorInfo::SetCanRememberPassword( sal_Bool bSet
)
123 m_nFlags
|= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
;
125 m_nFlags
&= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD
;
128 inline void LoginErrorInfo::SetIsRememberPassword( sal_Bool bSet
)
131 m_nFlags
|= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
;
133 m_nFlags
&= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD
;
136 inline void LoginErrorInfo::SetIsRememberPersistent( sal_Bool bSet
)
139 m_nFlags
|= LOGINERROR_FLAG_REMEMBER_PERSISTENT
;
141 m_nFlags
&= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT
;
144 inline void LoginErrorInfo::SetCanUseSystemCredentials( sal_Bool bSet
)
147 m_nFlags
|= LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
149 m_nFlags
&= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
152 inline void LoginErrorInfo::SetIsUseSystemCredentials( sal_Bool bSet
)
155 m_nFlags
|= LOGINERROR_FLAG_IS_USE_SYSCREDS
;
157 m_nFlags
&= ~LOGINERROR_FLAG_IS_USE_SYSCREDS
;
160 inline void LoginErrorInfo::SetModifyAccount( sal_Bool bSet
)
163 m_nFlags
|= LOGINERROR_FLAG_MODIFY_ACCOUNT
;
165 m_nFlags
&= ~LOGINERROR_FLAG_MODIFY_ACCOUNT
;
168 inline void LoginErrorInfo::SetModifyUserName( sal_Bool bSet
)
171 m_nFlags
|= LOGINERROR_FLAG_MODIFY_USER_NAME
;
173 m_nFlags
&= ~LOGINERROR_FLAG_MODIFY_USER_NAME
;