|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-3FD5C609-3727-53B6-900F-ACBE59F62E4A" xml:lang="en"><title>Storing |
|
13 Downloaded Email Messages</title><shortdesc>This tutorial explains how to store incoming email messages.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 |
|
15 <section><title>Introduction</title> <p>You can store and restore the incoming |
|
16 email message using the <xref href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.dita"><apiname>TDesC8</apiname></xref> or <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita"><apiname>TDesC16</apiname></xref> function. |
|
17 Ensure that you follow these guidelines while using these functions: </p> <ul> |
|
18 <li id="GUID-DC272C83-2B74-5A28-A903-1D3385F6E52B"><p>If you want to store |
|
19 the downloaded email message data as 16 bit, then storing is slow as the downloaded |
|
20 message in 8 bit should be converted to 16 bit before it is stored. However, |
|
21 reading and displaying is fast as the email message data is in 16 bit. </p> </li> |
|
22 <li id="GUID-50565679-0520-5CE4-9414-888ED2C80C78"><p>If you want to store |
|
23 the downloaded email message data as 8-bit, then reading and displaying it |
|
24 is slow as the 8 bit email message data should be converted to 16 bit before |
|
25 it is displayed. However, storing is fast. </p> </li> |
|
26 </ul> </section> |
|
27 <section><title>Procedure</title> <ol id="GUID-C6687B65-351F-5E3F-85CC-7F3BA5058BC6"> |
|
28 <li id="GUID-4BDBAD7C-275B-5D41-A6CC-3DDE93892DF2"><p>For the MTM to use <xref href="GUID-6A4CAFB0-262A-3721-B91B-07F2C3B64B5F.dita"><apiname>CMsvPlainBodyText</apiname></xref> for |
|
29 storing downloaded email messages, get the <xref href="GUID-6A4CAFB0-262A-3721-B91B-07F2C3B64B5F.dita"><apiname>CMsvPlainBodyText</apiname></xref> object |
|
30 using the <xref href="GUID-226C5C17-3AE6-3CAB-BF30-39DCB981574A.dita"><apiname>InitialisePlainBodyTextForWriteL()</apiname></xref> method of <xref href="GUID-8CB90FA2-A6CF-3FA2-81FF-7D22EFD9C2CE.dita"><apiname>CMsvStore</apiname></xref>. </p> </li> |
|
31 <li id="GUID-F43981C5-C9B3-5108-AA8A-A2BBF2745DF3"><p>Set <xref href="GUID-8CB90FA2-A6CF-3FA2-81FF-7D22EFD9C2CE.dita"><apiname>CMsvStore</apiname></xref> to |
|
32 the ID of the email message that needs to be stored, and open it in the write |
|
33 mode. </p> </li> |
|
34 <li id="GUID-FE93A682-CF5C-584F-AA86-B089E6F9581C"><p>Use any of the following <xref href="GUID-6A4CAFB0-262A-3721-B91B-07F2C3B64B5F.dita#GUID-6A4CAFB0-262A-3721-B91B-07F2C3B64B5F/GUID-D1CC07ED-0108-348B-88F4-C89CAB093FE4"><apiname>CMsvPlainBodyText::StoreChunkL()</apiname></xref> methods |
|
35 to store incoming data: </p> <ol id="GUID-A6AB4C6B-FFB3-5DBE-BC42-F4F12004C7C1"> |
|
36 <li id="GUID-535BC8A3-3AFB-564C-A53B-322330B0AF86"><p> <codeph>const</codeph> <xref href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.dita"><apiname>TDesC8</apiname></xref> <codeph> |
|
37 &aChunk, </codeph> <xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus</apiname></xref> <codeph> &aStatus |
|
38 </codeph> </p> </li> |
|
39 <li id="GUID-33DC423A-A302-5FDC-A0F3-B7F89D226C37"><p> <codeph>const</codeph> <xref href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.dita"><apiname>TDesC8</apiname></xref> <codeph>&aChunk</codeph> </p> </li> |
|
40 <li id="GUID-0478F9EA-B31D-54E6-9CE4-5EC9C7711F86"><p> <codeph>const</codeph> <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita"><apiname>TDesC16</apiname></xref> <codeph> |
|
41 &aChunk, </codeph> <xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus</apiname></xref> <codeph> &aStatus |
|
42 </codeph> </p> </li> |
|
43 <li id="GUID-F7175033-3CC1-501A-B795-9FFB1875BE7A"><p> <codeph>const</codeph> <xref href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.dita"><apiname>TDesC16</apiname></xref> <codeph>&aChunk</codeph> </p> </li> |
|
44 </ol> </li> |
|
45 <li id="GUID-6BBBDB91-BC15-584B-82A2-ED08D7E2EBD3"><p>After the entire email |
|
46 message has been received from the external server, the MTM must call the <xref href="GUID-D7D5B755-456D-3774-ACF9-E4ABC07E5C40.dita"><apiname>CommitL()</apiname></xref> method |
|
47 of <xref href="GUID-6A4CAFB0-262A-3721-B91B-07F2C3B64B5F.dita"><apiname>CMsvPlainBodyText</apiname></xref> to complete the store operation. </p> </li> |
|
48 </ol> <note> The email server MTM can store the email message that is received |
|
49 from the external server either as 8 or 16 bit. When the MTM calls the 16 |
|
50 bit version of the <codeph>StoreChunkL()</codeph> function, and based on the |
|
51 charset information, it must convert the data to Unicode.</note><p>If the |
|
52 8 bit version of the<codeph>StoreChunkL()</codeph> function is used for storing, |
|
53 and if the MTM wants the email message to be stored as 16 bit (this is indicated |
|
54 by the <codeph>TBoolaIs8Bit</codeph> parameter of <codeph>InitialisePlainBodyTextForWriteL()</codeph>), <codeph>CMsvPlainBodyText</codeph> converts |
|
55 and stores the email message in 16 bit based on the charset information provided |
|
56 while initialising <codeph>CMsvPlainBodyText</codeph>.</p></section> |
|
57 </conbody><related-links> |
|
58 <link href="GUID-62166BC9-D0BC-5070-BC57-2A1F4948BAFE.dita"><linktext>Restoring |
|
59 Email Messages</linktext></link> |
|
60 <link href="GUID-2C8653F9-8873-59E8-9FD2-4215F6877ABC.dita"><linktext>Chunk Method |
|
61 to Process Emails</linktext></link> |
|
62 <link href="GUID-D73AD200-BE4D-50BF-BCF9-14627DE530B7.dita"><linktext>Imap4Example: |
|
63 An Email manager using IMAP4 and SMTP</linktext></link> |
|
64 <link href="GUID-BB35DBCC-FE56-547F-BADA-9EF854691ADC.dita"><linktext>Pop3Example: |
|
65 An Email manager using POP3 and SMTP</linktext></link> |
|
66 </related-links></concept> |