bump product version to 5.0.4.1
[LibreOffice.git] / uui / source / loginerr.hxx
blob81c3769a2c1c42857f53e4cfb21024266ea2805c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_UUI_SOURCE_LOGINERR_HXX
21 #define INCLUDED_UUI_SOURCE_LOGINERR_HXX
23 #include <rtl/ustring.hxx>
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
35 class LoginErrorInfo
37 private:
38 OUString m_aTitle;
39 OUString m_aServer;
40 OUString m_aAccount;
41 OUString m_aUserName;
42 OUString m_aPassword;
43 OUString m_aPasswordToModify;
44 OUString m_aPath;
45 OUString m_aErrorText;
46 sal_uInt8 m_nFlags;
47 sal_uInt16 m_nRet;
48 bool m_bRecommendToOpenReadonly;
50 public:
51 LoginErrorInfo()
52 : m_nFlags(LOGINERROR_FLAG_MODIFY_USER_NAME)
53 , m_nRet(ERRCODE_BUTTON_CANCEL)
54 , m_bRecommendToOpenReadonly(false)
58 const OUString& GetTitle() const { return m_aTitle; }
59 const OUString& GetServer() const { return m_aServer; }
60 const OUString& GetAccount() const { return m_aAccount; }
61 const OUString& GetUserName() const { return m_aUserName; }
62 const OUString& GetPassword() const { return m_aPassword; }
63 const OUString& GetPasswordToModify() const { return m_aPasswordToModify; }
64 bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; }
65 const OUString& GetPath() const { return m_aPath; }
66 const OUString& GetErrorText() const { return m_aErrorText; }
67 bool GetCanRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); }
68 bool GetIsRememberPersistent() const { return ( m_nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); }
69 bool GetIsRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); }
71 bool GetCanUseSystemCredentials() const
72 { return ( m_nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); }
73 bool GetIsUseSystemCredentials() const
74 { return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
75 LOGINERROR_FLAG_IS_USE_SYSCREDS; }
76 sal_uInt8 GetFlags() const { return m_nFlags; }
77 sal_uInt16 GetResult() const { return m_nRet; }
79 void SetTitle( const OUString& aTitle )
80 { m_aTitle = aTitle; }
81 void SetServer( const OUString& aServer )
82 { m_aServer = aServer; }
83 void SetAccount( const OUString& aAccount )
84 { m_aAccount = aAccount; }
85 void SetUserName( const OUString& aUserName )
86 { m_aUserName = aUserName; }
87 void SetPassword( const OUString& aPassword )
88 { m_aPassword = aPassword; }
89 void SetPasswordToModify( const OUString& aPassword )
90 { m_aPasswordToModify = aPassword; }
91 void SetRecommendToOpenReadonly( bool bVal )
92 { m_bRecommendToOpenReadonly = bVal; }
93 void SetPath( const OUString& aPath )
94 { m_aPath = aPath; }
95 void SetErrorText( const OUString& aErrorText )
96 { m_aErrorText = aErrorText; }
97 void SetFlags( sal_uInt8 nFlags )
98 { m_nFlags = nFlags; }
100 inline void SetCanRememberPassword( bool bSet );
101 inline void SetIsRememberPassword( bool bSet );
102 inline void SetIsRememberPersistent( bool bSet );
104 inline void SetCanUseSystemCredentials( bool bSet );
105 inline void SetIsUseSystemCredentials( bool bSet );
106 inline void SetModifyAccount( bool bSet );
107 inline void SetModifyUserName( bool bSet );
109 void SetResult( sal_uInt16 nRet )
110 { m_nRet = nRet; }
113 inline void LoginErrorInfo::SetCanRememberPassword( bool bSet )
115 if ( bSet )
116 m_nFlags |= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
117 else
118 m_nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
121 inline void LoginErrorInfo::SetIsRememberPassword( bool bSet )
123 if ( bSet )
124 m_nFlags |= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
125 else
126 m_nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
129 inline void LoginErrorInfo::SetIsRememberPersistent( bool bSet )
131 if ( bSet )
132 m_nFlags |= LOGINERROR_FLAG_REMEMBER_PERSISTENT;
133 else
134 m_nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT;
137 inline void LoginErrorInfo::SetCanUseSystemCredentials( bool bSet )
139 if ( bSet )
140 m_nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS;
141 else
142 m_nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
145 inline void LoginErrorInfo::SetIsUseSystemCredentials( bool bSet )
147 if ( bSet )
148 m_nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS;
149 else
150 m_nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
153 inline void LoginErrorInfo::SetModifyAccount( bool bSet )
155 if ( bSet )
156 m_nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT;
157 else
158 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
161 inline void LoginErrorInfo::SetModifyUserName( bool bSet )
163 if ( bSet )
164 m_nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME;
165 else
166 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
169 #endif
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */