meetingrequest/mragnversit2/src/cesmragnversit2.cpp
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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: This file implements class CESMRAgnVersit2.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // Class include.
       
    20 #include "emailtrace.h"
       
    21 #include "cesmragnversit2.h"					//CESMRAgnVersit2
       
    22 
       
    23 // User includes.
       
    24 #include "cesmragnversit2importer.h"			//CESMRAgnVersit2Importer
       
    25 #include "cesmragnversit2exporter.h"			//CESMRAgnVersit2Exporter
       
    26 #include "cesmragnversit2stringprovider.h"	//CESMRAgnVersit2StringProvider
       
    27 
       
    28 //<cmail>
       
    29 //</cmail>
       
    30 
       
    31 // ======== MEMBER FUNCTIONS ========
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 // CESMRAgnVersit2::NewL
       
    35 // ---------------------------------------------------------------------------
       
    36 //
       
    37 CESMRAgnVersit2* CESMRAgnVersit2::NewL()
       
    38     {
       
    39     FUNC_LOG;
       
    40 
       
    41     CESMRAgnVersit2* self = new (ELeave) CESMRAgnVersit2;
       
    42     CleanupStack::PushL(self);
       
    43     self->ConstructL();
       
    44     CleanupStack::Pop(self);
       
    45 
       
    46 
       
    47     return self;
       
    48     }
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // CESMRAgnVersit2::NewL
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 CESMRAgnVersit2::~CESMRAgnVersit2()
       
    55     {
       
    56     FUNC_LOG;
       
    57 
       
    58     delete iImporter;
       
    59     delete iExporter;
       
    60     delete iStringProvider;
       
    61 
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------------------------
       
    65 // CESMRAgnVersit2::ImportL
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 void CESMRAgnVersit2::ImportL( RPointerArray<CCalEntry>& aEntries,
       
    69                            RReadStream& aReadStream,
       
    70                            TUint /*aFlags*/,
       
    71                            MESMRAgnImportObserver& aObserver )
       
    72     {
       
    73     FUNC_LOG;
       
    74 
       
    75     if (!iImporter)
       
    76         {
       
    77         iImporter =  CESMRAgnVersit2Importer::NewL(*iStringProvider);
       
    78         }
       
    79 
       
    80     iImporter->ImportL(aEntries, aReadStream, aObserver);
       
    81 
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // CESMRAgnVersit2::ExportL
       
    86 // ---------------------------------------------------------------------------
       
    87 //
       
    88 void CESMRAgnVersit2::ExportL( const CCalEntry& aEntry,
       
    89                            RWriteStream& aWriteStream,
       
    90                            TUint aFlags,
       
    91                            MESMRAgnExportObserver& aObserver )
       
    92     {
       
    93     FUNC_LOG;
       
    94 
       
    95     if (!iExporter)
       
    96         {
       
    97         iExporter = CESMRAgnVersit2Exporter::NewL(*iStringProvider);
       
    98         }
       
    99 
       
   100     iExporter->ExportL(aEntry, aWriteStream, aFlags, aObserver);
       
   101 
       
   102     }
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // CESMRAgnVersit2::ExportL
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 void CESMRAgnVersit2::ExportL( RPointerArray<CCalEntry>& aEntries,
       
   109                            RWriteStream& aWriteStream,
       
   110                            TUint aFlags,
       
   111                            MESMRAgnExportObserver& aObserver )
       
   112     {
       
   113     FUNC_LOG;
       
   114 
       
   115     if (!iExporter)
       
   116         {
       
   117         iExporter = CESMRAgnVersit2Exporter::NewL(*iStringProvider);
       
   118         }
       
   119 
       
   120     iExporter->ExportL(aEntries, aWriteStream, aFlags, aObserver);
       
   121 
       
   122     }
       
   123 
       
   124 // ---------------------------------------------------------------------------
       
   125 // CESMRAgnVersit2::CESMRAgnVersit2
       
   126 // ---------------------------------------------------------------------------
       
   127 //
       
   128 CESMRAgnVersit2::CESMRAgnVersit2()
       
   129     {
       
   130     FUNC_LOG;
       
   131     //do nothing
       
   132     }
       
   133 
       
   134 // ---------------------------------------------------------------------------
       
   135 // CESMRAgnVersit2::ConstructL
       
   136 // ---------------------------------------------------------------------------
       
   137 //
       
   138 void CESMRAgnVersit2::ConstructL()
       
   139     {
       
   140     FUNC_LOG;
       
   141 
       
   142     iStringProvider = CESMRAgnVersit2StringProvider::NewL();
       
   143     // Initialise the importer and exporter straight away in debug mode
       
   144     // This prevents problems when memory testing
       
   145     __DEBUG_ONLY(iImporter =  CESMRAgnVersit2Importer::NewL(*iStringProvider));
       
   146     __DEBUG_ONLY(iExporter =  CESMRAgnVersit2Exporter::NewL(*iStringProvider));
       
   147 
       
   148     }
       
   149 
       
   150 // End of file.
       
   151