Bump for 3.6-28
[LibreOffice.git] / uui / source / loginerr.hxx
blobbdab13f97a3a30757ad8129884ed33c3548c71f5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef m_LOGINERR_HXX
30 #define m_LOGINERR_HXX
32 #include <tools/string.hxx>
34 //=========================================================================
36 #define LOGINERROR_FLAG_MODIFY_ACCOUNT 1
37 #define LOGINERROR_FLAG_MODIFY_USER_NAME 2
38 #define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4
39 #define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8
40 #define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
41 #define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
42 #define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64
44 class LoginErrorInfo
46 private:
47 String m_aTitle;
48 String m_aServer;
49 String m_aAccount;
50 String m_aUserName;
51 String m_aPassword;
52 String m_aPasswordToModify;
53 String m_aPath;
54 String m_aErrorText;
55 sal_uInt8 m_nFlags;
56 sal_uInt16 m_nRet;
57 bool m_bRecommendToOpenReadonly;
59 public:
60 LoginErrorInfo()
61 : m_nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME ),
62 m_nRet( ERRCODE_BUTTON_CANCEL )
66 const String& GetTitle() const { return m_aTitle; }
67 const String& GetServer() const { return m_aServer; }
68 const String& GetAccount() const { return m_aAccount; }
69 const String& GetUserName() const { return m_aUserName; }
70 const String& GetPassword() const { return m_aPassword; }
71 const String& GetPasswordToModify() const { return m_aPasswordToModify; }
72 bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; }
73 const String& GetPath() const { return m_aPath; }
74 const String& GetErrorText() const { return m_aErrorText; }
75 sal_Bool GetCanRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); }
76 sal_Bool GetIsRememberPersistent() const { return ( m_nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); }
77 sal_Bool GetIsRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); }
79 sal_Bool GetCanUseSystemCredentials() const
80 { return ( m_nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); }
81 sal_Bool GetIsUseSystemCredentials() const
82 { return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
83 LOGINERROR_FLAG_IS_USE_SYSCREDS; }
84 sal_uInt8 GetFlags() const { return m_nFlags; }
85 sal_uInt16 GetResult() const { return m_nRet; }
87 void SetTitle( const String& aTitle )
88 { m_aTitle = aTitle; }
89 void SetServer( const String& aServer )
90 { m_aServer = aServer; }
91 void SetAccount( const String& aAccount )
92 { m_aAccount = aAccount; }
93 void SetUserName( const String& aUserName )
94 { m_aUserName = aUserName; }
95 void SetPassword( const String& aPassword )
96 { m_aPassword = aPassword; }
97 void SetPasswordToModify( const String& aPassword )
98 { m_aPasswordToModify = aPassword; }
99 void SetRecommendToOpenReadonly( bool bVal )
100 { m_bRecommendToOpenReadonly = bVal; }
101 void SetPath( const String& aPath )
102 { m_aPath = aPath; }
103 void SetErrorText( const String& aErrorText )
104 { m_aErrorText = aErrorText; }
105 void SetFlags( sal_uInt8 nFlags )
106 { m_nFlags = nFlags; }
108 inline void SetCanRememberPassword( sal_Bool bSet );
109 inline void SetIsRememberPassword( sal_Bool bSet );
110 inline void SetIsRememberPersistent( sal_Bool bSet );
112 inline void SetCanUseSystemCredentials( sal_Bool bSet );
113 inline void SetIsUseSystemCredentials( sal_Bool bSet );
114 inline void SetModifyAccount( sal_Bool bSet );
115 inline void SetModifyUserName( sal_Bool bSet );
117 void SetResult( sal_uInt16 nRet )
118 { m_nRet = nRet; }
121 inline void LoginErrorInfo::SetCanRememberPassword( sal_Bool bSet )
123 if ( bSet )
124 m_nFlags |= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
125 else
126 m_nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
129 inline void LoginErrorInfo::SetIsRememberPassword( sal_Bool bSet )
131 if ( bSet )
132 m_nFlags |= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
133 else
134 m_nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
137 inline void LoginErrorInfo::SetIsRememberPersistent( sal_Bool bSet )
139 if ( bSet )
140 m_nFlags |= LOGINERROR_FLAG_REMEMBER_PERSISTENT;
141 else
142 m_nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT;
145 inline void LoginErrorInfo::SetCanUseSystemCredentials( sal_Bool bSet )
147 if ( bSet )
148 m_nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS;
149 else
150 m_nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
153 inline void LoginErrorInfo::SetIsUseSystemCredentials( sal_Bool bSet )
155 if ( bSet )
156 m_nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS;
157 else
158 m_nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
161 inline void LoginErrorInfo::SetModifyAccount( sal_Bool bSet )
163 if ( bSet )
164 m_nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT;
165 else
166 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
169 inline void LoginErrorInfo::SetModifyUserName( sal_Bool bSet )
171 if ( bSet )
172 m_nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME;
173 else
174 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
177 #endif
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */