1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: loginerr.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <tools/string.hxx>
36 //=========================================================================
38 #define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1
39 #define LOGINERROR_FLAG_MODIFY_ACCOUNT 2
40 #define LOGINERROR_FLAG_MODIFY_USER_NAME 4
41 #define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8
42 #define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
43 #define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
60 : _nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME
),
61 _nRet( ERRCODE_BUTTON_CANCEL
)
65 const String
& GetTitle() const { return _aTitle
; }
66 const String
& GetServer() const { return _aServer
; }
67 const String
& GetAccount() const { return _aAccount
; }
68 const String
& GetUserName() const { return _aUserName
; }
69 const String
& GetPassword() const { return _aPassword
; }
70 const String
& GetPath() const { return _aPath
; }
71 const String
& GetErrorText() const { return _aErrorText
; }
72 BOOL
GetIsPersistentPassword() const
73 { return ( _nFlags
& LOGINERROR_FLAG_PERSISTENT_PASSWORD
); }
74 BOOL
GetIsSavePassword() const
75 { return ( _nFlags
& LOGINERROR_FLAG_SET_SAVE_PASSWORD
); }
76 BOOL
GetCanUseSystemCredentials() const
77 { return ( _nFlags
& LOGINERROR_FLAG_CAN_USE_SYSCREDS
); }
78 BOOL
GetIsUseSystemCredentials() const
79 { return ( _nFlags
& LOGINERROR_FLAG_IS_USE_SYSCREDS
) ==
80 LOGINERROR_FLAG_IS_USE_SYSCREDS
; }
81 BYTE
GetFlags() const { return _nFlags
; }
82 USHORT
GetResult() const { return _nRet
; }
84 void SetTitle( const String
& aTitle
)
86 void SetServer( const String
& aServer
)
87 { _aServer
= aServer
; }
88 void SetAccount( const String
& aAccount
)
89 { _aAccount
= aAccount
; }
90 void SetUserName( const String
& aUserName
)
91 { _aUserName
= aUserName
; }
92 void SetPassword( const String
& aPassword
)
93 { _aPassword
= aPassword
; }
94 void SetPath( const String
& aPath
)
96 void SetErrorText( const String
& aErrorText
)
97 { _aErrorText
= aErrorText
; }
98 void SetFlags( BYTE nFlags
)
100 inline void SetSavePassword( BOOL bSet
);
101 inline void SetPersistentPassword( BOOL bSet
);
102 inline void SetCanUseSystemCredentials( BOOL bSet
);
103 inline void SetIsUseSystemCredentials( BOOL bSet
);
104 inline void SetModifyAccount( BOOL bSet
);
105 inline void SetModifyUserName( BOOL bSet
);
106 void SetResult( USHORT nRet
)
110 inline void LoginErrorInfo::SetSavePassword( BOOL bSet
)
113 _nFlags
|= LOGINERROR_FLAG_SET_SAVE_PASSWORD
;
115 _nFlags
&= ~LOGINERROR_FLAG_SET_SAVE_PASSWORD
;
118 inline void LoginErrorInfo::SetPersistentPassword( BOOL bSet
)
121 _nFlags
|= LOGINERROR_FLAG_PERSISTENT_PASSWORD
;
123 _nFlags
&= ~LOGINERROR_FLAG_PERSISTENT_PASSWORD
;
126 inline void LoginErrorInfo::SetCanUseSystemCredentials( BOOL bSet
)
129 _nFlags
|= LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
131 _nFlags
&= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS
;
134 inline void LoginErrorInfo::SetIsUseSystemCredentials( BOOL bSet
)
137 _nFlags
|= LOGINERROR_FLAG_IS_USE_SYSCREDS
;
139 _nFlags
&= ~LOGINERROR_FLAG_IS_USE_SYSCREDS
;
142 inline void LoginErrorInfo::SetModifyAccount( BOOL bSet
)
145 _nFlags
|= LOGINERROR_FLAG_MODIFY_ACCOUNT
;
147 _nFlags
&= ~LOGINERROR_FLAG_MODIFY_ACCOUNT
;
150 inline void LoginErrorInfo::SetModifyUserName( BOOL bSet
)
153 _nFlags
|= LOGINERROR_FLAG_MODIFY_USER_NAME
;
155 _nFlags
&= ~LOGINERROR_FLAG_MODIFY_USER_NAME
;