|
1 /* |
|
2 * Copyright (c) 2007-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: Interface definition for ESMR task factory implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <ecom/ecom.h> |
|
19 #include "esmrinternaluid.h" |
|
20 |
|
21 inline CESMRTaskFactory* CESMRTaskFactory::NewL( |
|
22 TESMRCalendarEventType aType, |
|
23 MESMRCalDbMgr& aCalDbMgr ) |
|
24 { |
|
25 CESMRTaskFactory* impl = NULL; |
|
26 |
|
27 switch ( aType ) |
|
28 { |
|
29 case EESMREventTypeMeetingRequest: |
|
30 { |
|
31 impl = static_cast< CESMRTaskFactory* >( |
|
32 REComSession::CreateImplementationL( |
|
33 TUid::Uid( KMRTaskPluginImplementationUID ), |
|
34 _FOFF( CESMRTaskFactory, iDtor_ID_Key ), |
|
35 &aCalDbMgr ) ); |
|
36 break; |
|
37 } |
|
38 case EESMREventTypeAppt: |
|
39 case EESMREventTypeETodo: |
|
40 case EESMREventTypeEEvent: |
|
41 case EESMREventTypeEReminder: |
|
42 case EESMREventTypeEAnniv: |
|
43 { |
|
44 impl = static_cast< CESMRTaskFactory* >( |
|
45 REComSession::CreateImplementationL( |
|
46 TUid::Uid( KMRCalEventTaskPluginImplementationUID ), |
|
47 _FOFF( CESMRTaskFactory, iDtor_ID_Key ), |
|
48 &aCalDbMgr ) ); |
|
49 break; |
|
50 } |
|
51 default: |
|
52 { |
|
53 // never should come here. |
|
54 User::Leave( KErrGeneral ); |
|
55 break; |
|
56 } |
|
57 } |
|
58 |
|
59 return impl; |
|
60 } |
|
61 |
|
62 inline CESMRTaskFactory::~CESMRTaskFactory() |
|
63 { |
|
64 REComSession::DestroyedImplementation( iDtor_ID_Key ); |
|
65 } |