bump product version to 6.3.0.0.beta1
[LibreOffice.git] / uui / source / loginerr.hxx
blob76973684c855e39d74fca916cf1ec835cfab8cc9
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>
26 #define LOGINERROR_FLAG_MODIFY_ACCOUNT 1
27 #define LOGINERROR_FLAG_MODIFY_USER_NAME 2
28 #define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4
29 #define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8
30 #define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
31 #define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
32 #define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64
34 class LoginErrorInfo
36 private:
37 OUString m_aServer;
38 OUString m_aAccount;
39 OUString m_aUserName;
40 OUString m_aPassword;
41 OUString m_aPasswordToModify;
42 OUString m_aErrorText;
43 sal_uInt8 m_nFlags;
44 DialogMask m_nRet;
45 bool m_bRecommendToOpenReadonly;
47 public:
48 LoginErrorInfo()
49 : m_nFlags(LOGINERROR_FLAG_MODIFY_USER_NAME)
50 , m_nRet(DialogMask::ButtonsCancel)
51 , m_bRecommendToOpenReadonly(false)
55 const OUString& GetServer() const { return m_aServer; }
56 const OUString& GetAccount() const { return m_aAccount; }
57 const OUString& GetUserName() const { return m_aUserName; }
58 const OUString& GetPassword() const { return m_aPassword; }
59 const OUString& GetPasswordToModify() const { return m_aPasswordToModify; }
60 bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; }
61 const OUString& GetErrorText() const { return m_aErrorText; }
62 bool GetCanRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); }
63 bool GetIsRememberPersistent() const { return ( m_nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); }
64 bool GetIsRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); }
66 bool GetCanUseSystemCredentials() const
67 { return ( m_nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); }
68 bool GetIsUseSystemCredentials() const
69 { return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
70 LOGINERROR_FLAG_IS_USE_SYSCREDS; }
71 sal_uInt8 GetFlags() const { return m_nFlags; }
72 DialogMask GetResult() const { return m_nRet; }
74 void SetServer( const OUString& aServer )
75 { m_aServer = aServer; }
76 void SetAccount( const OUString& aAccount )
77 { m_aAccount = aAccount; }
78 void SetUserName( const OUString& aUserName )
79 { m_aUserName = aUserName; }
80 void SetPassword( const OUString& aPassword )
81 { m_aPassword = aPassword; }
82 void SetPasswordToModify( const OUString& aPassword )
83 { m_aPasswordToModify = aPassword; }
84 void SetRecommendToOpenReadonly( bool bVal )
85 { m_bRecommendToOpenReadonly = bVal; }
86 void SetErrorText( const OUString& aErrorText )
87 { m_aErrorText = aErrorText; }
89 inline void SetCanRememberPassword( bool bSet );
90 inline void SetIsRememberPassword( bool bSet );
91 inline void SetIsRememberPersistent( bool bSet );
93 inline void SetCanUseSystemCredentials( bool bSet );
94 inline void SetIsUseSystemCredentials( bool bSet );
95 inline void SetModifyAccount( bool bSet );
96 inline void SetModifyUserName( bool bSet );
98 void SetResult( DialogMask nRet )
99 { m_nRet = nRet; }
102 inline void LoginErrorInfo::SetCanRememberPassword( bool bSet )
104 if ( bSet )
105 m_nFlags |= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
106 else
107 m_nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
110 inline void LoginErrorInfo::SetIsRememberPassword( bool bSet )
112 if ( bSet )
113 m_nFlags |= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
114 else
115 m_nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
118 inline void LoginErrorInfo::SetIsRememberPersistent( bool bSet )
120 if ( bSet )
121 m_nFlags |= LOGINERROR_FLAG_REMEMBER_PERSISTENT;
122 else
123 m_nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT;
126 inline void LoginErrorInfo::SetCanUseSystemCredentials( bool bSet )
128 if ( bSet )
129 m_nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS;
130 else
131 m_nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
134 inline void LoginErrorInfo::SetIsUseSystemCredentials( bool bSet )
136 if ( bSet )
137 m_nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS;
138 else
139 m_nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
142 inline void LoginErrorInfo::SetModifyAccount( bool bSet )
144 if ( bSet )
145 m_nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT;
146 else
147 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
150 inline void LoginErrorInfo::SetModifyUserName( bool bSet )
152 if ( bSet )
153 m_nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME;
154 else
155 m_nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
158 #endif
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */