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 #ifndef _STRING_HXX //autogen
35 #include <tools/string.hxx>
37 #ifndef _ERRCODE_HXX //autogen
38 #include <tools/errcode.hxx>
41 #ifndef _SFXHINT_HXX //autogen
42 #include <bf_svtools/hint.hxx>
48 //=========================================================================
50 #define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1
51 #define LOGINERROR_FLAG_MODIFY_ACCOUNT 2
52 #define LOGINERROR_FLAG_MODIFY_USER_NAME 4
53 #define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8
70 : _nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME
),
71 _nRet( ERRCODE_BUTTON_CANCEL
)
75 const String
& GetTitle() const { return _aTitle
; }
76 const String
& GetServer() const { return _aServer
; }
77 const String
& GetAccount() const { return _aAccount
; }
78 const String
& GetUserName() const { return _aUserName
; }
79 const String
& GetPassword() const { return _aPassword
; }
80 const String
& GetPath() const { return _aPath
; }
81 const String
& GetErrorText() const { return _aErrorText
; }
82 BOOL
GetIsPersistentPassword() const
83 { return ( _nFlags
& LOGINERROR_FLAG_PERSISTENT_PASSWORD
); }
84 BOOL
GetIsSavePassword() const
85 { return ( _nFlags
& LOGINERROR_FLAG_SET_SAVE_PASSWORD
); }
86 BYTE
GetFlags() const { return _nFlags
; }
87 USHORT
GetResult() const { return _nRet
; }
89 void SetTitle( const String
& aTitle
)
91 void SetServer( const String
& aServer
)
92 { _aServer
= aServer
; }
93 void SetAccount( const String
& aAccount
)
94 { _aAccount
= aAccount
; }
95 void SetUserName( const String
& aUserName
)
96 { _aUserName
= aUserName
; }
97 void SetPassword( const String
& aPassword
)
98 { _aPassword
= aPassword
; }
99 void SetPath( const String
& aPath
)
101 void SetErrorText( const String
& aErrorText
)
102 { _aErrorText
= aErrorText
; }
103 void SetFlags( BYTE nFlags
)
104 { _nFlags
= nFlags
; }
105 inline void SetSavePassword( BOOL bSet
);
106 inline void SetPersistentPassword( BOOL bSet
);
107 inline void SetModifyAccount( BOOL bSet
);
108 inline void SetModifyUserName( BOOL bSet
);
109 void SetResult( USHORT nRet
)
113 inline void LoginErrorInfo::SetSavePassword( BOOL bSet
)
116 _nFlags
|= LOGINERROR_FLAG_SET_SAVE_PASSWORD
;
118 _nFlags
&= ~LOGINERROR_FLAG_SET_SAVE_PASSWORD
;
121 inline void LoginErrorInfo::SetPersistentPassword( BOOL bSet
)
124 _nFlags
|= LOGINERROR_FLAG_PERSISTENT_PASSWORD
;
126 _nFlags
&= ~LOGINERROR_FLAG_PERSISTENT_PASSWORD
;
129 inline void LoginErrorInfo::SetModifyAccount( BOOL bSet
)
132 _nFlags
|= LOGINERROR_FLAG_MODIFY_ACCOUNT
;
134 _nFlags
&= ~LOGINERROR_FLAG_MODIFY_ACCOUNT
;
137 inline void LoginErrorInfo::SetModifyUserName( BOOL bSet
)
140 _nFlags
|= LOGINERROR_FLAG_MODIFY_USER_NAME
;
142 _nFlags
&= ~LOGINERROR_FLAG_MODIFY_USER_NAME
;
145 //=========================================================================
147 class CntLoginErrorHint
: public SfxHint
150 LoginErrorInfo
* _pInfo
;
152 CntLoginErrorHint( const CntLoginErrorHint
& ); // n.i.
153 CntLoginErrorHint
& operator=( const CntLoginErrorHint
& ); // n.i.
158 CntLoginErrorHint( LoginErrorInfo
* pInfo
)
163 LoginErrorInfo
& GetErrorInfo() const { return *_pInfo
; }