emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp
changeset 0 8466d47a6819
child 4 e7aa27f58ae1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp	Thu Dec 17 08:39:21 2009 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 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: This file implements class CEmailInterfaceFactoryImpl.
+*
+*/
+
+#include "emailinterfacefactoryimpl.h"
+#include "emailcontent.h"
+#include "CFSMailClient.h"
+#include "emailclientapiimpldefs.h"
+#include "emailclientapiimpl.h"
+#include "emailaddress.h"
+#include "emailmessagesearch.h"
+
+_LIT( KEmailImplPanic, "Email client API" );
+
+// ---------------------------------------------------------------------------
+// Email client API panic wrapper
+// ---------------------------------------------------------------------------
+//
+void Panic( TEmailImplPanic aPanic )
+    {
+    User::Panic( KEmailImplPanic(), aPanic );
+    }
+    
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::NewL
+// ---------------------------------------------------------------------------
+//
+CEmailInterfaceFactoryImpl* CEmailInterfaceFactoryImpl::NewL()
+    {
+    CEmailInterfaceFactoryImpl* self = new (ELeave) CEmailInterfaceFactoryImpl();
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl
+// ---------------------------------------------------------------------------
+//
+CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl
+// ---------------------------------------------------------------------------
+//
+CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl() : 
+    CEmailInterfaceFactory()
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::InterfaceL
+// ---------------------------------------------------------------------------
+//
+MEmailInterface* CEmailInterfaceFactoryImpl::InterfaceL( const TInt aInterfaceId )
+    {
+    MEmailInterface* interface = NULL;
+    switch ( aInterfaceId )
+        {
+        case KEmailClientApiInterface:
+            interface = CEmailClientApi::NewL();
+            break;
+        case KEmailIFUidTextContent:
+            //interface = CEmailTextContent::NewL();
+            break;
+        case KEmailIFUidAddress:
+            interface = CEmailAddress::NewL( MEmailAddress::EUndefined, EClientOwns );
+        default:
+            break;
+        }
+    if ( !interface )
+        {
+        User::Leave( KErrNotSupported );
+        }
+    return interface;
+    }
+
+// End of file.