18 #include <e32property.h> // RProperty |
18 #include <e32property.h> // RProperty |
19 #include <s32mem.h> // RDesRead/WriteStream |
19 #include <s32mem.h> // RDesRead/WriteStream |
20 |
20 |
21 #include "emailinterfacefactoryimpl.h" |
21 #include "emailinterfacefactoryimpl.h" |
22 #include "emailcontent.h" |
22 #include "emailcontent.h" |
23 #include "CFSMailClient.h" |
23 #include "cfsmailclient.h" |
24 #include "emailclientapiimpldefs.h" |
24 #include "emailclientapiimpldefs.h" |
25 #include "emailclientapiimpl.h" |
25 #include "emailclientapiimpl.h" |
26 #include "emailaddress.h" |
26 #include "emailaddress.h" |
27 #include "emailmessagesearch.h" |
27 #include "emailmessagesearch.h" |
28 #include "emailshutdownconst.h" |
28 #include "emailshutdownconst.h" |
31 const TInt KEmailUidExtraBuffer = 2 * KEmailPlatformApiUidItemSize; |
31 const TInt KEmailUidExtraBuffer = 2 * KEmailPlatformApiUidItemSize; |
32 |
32 |
33 // --------------------------------------------------------------------------- |
33 // --------------------------------------------------------------------------- |
34 // Email client API panic wrapper |
34 // Email client API panic wrapper |
35 // --------------------------------------------------------------------------- |
35 // --------------------------------------------------------------------------- |
|
36 // |
36 void Panic( TEmailImplPanic aPanic ) |
37 void Panic( TEmailImplPanic aPanic ) |
37 { |
38 { |
38 User::Panic( KEmailImplPanic(), aPanic ); |
39 User::Panic( KEmailImplPanic(), aPanic ); |
39 } |
40 } |
40 |
41 |
41 // ======== MEMBER FUNCTIONS ======== |
42 // ======== MEMBER FUNCTIONS ======== |
42 |
43 |
43 // --------------------------------------------------------------------------- |
44 // --------------------------------------------------------------------------- |
44 // CEmailInterfaceFactoryImpl::NewL |
45 // CEmailInterfaceFactoryImpl::NewL |
45 // --------------------------------------------------------------------------- |
46 // --------------------------------------------------------------------------- |
|
47 // |
46 CEmailInterfaceFactoryImpl* CEmailInterfaceFactoryImpl::NewL() |
48 CEmailInterfaceFactoryImpl* CEmailInterfaceFactoryImpl::NewL() |
47 { |
49 { |
48 CEmailInterfaceFactoryImpl* self = new (ELeave) CEmailInterfaceFactoryImpl(); |
50 CEmailInterfaceFactoryImpl* self = new (ELeave) CEmailInterfaceFactoryImpl(); |
49 CleanupStack::PushL( self ); |
51 CleanupStack::PushL( self ); |
50 self->ConstructL(); |
52 self->ConstructL(); |
51 CleanupStack::Pop( self ); |
53 CleanupStack::Pop( self ); |
52 return self; |
54 return self; |
53 } |
55 } |
54 |
56 |
55 // --------------------------------------------------------------------------- |
57 // --------------------------------------------------------------------------- |
56 // CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl |
58 // CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl |
57 // --------------------------------------------------------------------------- |
59 // --------------------------------------------------------------------------- |
|
60 // |
58 CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl() |
61 CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl() |
59 { |
62 { |
60 TRAP_IGNORE( AppendOrRemoveUidL( EEmailUidModeRemove ) ); |
63 TRAP_IGNORE( AppendOrRemoveUidL( EEmailUidModeRemove ) ); |
61 } |
64 } |
62 |
65 |
63 // --------------------------------------------------------------------------- |
66 // --------------------------------------------------------------------------- |
64 // CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl |
67 // CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl |
65 // --------------------------------------------------------------------------- |
68 // --------------------------------------------------------------------------- |
|
69 // |
66 CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl() : |
70 CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl() : |
67 CEmailInterfaceFactory() |
71 CEmailInterfaceFactory() |
68 { |
72 { |
69 } |
73 } |
70 |
74 |
71 // --------------------------------------------------------------------------- |
75 // --------------------------------------------------------------------------- |
72 // CEmailInterfaceFactoryImpl::ConstructL |
76 // CEmailInterfaceFactoryImpl::ConstructL |
73 // --------------------------------------------------------------------------- |
77 // --------------------------------------------------------------------------- |
|
78 // |
74 void CEmailInterfaceFactoryImpl::ConstructL() |
79 void CEmailInterfaceFactoryImpl::ConstructL() |
75 { |
80 { |
76 // This leaves if related P&S keys are not defined by EmailServerMonitor, |
81 // This leaves if related P&S keys are not defined by EmailServerMonitor, |
77 // so EmailServerMonitor need to be started before using client API. |
82 // so EmailServerMonitor need to be started before using client API. |
78 // TRAP_IGNORE should be removed after EmailServerMonitor is added to |
83 // TRAP_IGNORE should be removed after EmailServerMonitor is added to |
81 } |
86 } |
82 |
87 |
83 // --------------------------------------------------------------------------- |
88 // --------------------------------------------------------------------------- |
84 // CEmailInterfaceFactoryImpl::InterfaceL |
89 // CEmailInterfaceFactoryImpl::InterfaceL |
85 // --------------------------------------------------------------------------- |
90 // --------------------------------------------------------------------------- |
|
91 // |
86 MEmailInterface* CEmailInterfaceFactoryImpl::InterfaceL( const TInt aInterfaceId ) |
92 MEmailInterface* CEmailInterfaceFactoryImpl::InterfaceL( const TInt aInterfaceId ) |
87 { |
93 { |
88 MEmailInterface* interface = NULL; |
94 MEmailInterface* interface = NULL; |
89 switch ( aInterfaceId ) |
95 switch ( aInterfaceId ) |
90 { |
96 { |
91 case KEmailClientApiInterface: |
97 case KEmailClientApiInterface: |
92 interface = CEmailClientApi::NewL(); |
98 interface = CEmailClientApi::NewL(); |
93 break; |
99 break; |
|
100 case KEmailIFUidTextContent: |
|
101 //interface = CEmailTextContent::NewL(); |
|
102 break; |
94 case KEmailIFUidAddress: |
103 case KEmailIFUidAddress: |
95 interface = CEmailAddress::NewL( MEmailAddress::EUndefined, EClientOwns ); |
104 interface = CEmailAddress::NewL( MEmailAddress::EUndefined, EClientOwns ); |
96 break; |
|
97 case KEmailIFUidTextContent: |
|
98 default: |
105 default: |
99 break; |
106 break; |
100 } |
107 } |
101 if ( !interface ) |
108 if ( !interface ) |
102 { |
109 { |