emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp
changeset 0 8466d47a6819
child 4 e7aa27f58ae1
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2009 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 CEmailInterfaceFactoryImpl.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "emailinterfacefactoryimpl.h"
       
    19 #include "emailcontent.h"
       
    20 #include "CFSMailClient.h"
       
    21 #include "emailclientapiimpldefs.h"
       
    22 #include "emailclientapiimpl.h"
       
    23 #include "emailaddress.h"
       
    24 #include "emailmessagesearch.h"
       
    25 
       
    26 _LIT( KEmailImplPanic, "Email client API" );
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // Email client API panic wrapper
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 void Panic( TEmailImplPanic aPanic )
       
    33     {
       
    34     User::Panic( KEmailImplPanic(), aPanic );
       
    35     }
       
    36     
       
    37 // ======== MEMBER FUNCTIONS ========
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // CEmailInterfaceFactoryImpl::NewL
       
    41 // ---------------------------------------------------------------------------
       
    42 //
       
    43 CEmailInterfaceFactoryImpl* CEmailInterfaceFactoryImpl::NewL()
       
    44     {
       
    45     CEmailInterfaceFactoryImpl* self = new (ELeave) CEmailInterfaceFactoryImpl();
       
    46     return self;
       
    47     }
       
    48     
       
    49 // ---------------------------------------------------------------------------
       
    50 // CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl()
       
    54     {
       
    55     }
       
    56 
       
    57 // ---------------------------------------------------------------------------
       
    58 // CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl() : 
       
    62     CEmailInterfaceFactory()
       
    63     {
       
    64     }
       
    65     
       
    66 // ---------------------------------------------------------------------------
       
    67 // CEmailInterfaceFactoryImpl::InterfaceL
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 MEmailInterface* CEmailInterfaceFactoryImpl::InterfaceL( const TInt aInterfaceId )
       
    71     {
       
    72     MEmailInterface* interface = NULL;
       
    73     switch ( aInterfaceId )
       
    74         {
       
    75         case KEmailClientApiInterface:
       
    76             interface = CEmailClientApi::NewL();
       
    77             break;
       
    78         case KEmailIFUidTextContent:
       
    79             //interface = CEmailTextContent::NewL();
       
    80             break;
       
    81         case KEmailIFUidAddress:
       
    82             interface = CEmailAddress::NewL( MEmailAddress::EUndefined, EClientOwns );
       
    83         default:
       
    84             break;
       
    85         }
       
    86     if ( !interface )
       
    87         {
       
    88         User::Leave( KErrNotSupported );
       
    89         }
       
    90     return interface;
       
    91     }
       
    92 
       
    93 // End of file.