7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-382B8A9D-9D10-54CD-91A6-B9E7A2477662" xml:lang="en"><title>SendAs |
12 <concept id="GUID-382B8A9D-9D10-54CD-91A6-B9E7A2477662" xml:lang="en"><title>SendAs v2.0</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 v2.0</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 <section id="GUID-9D54D47A-37D9-5229-92D5-B80B442E8B0D"><title>Description</title> <p>The application establishes a session with the SendAs server, |
14 <section id="GUID-9D54D47A-37D9-5229-92D5-B80B442E8B0D"><title>Description</title> <p>The |
14 sets a message entry, creates a message, sets its body text, adds |
15 application establishes a session with the SendAs server, sets |
15 a recipient, sends the message and closes the session. The sequence |
16 a message entry, creates a message, sets its body text, adds a recipient, |
16 of events is detailed in the following list: </p> <ul> |
17 sends the message and closes the session. The sequence of events is detailed |
17 <li id="GUID-ADE16BD9-7B38-5B35-8E72-77E968D1CED2"><p>Create a session |
18 in the following list: </p> <ul> |
18 with the SendAs server using <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita#GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B/GUID-1B5B3FA7-403E-354A-8CF3-C04FF58CF293"><apiname>CMsvSession::OpenSyncL(MMsvSessionObserver |
19 <li id="GUID-ADE16BD9-7B38-5B35-8E72-77E968D1CED2"><p>Create a session with |
19 &)</apiname></xref> function. </p> </li> |
20 the SendAs server using <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita#GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B/GUID-423E2320-FB34-3249-80D9-9AA62C9DDF60"><apiname>CMsvSession::OpenSyncL()</apiname></xref> function. </p> </li> |
20 <li id="GUID-E1BF3D0E-C278-57F6-9359-4EDC426034BD"><p>Set the message |
21 <li id="GUID-E1BF3D0E-C278-57F6-9359-4EDC426034BD"><p>Set the message entry |
21 entry using the <xref href="GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49.dita#GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49/GUID-6048C7BC-8D3E-34C5-81C1-317521218029"><apiname>CMsvEntry::SetEntryL(TMsvId)</apiname></xref> function. </p> </li> |
22 using the <xref href="GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49.dita#GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49/GUID-139272C1-EF75-3BD9-AB67-3573C5C2D68C"><apiname>CMsvEntry::SetEntryL()</apiname></xref> function. </p> </li> |
22 <li id="GUID-C89C044C-B1DF-5541-8F0E-81DBA222E126"><p>After setting |
23 <li id="GUID-C89C044C-B1DF-5541-8F0E-81DBA222E126"><p>After setting the entry, |
23 the entry, the application gets a selection containing the IDs of |
24 the application gets a selection containing the IDs of all the context children, |
24 all the context children, using the <xref href="GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49.dita#GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49/GUID-7058F4C4-7EE9-36C3-ACE9-632345D7FF44"><apiname>CMsvEntry::ChildrenL()const</apiname></xref> function. </p> </li> |
25 using the <xref href="GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49.dita#GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49/GUID-80D240A0-5896-35A3-AADD-830046776D35"><apiname>CMsvEntry::ChildrenL()</apiname></xref> function. </p> </li> |
25 <li id="GUID-B2B5D96F-68F3-5000-B615-3AE7DA32E3A3"><p>The connection |
26 <li id="GUID-B2B5D96F-68F3-5000-B615-3AE7DA32E3A3"><p>The connection to the |
26 to the server is made using the default number of message slots available |
27 server is made using the default number of message slots available to a session, |
27 to a session, which is 4, (<xref href="GUID-C248C8F6-46F2-39AB-A202-CB2D98FCF760.dita"><apiname>KSendAsDefaultMessageSlots</apiname></xref>). </p> </li> |
28 which is 4, (<xref href="GUID-C248C8F6-46F2-39AB-A202-CB2D98FCF760.dita"><apiname>KSendAsDefaultMessageSlots</apiname></xref>). </p> </li> |
28 <li id="GUID-5469B019-40CD-5864-BF4B-43DEC2FDF34F"><p>The draft folder |
29 <li id="GUID-5469B019-40CD-5864-BF4B-43DEC2FDF34F"><p>The draft folder is |
29 is emptied, before creating a new message. </p> </li> |
30 emptied, before creating a new message. </p> </li> |
30 <li id="GUID-A1D2D778-42D2-51DA-817C-65E350BABB9C"><p>Fetch the names |
31 <li id="GUID-A1D2D778-42D2-51DA-817C-65E350BABB9C"><p>Fetch the names and |
31 and UIDs for the filtered list of message types using the <xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita#GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3/GUID-B94FAE68-3EB9-3E01-97B7-3A77CE5A4740"><apiname>RSendAs::FilteredMessageTypesL()</apiname></xref> function to create a SendAs |
32 UIDs for the filtered list of message types using the <xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita#GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3/GUID-B94FAE68-3EB9-3E01-97B7-3A77CE5A4740"><apiname>RSendAs::FilteredMessageTypesL()</apiname></xref> function |
32 message. Then the UID based on the message type is returned, and with |
33 to create a SendAs message. Then the UID based on the message type is returned, |
33 the entry set on the drafts folder a SendAs message is created by |
34 and with the entry set on the drafts folder a SendAs message is created by |
34 calling the <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita#GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6/GUID-F5C5023D-0066-3DD7-BFFA-CCA8E0DD1C76"><apiname>RSendAsMessage::CreateL(RSendAs &,TSendAsAccount)</apiname></xref> function. </p> </li> |
35 calling the <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita#GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6/GUID-2B52A16E-FD71-3E9E-89A1-E154F01F5A59"><apiname>RSendAsMessage::CreateL()</apiname></xref> function. </p> </li> |
35 <li id="GUID-8CE79BC4-4240-5E94-851B-2E13DFB3B271"><p>Set a body text |
36 <li id="GUID-8CE79BC4-4240-5E94-851B-2E13DFB3B271"><p>Set a body text for |
36 for the message and specify the recipients. In this example, the body |
37 the message and specify the recipients. In this example, the body text is |
37 text is set using an option, which is read from the user. Option given |
38 set using an option, which is read from the user. Option given to the user |
38 to the user are '1' for 8-bit encoding, '2' for 16-bit encoding and |
39 are '1' for 8-bit encoding, '2' for 16-bit encoding and '0' or by default |
39 '0' or by default its unicode type of encoding. The encoded descriptor |
40 its unicode type of encoding. The encoded descriptor is set as the message's |
40 is set as the message's body text using the <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita#GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6/GUID-22E37DB6-35A2-3B01-A785-189B92A7E8D4"><apiname>RSendAsMessage::SetBodyTextL(const |
41 body text using the <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita#GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6/GUID-6823DF51-D9D6-384C-9FE3-C00D30D3B232"><apiname>RSendAsMessage::SetBodyTextL()</apiname></xref>function. </p></li> |
41 CRichText &)</apiname></xref>function. </p></li> |
42 <li><p>The recipients are added using the <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita#GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6/GUID-9F433FF9-0276-34B0-ADF3-F332E90A9248"><apiname>RSendAsMessage::AddRecipientL()</apiname></xref> function. |
42 <li><p>The recipients are added using the <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita#GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6/GUID-106A7A1C-023B-33EB-8925-859E2088FF24"><apiname>RSendAsMessage::AddRecipientL(const |
43 The recipient's address is held in a descriptor. The alias is the displayed |
43 TDesC &,TSendAsRecipientType)</apiname></xref> function. The recipient's |
44 recipient name.</p></li> |
44 address is held in a descriptor. The alias is the displayed recipient |
45 <li id="GUID-EB161170-E53F-5892-B7A6-6DF4529C924D"><p>The recipient type is |
45 name.</p></li> |
46 one of the <xref href="GUID-3DFEC3A5-1DDB-3BF0-871A-91B96F06EC42.dita"><apiname>TSendAsRecipientType</apiname></xref> enumeration values, that |
46 <li id="GUID-EB161170-E53F-5892-B7A6-6DF4529C924D"><p>The recipient |
47 is, one of the following: </p> <ul> |
47 type is one of the <xref href="GUID-3DFEC3A5-1DDB-3BF0-871A-91B96F06EC42.dita"><apiname>TSendAsRecipientType</apiname></xref> enumeration |
48 <li id="GUID-7D3CA067-B14A-5694-9C80-3FA740E1D3AA"><p> <xref href="GUID-D8B673F7-1367-3228-813A-D74138533BC2.dita"><apiname>ESendAsRecipientTo</apiname></xref> - |
48 values, that is, one of the following: </p> <ul> |
49 The recipient goes in the 'To' field. </p> </li> |
49 <li id="GUID-7D3CA067-B14A-5694-9C80-3FA740E1D3AA"><p> <xref href="GUID-D8B673F7-1367-3228-813A-D74138533BC2.dita"><apiname>ESendAsRecipientTo</apiname></xref> - The recipient goes in the 'To' field. </p> </li> |
50 <li id="GUID-6E67C22D-4C3F-5F77-8454-AF35290C31A6"><p> <xref href="GUID-A990E3D5-E20A-3CDA-9417-15C234E85F57.dita"><apiname>ESendAsRecipientCc</apiname></xref> - |
50 <li id="GUID-6E67C22D-4C3F-5F77-8454-AF35290C31A6"><p> <xref href="GUID-A990E3D5-E20A-3CDA-9417-15C234E85F57.dita"><apiname>ESendAsRecipientCc</apiname></xref> - The recipient goes in the 'Cc' field </p> </li> |
51 The recipient goes in the 'Cc' field </p> </li> |
51 <li id="GUID-0D5D7039-1970-579C-8629-5C41C3B3538D"><p> <xref href="GUID-EF736A4B-685E-3E77-B4A1-E1B06EAD2523.dita"><apiname>ESendAsRecipientBcc</apiname></xref> - The recipient goes in the 'Bcc' field </p> </li> |
52 <li id="GUID-0D5D7039-1970-579C-8629-5C41C3B3538D"><p> <xref href="GUID-EF736A4B-685E-3E77-B4A1-E1B06EAD2523.dita"><apiname>ESendAsRecipientBcc</apiname></xref> - |
52 </ul> <p>If the 'Cc' field is not supported, the recipient will instead |
53 The recipient goes in the 'Bcc' field </p> </li> |
53 be added to the 'To' field since these are functionally equivalent. </p> <p>If the 'Bcc' field is not supported, this function will return <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>. </p> </li> |
54 </ul> <p>If the 'Cc' field is not supported, the recipient will instead be |
54 </ul> <p>The example also displays the names of the accounts present |
55 added to the 'To' field since these are functionally equivalent. </p> <p>If |
55 in the list. </p> <p>To demonstrate this, 3 new accounts are appended |
56 the 'Bcc' field is not supported, this function will return <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>. </p> </li> |
56 and they are displayed in a for-loop by calling <xref href="GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4.dita#GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4/GUID-1FB61663-625D-3294-84BA-D811044D1235"><apiname>CSendAsAccounts::AccountNames().MdcaPoint(i)</apiname></xref>, where the <xref href="GUID-7D6D682B-4ACD-312E-B0BE-D182930182D0.dita"><apiname>MdcaPoint()</apiname></xref> function takes in the |
57 </ul> <p>The example also displays the names of the accounts present in the |
57 integer value of the current iteration in the for-loop and indexes |
58 list. </p> <p>To demonstrate this, 3 new accounts are appended and they are |
58 into a descriptor array. </p> <p>The example also demonstrates how |
59 displayed in a for-loop by calling <xref href="GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4.dita#GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4/GUID-1FB61663-625D-3294-84BA-D811044D1235"><apiname>CSendAsAccounts::AccountNames().MdcaPoint(i)</apiname></xref>, |
59 to refine the available message types of the connected session using |
60 where the <xref href="GUID-7D6D682B-4ACD-312E-B0BE-D182930182D0.dita"><apiname>MdcaPoint()</apiname></xref> function takes in the integer value |
60 the <xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita#GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3/GUID-C87673B0-714F-31C0-9F9E-C095669007AF"><apiname>RSendAs::FilterAgainstCapability()</apiname></xref> function. </p> <p>The <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita#GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6/GUID-28EE1E22-8892-388C-990D-BC0E1F18D88E"><apiname>RSendAsMessage::SendMessage()</apiname></xref> function |
61 of the current iteration in the for-loop and indexes into a descriptor array. </p> <p>The |
61 is used asynchronously to send the message. Finally the <xref href="GUID-2A8E907A-B3AE-3D83-882C-ED0A98B5D39A.dita#GUID-2A8E907A-B3AE-3D83-882C-ED0A98B5D39A/GUID-1EDE87E5-3F1C-34E2-9172-72990783E7E7"><apiname>RsendAs::Close()</apiname></xref> function is used to end the session with SendAs server. </p> </section> |
62 example also demonstrates how to refine the available message types of the |
62 <section id="GUID-5D17C0D4-1D8E-5E85-AEFD-7083A748C728"><title>Download</title> <p>Click on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-90c56a55-33bb-4ab7-a6b8-8932ba181dc8.zip" scope="external">sendAs.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-90c56a55-33bb-4ab7-a6b8-8932ba181dc8.html" scope="peer">browse </xref> to view the example code. </p> </section> |
63 connected session using the <xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita#GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3/GUID-C87673B0-714F-31C0-9F9E-C095669007AF"><apiname>RSendAs::FilterAgainstCapability()</apiname></xref> function. </p> <p>The <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita#GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6/GUID-28EE1E22-8892-388C-990D-BC0E1F18D88E"><apiname>RSendAsMessage::SendMessage()</apiname></xref> function is used asynchronously to send the message. Finally the <xref href="GUID-2A8E907A-B3AE-3D83-882C-ED0A98B5D39A.dita#GUID-2A8E907A-B3AE-3D83-882C-ED0A98B5D39A/GUID-1EDE87E5-3F1C-34E2-9172-72990783E7E7"><apiname>RsendAs::Close()</apiname></xref> function |
63 <section id="GUID-3AE6EA98-02BC-41BD-AC4E-157A6700A12A"><title>Class |
64 is used to end the session with SendAs server. </p> </section> |
64 summary</title><p> The SendAs v2 example application uses the following |
65 <section id="GUID-5D17C0D4-1D8E-5E85-AEFD-7083A748C728"><title>Download</title> <p>Click |
65 classes:</p><ul> |
66 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-90c56a55-33bb-4ab7-a6b8-8932ba181dc8.zip" scope="external">sendAs.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-90c56a55-33bb-4ab7-a6b8-8932ba181dc8.html" scope="peer">browse </xref> to view the example code. </p> </section> |
66 <li><p><xref href="GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49.dita"><apiname>CMsvEntry </apiname></xref></p></li> |
67 <section id="GUID-3AE6EA98-02BC-41BD-AC4E-157A6700A12A"><title>Class summary</title><p> The SendAs v2 example application |
67 <li><p><xref href="GUID-B36289AC-769F-3A83-BADB-AE0568E97581.dita"><apiname>MMsvEntryObserver </apiname></xref></p></li> |
68 uses the following classes:</p><p><xref href="GUID-85BBE389-81F7-3E2F-A789-446D9BE2CC49.dita"><apiname>CMsvEntry </apiname></xref><xref href="GUID-B36289AC-769F-3A83-BADB-AE0568E97581.dita"><apiname>MMsvEntryObserver </apiname></xref><xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita"><apiname>CMsvSession </apiname></xref><xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita"><apiname>RSendAs </apiname></xref><xref href="GUID-CB2BB982-F91D-3E06-8D66-56731AA60EB8.dita"><apiname>CSendAsMessageTypes </apiname></xref><xref href="GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4.dita"><apiname>CSendAsAccounts </apiname></xref> <xref href="GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4.dita"><apiname>CSendAsAccounts </apiname></xref> <xref href="GUID-1FDBA8F6-D1CC-3AE5-AF48-1256D50C5A4F.dita"><apiname>CMsvOperationWait </apiname></xref><xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita"><apiname> RSendAsMessage </apiname></xref></p></section> |
68 <li><p><xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita"><apiname>CMsvSession </apiname></xref></p></li> |
69 <section id="GUID-13FDF5EE-00C2-54D4-AF6C-41E3DBDC2B93"><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian build process</xref> describes |
69 <li><p><xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita"><apiname>RSendAs </apiname></xref></p></li> |
70 how to build an application. </p> <p>The SendAs example builds an executable |
70 <li><p><xref href="GUID-CB2BB982-F91D-3E06-8D66-56731AA60EB8.dita"><apiname>CSendAsMessageTypes </apiname></xref></p></li> |
71 called <filepath>SendAs2Example.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i> for |
71 <li><p><xref href="GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4.dita"><apiname>CSendAsAccounts </apiname></xref></p></li> |
72 CodeWarrior). After launching the executable, depending on the emulator you |
72 <li><p><xref href="GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4.dita"><apiname>CSendAsAccounts </apiname></xref></p></li> |
73 are using, you may need to task away from the app launcher/shell screen to |
73 <li><p><xref href="GUID-1FDBA8F6-D1CC-3AE5-AF48-1256D50C5A4F.dita"><apiname>CMsvOperationWait </apiname></xref></p></li> |
74 view the console. </p> </section> |
74 <li><p><xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita"><apiname>RSendAsMessage </apiname></xref></p></li> |
75 <section id="GUID-E9152EC2-A404-549C-B7CA-25CAC97BA686"><title>See also</title> <p>To |
75 </ul></section> |
76 create advanced applications using the SendAs API refer to the complete <xref href="GUID-F7598A84-9736-5310-AAA4-5BCC4BE46C16.dita"> SendAs </xref> API reference |
76 <section id="GUID-13FDF5EE-00C2-54D4-AF6C-41E3DBDC2B93"><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian |
77 documentation, which details all the features of the API. </p> </section> |
77 build process</xref> describes how to build an application. </p> <p>The SendAs example builds an executable called <filepath>SendAs2Example.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i> for CodeWarrior). After launching the |
|
78 executable, depending on the emulator you are using, you may need |
|
79 to task away from the app launcher/shell screen to view the console. </p> </section> |
|
80 <section id="GUID-E9152EC2-A404-549C-B7CA-25CAC97BA686"><title>See |
|
81 also</title> <p>To create advanced applications using the SendAs API |
|
82 refer to the complete <xref href="GUID-F7598A84-9736-5310-AAA4-5BCC4BE46C16.dita"> SendAs </xref> API |
|
83 reference documentation, which details all the features of the API. </p> </section> |
78 </conbody></concept> |
84 </conbody></concept> |