diff -r 000000000000 -r 72b543305e3a email/imum/Mtms/Inc/ImumMboxSettingsUtils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email/imum/Mtms/Inc/ImumMboxSettingsUtils.h Thu Dec 17 08:44:11 2009 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ImumMboxSettingsUtils.h +* +*/ + + +#ifndef CIMUMMBOXSETTINGSUTILS_H +#define CIMUMMBOXSETTINGSUTILS_H + +// INCLUDES +#include +#include // CImumInternalApi +#include // CImumInSettingsData +#include // CImumInSettingsDataCollection +#include // CImBaseEmailSettings +#include // CImImap4Settings +#include // CImPop3Settings +#include // CImSmtpSettings + +// CONSTANTS +// MACROS +// DATA TYPES +// FUNCTION PROTOTYPES +// FORWARD DECLARATIONS +// CLASS DECLARATION + +/** +* +* @lib +* @since Series60 3.0 +*/ +class ImumMboxSettingsUtils + { + public: // Constructors and destructor + public: // New functions + + /** + * + * @since S60 3.2 + */ + static void SetLoginInformationL( + CImumInternalApi& aMailboxApi, + const TDesC8& aUserName, + const TDesC8& aPassword, + const TBool aPasswordTemporary, + const TMsvId aServiceId ); + + /** + * + * @since S60 3.2 + */ + static void GetLoginInformationL( + CImumInternalApi& aMailboxApi, + TDes8& aUserName, + TDes8& aPassword, + TBool& aPasswordTemporary, + const TMsvId aServiceId ); + + /** + * Get login information from settings. This is a performance optimization + * to avoid loading settings if they are available already. + * @since S60 3.2 + */ + static void GetLoginInformationL( + const CImumInSettingsData& aAccountSettings, + TUid aMtmUid, + TDes8& aUserName, + TDes8& aPassword, + TBool& aPasswordTemporary ); + + /** + * + * + * @since S60 3.2 + * @param aEmailApi + * @param aMailboxId + * @param aAttributeKey + * @param aConnectionIndex + * @return + */ + template + inline static T QuickLoadL( + CImumInternalApi& aEmailApi, + const TMsvId aMailboxId, + const TUint aAttributeKey, + const TInt aConnectionIndex = KErrNotFound ); + + /** + * + * @since S60 3.2 + * @param aSettings + * @param aAttributeKey + * @return + */ + template + inline static T QuickGetL( + const CImumInSettingsData& aSettings, + const TUint aAttributeKey, + const TInt aConnectionIndex = KErrNotFound ); + + /** + * + * @since S60 3.2 + * @param + * @return + */ + static TBool IsImap4( + const CImumInSettingsData& aSettings ); + + /** + * + * + * @since S60 v3.2 + * @param + * @return + */ + static TBool ValidateSettingsL( + CImumInternalApi& aMailboxApi, + const TMsvId aMailboxId ); + + /** + * Updates last connect info for mailbox + * + * @since S60 v3.2 + * @param aMailboxId: id of the mailbox + * @param aSuccessful: ETrue, if successfully connected, EFalse otherwise + */ + static void SetLastUpdateInfoL( + CImumInternalApi& aEmailApi, + TMsvId aMailboxId, + const TBool& aSuccessful ); + + public: // Functions from base classes + + protected: // Constructors + protected: // New virtual functions + protected: // New functions + protected: // Functions from base classes + + private: // New virtual functions + private: // New functions + private: // Functions from base classes + + public: // Data + protected: // Data + private: // Data + }; + +#include "ImumMboxSettingsUtils.inl" + +#endif // CIMUMMBOXSETTINGSUTILS_H + +// End of File