meetingui/meetingrequestutils/src/MRUtilsFactory.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2005 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: Implementation for meeting request utils factory   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // ----------------------------------------------------------------------------
       
    21 // INCLUDE FILES
       
    22 // ----------------------------------------------------------------------------
       
    23 //
       
    24 #include "MRUtilsFactory.h"
       
    25 #include "CMRUtilsEmailSender.h"
       
    26 #include "CMRUtilsCalDbMgr.h"
       
    27 #include "CMRUtilsUiServices.h"
       
    28 #include <eikenv.h>
       
    29 #include "ICalUILog.h"
       
    30 
       
    31 
       
    32 // CONSTANTS
       
    33 /// Unnamed namespace for local definitions
       
    34 namespace {
       
    35 
       
    36 enum TPanicCode
       
    37     {
       
    38     };
       
    39 
       
    40 _LIT( KPanicMsg, "MRUtilsFactory" );
       
    41 
       
    42 void Panic( TPanicCode aReason )
       
    43     {
       
    44     User::Panic( KPanicMsg, aReason );
       
    45     }
       
    46     
       
    47 }  // namespace
       
    48 
       
    49 // ----------------------------------------------------------------------------
       
    50 // MEMBER FUNCTIONS
       
    51 // ----------------------------------------------------------------------------
       
    52 //
       
    53 
       
    54 // ----------------------------------------------------------------------------
       
    55 // MRUtilsFactory::CreateEmailSenderL
       
    56 // ----------------------------------------------------------------------------
       
    57 //        
       
    58 MMRUtilsEmailSender* MRUtilsFactory::CreateEmailSenderL(
       
    59     CCalSession& aCalSession )
       
    60     {
       
    61     LOG("MRUtilsFactory::CreateEmailSenderL");
       
    62     return CMRUtilsEmailSender::NewL( aCalSession );
       
    63     }
       
    64 
       
    65 MMRUtilsCalDbMgr* MRUtilsFactory::CreateCalDbMgrL(
       
    66     CCalSession& aCalSession,
       
    67     MMRUtilsObserver& aObserver )
       
    68     {
       
    69     return CMRUtilsCalDbMgr::NewL( aCalSession, aObserver );
       
    70     }
       
    71     
       
    72 MMRUtilsUiServices* MRUtilsFactory::CreateUiServicesL(
       
    73     CMRUtilsInternal& aMRUtils,
       
    74     CCalSession& aCalSession,
       
    75     CMsvSession* aMsvSession,
       
    76     CMRMailboxUtils& aMRMailboxUtils )
       
    77     {
       
    78     LOG("MRUtilsFactory::CreateUiServicesL()");
       
    79     
       
    80     if ( !CEikonEnv::Static() )
       
    81         { 
       
    82         LOG("MRUtilsFactory::CreateUiServicesL() -> return null");
       
    83         return NULL;
       
    84         }
       
    85     else
       
    86         {
       
    87         LOG("MRUtilsFactory::CreateUiServicesL() creating instance");
       
    88         return CMRUtilsUiServices::NewL( aMRUtils,
       
    89                                          aCalSession,
       
    90                                          aMsvSession,
       
    91                                          aMRMailboxUtils );
       
    92         LOG("MRUtilsFactory::CreateUiServicesL() instance created");
       
    93         }
       
    94     }
       
    95     
       
    96 // End of file