email/imum/Utils/Inc/ImumMboxSymbianDataConverter.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ImumMboxSymbianDataConverter.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIMUMMBOXSYMBIANDATACONVERTER_H
       
    20 #define CIMUMMBOXSYMBIANDATACONVERTER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <imapset.h>
       
    25 
       
    26 #include "ImumInMailboxUtilities.h"
       
    27 #include "cdbcols.h"
       
    28 #include "ImumMboxDataExtension.h"
       
    29 
       
    30 // CONSTANTS
       
    31 // MACROS
       
    32 // DATA TYPES
       
    33 // FUNCTION PROTOTYPES
       
    34 // FORWARD DECLARATIONS
       
    35 class CImumInternalApiImpl;
       
    36 class CImumInternalApiImpl;
       
    37 class CImumInSettingsData;
       
    38 class CImumMboxData;
       
    39 class MImumInSettingsDataCollection;
       
    40 class CImImap4Settings;
       
    41 class CImPop3Settings;
       
    42 class CImSmtpSettings;
       
    43 class CImumMboxDataExtension;
       
    44 class CMsvCommDbUtilities;
       
    45 class TMuiuFlags;
       
    46 
       
    47 // CLASS DECLARATION
       
    48 
       
    49 /**
       
    50 *
       
    51 *  @lib
       
    52 *  @since Series60 3.0
       
    53 */
       
    54 NONSHARABLE_CLASS( CImumMboxSymbianDataConverter ) : public CBase
       
    55     {
       
    56     public:  // Constructors and destructor
       
    57 
       
    58         /**
       
    59         * Creates object from CImumMboxSymbianDataConverter and leaves it to cleanup stack
       
    60         * @since Series60 3.0
       
    61         * @return, Constructed object
       
    62         */
       
    63         static CImumMboxSymbianDataConverter* NewLC(
       
    64             CImumInternalApiImpl& aMailboxApi,
       
    65             const CImumInSettingsData& aSourceData,
       
    66             CImumMboxData& aTargetData );
       
    67 
       
    68         /**
       
    69         * Create object from CImumMboxSymbianDataConverter
       
    70         * @since Series60 3.0
       
    71         * @return, Constructed object
       
    72         */
       
    73         static CImumMboxSymbianDataConverter* NewL(
       
    74             CImumInternalApiImpl& aMailboxApi,
       
    75             const CImumInSettingsData& aSourceData,
       
    76             CImumMboxData& aTargetData );
       
    77 
       
    78         /**
       
    79         * Destructor
       
    80         * @since Series60 3.0
       
    81         */
       
    82         virtual ~CImumMboxSymbianDataConverter();
       
    83 
       
    84     public: // New functions
       
    85 
       
    86         /**
       
    87          *
       
    88          *
       
    89          * @since S60 v3.2
       
    90          */
       
    91         static CImumMboxData* ConvertToSymbianMboxDataLC(
       
    92             CImumInternalApiImpl& aMailboxApi,
       
    93             const CImumInSettingsData& aSourceData );
       
    94 
       
    95     public: // Functions from base classes
       
    96 
       
    97     protected:  // Constructors
       
    98 
       
    99         /**
       
   100         * Default constructor for classCImumMboxSymbianDataConverter
       
   101         * @since Series60 3.0
       
   102         * @return, Constructed object
       
   103         */
       
   104         CImumMboxSymbianDataConverter(
       
   105             CImumInternalApiImpl& aMailboxApi,
       
   106             const CImumInSettingsData& aSourceData,
       
   107             CImumMboxData& aTargetData );
       
   108 
       
   109         /**
       
   110         * Symbian 2-phase constructor
       
   111         * @since Series60 3.0
       
   112         */
       
   113         void ConstructL();
       
   114 
       
   115     protected:  // New virtual functions
       
   116     protected:  // New functions
       
   117     protected:  // Functions from base classes
       
   118 
       
   119     private:  // New virtual functions
       
   120     private:  // New functions
       
   121 
       
   122         /**
       
   123          *
       
   124          *
       
   125          * @since S60 v3.2
       
   126          */
       
   127         void DoConvertToSymbianMboxDataL();
       
   128 
       
   129         /**
       
   130          *
       
   131          *
       
   132          * @since S60 v3.2
       
   133          * @param
       
   134          */
       
   135         void ConvToSymbianImap4DataL();
       
   136 
       
   137         /**
       
   138          *
       
   139          *
       
   140          * @since S60 v3.2
       
   141          * @param
       
   142          */
       
   143         void ConvToSymbianPop3DataL();
       
   144 
       
   145         /**
       
   146          *
       
   147          *
       
   148          * @since S60 v3.2
       
   149          * @param
       
   150          */
       
   151         void ConvToSymbianSmtpDataL();
       
   152 
       
   153 
       
   154         /**
       
   155          *
       
   156          *
       
   157          * @since S60 v3.2
       
   158          * @param
       
   159          */
       
   160         void DoPopulateSymbianImap4SettingsL();
       
   161 
       
   162         /**
       
   163          *
       
   164          *
       
   165          * @since S60 v3.2
       
   166          * @param
       
   167          */
       
   168         void DoPopulateSymbianPop3SettingsL();
       
   169 
       
   170         /**
       
   171          *
       
   172          *
       
   173          * @since S60 v3.2
       
   174          * @param
       
   175          */
       
   176         void DoPopulateSymbianSmtpSettingsL();
       
   177 
       
   178         /**
       
   179          *
       
   180          *
       
   181          * @since S60 v3.2
       
   182          * @param
       
   183          */
       
   184         void DoPopulateExtendedSettingsL();
       
   185 
       
   186         /**
       
   187          *
       
   188          *
       
   189          * @since S60 v3.2
       
   190          * @param
       
   191          * @return
       
   192          */
       
   193         void SetSymbianAccessPointL( const TInt aIndex );
       
   194 
       
   195         /**
       
   196          * Collects relevant data for storing the settings from the entry.
       
   197          *
       
   198          * @since S60 v3.2
       
   199          */
       
   200         void CollectEntryDataL();
       
   201 
       
   202         /**
       
   203          * Sets partial fetching status for Imap4 protocol.
       
   204          *
       
   205          * @since S60 v3.2
       
   206          * @param aFlags Download flags
       
   207          * @return Download flags in a form that can be stored to database.
       
   208          */
       
   209         TImImap4PartialMailOptions GetSymbianImapPartial(
       
   210             const TMuiuFlags& aFlags );
       
   211 
       
   212         /**
       
   213          * Converts the always online setting to form it can be stored.
       
   214          *
       
   215          * @since S60 v3.2
       
   216          * @param aAoState Internal API's Always Online setting
       
   217          * @return Always online state in a form that can be stored to database.
       
   218          */
       
   219         TMailAoStates SymbianAoState( const TInt aAoState );
       
   220 
       
   221         /**
       
   222          * Converts the always online interval setting to form it can be stored.
       
   223          *
       
   224          * @since S60 v3.2
       
   225          * @param aInterval Internal API's Always Online retrieval interval
       
   226          * @return Retrieval interval in a form that can be stored to database.
       
   227          */
       
   228         TInt SymbianAoRetrievalInterval( TInt aInterval );
       
   229 
       
   230         /**
       
   231          * Converts the EMN setting to form it can be stored.
       
   232          *
       
   233          * @since S60 v3.2
       
   234          * @param aEmnState Internal API's EMN setting
       
   235          * @return Emn state in a form that can be stored to database.
       
   236          */
       
   237         TMailEmnStates SymbianEmnState( const TInt aEmnState );
       
   238 
       
   239         /**
       
   240          * Set synchronization state.
       
   241          *
       
   242          * @since S60 v3.2
       
   243          * @param aFlags Flags to control synchronization setting.
       
   244          * @return Setting type.
       
   245          */
       
   246         TPop3GetMailOptions GetSymbianPopGetMail(
       
   247             const TUint aFlags );
       
   248 
       
   249         /**
       
   250          * Sets the correct download mode.
       
   251          *
       
   252          * @since S60 v3.2
       
   253          * @param aFlags Flags to control the download settings.
       
   254          * @param aInternalDataCollection Reference to connection data object.
       
   255          * @return Setting type.
       
   256          * @leave Any settigs leave code
       
   257          * @see ImumDaErrorCodes.h
       
   258          */
       
   259         TInt32 GetSymbianPopDownloadL(
       
   260             const TUint aFlags,
       
   261             const MImumInSettingsDataCollection& aInternalDataCollection );
       
   262 
       
   263         /**
       
   264          * Throws an exception.
       
   265          * Debug mode: Panic
       
   266          * Release mode: Leave
       
   267          *
       
   268          * @since S60 v3.2
       
   269          * @param aErrorCode The code of the exception.
       
   270          * @leave Provided error code
       
   271          */
       
   272         static void ConverterExceptionL( const TInt aErrorCode );
       
   273 
       
   274     private:  // Functions from base classes
       
   275 
       
   276     public:     // Data
       
   277     protected:  // Data
       
   278     private:    // Data
       
   279 
       
   280         // Reference to mailbox Api object
       
   281         CImumInternalApiImpl&   iMailboxApi;
       
   282         // Not owned: Reference to symbian data
       
   283         CImumMboxData&          iTargetData;
       
   284         // Not owned: Reference to internal data
       
   285         const CImumInSettingsData& iSourceData;
       
   286         // Protocol of the mailbox
       
   287         TUid                    iMailboxProtocol;
       
   288         // Owned: Entries of the mailbox
       
   289         MImumInMailboxUtilities::RMsvEntryArray iMailboxEntries;
       
   290         // Flag to indicate if the settings is in construction mode
       
   291         TBool                   iCreationPhase;
       
   292     };
       
   293 
       
   294 #endif //  CIMUMMBOXSYMBIANDATACONVERTER_H