Symbian3/SDK/Source/GUID-382B8A9D-9D10-54CD-91A6-B9E7A2477662.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     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-382B8A9D-9D10-54CD-91A6-B9E7A2477662" xml:lang="en"><title>SendAs
       
    13 v2.0</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <section id="GUID-9D54D47A-37D9-5229-92D5-B80B442E8B0D"><title>Description</title> <p>The
       
    15 application establishes a session with the SendAs server, sets
       
    16 a message entry, creates a message, sets its body text, adds a recipient,
       
    17 sends the message and closes the session. The sequence of events is detailed
       
    18 in the following list: </p> <ul>
       
    19 <li id="GUID-ADE16BD9-7B38-5B35-8E72-77E968D1CED2"><p>Create a session with
       
    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>
       
    21 <li id="GUID-E1BF3D0E-C278-57F6-9359-4EDC426034BD"><p>Set the message entry
       
    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>
       
    23 <li id="GUID-C89C044C-B1DF-5541-8F0E-81DBA222E126"><p>After setting the entry,
       
    24 the application gets a selection containing the IDs of all the context children,
       
    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>
       
    26 <li id="GUID-B2B5D96F-68F3-5000-B615-3AE7DA32E3A3"><p>The connection to the
       
    27 server is made using the default number of message slots available to a session,
       
    28 which is 4, (<xref href="GUID-C248C8F6-46F2-39AB-A202-CB2D98FCF760.dita"><apiname>KSendAsDefaultMessageSlots</apiname></xref>). </p> </li>
       
    29 <li id="GUID-5469B019-40CD-5864-BF4B-43DEC2FDF34F"><p>The draft folder is
       
    30 emptied, before creating a new message. </p> </li>
       
    31 <li id="GUID-A1D2D778-42D2-51DA-817C-65E350BABB9C"><p>Fetch the names and
       
    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
       
    33 to create a SendAs message. Then the UID based on the message type is returned,
       
    34 and with the entry set on the drafts folder a SendAs message is created by
       
    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>
       
    36 <li id="GUID-8CE79BC4-4240-5E94-851B-2E13DFB3B271"><p>Set a body text for
       
    37 the message and specify the recipients. In this example, the body text is
       
    38 set using an option, which is read from the user. Option given to the user
       
    39 are '1' for 8-bit encoding, '2' for 16-bit encoding and '0' or by default
       
    40 its unicode type of encoding. The encoded descriptor is set as the message's
       
    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>
       
    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.
       
    43 The recipient's address is held in a descriptor. The alias is the displayed
       
    44 recipient name.</p></li>
       
    45 <li id="GUID-EB161170-E53F-5892-B7A6-6DF4529C924D"><p>The recipient type is
       
    46 one of the <xref href="GUID-3DFEC3A5-1DDB-3BF0-871A-91B96F06EC42.dita"><apiname>TSendAsRecipientType</apiname></xref> enumeration values, that
       
    47 is, one of the following: </p> <ul>
       
    48 <li id="GUID-7D3CA067-B14A-5694-9C80-3FA740E1D3AA"><p> <xref href="GUID-D8B673F7-1367-3228-813A-D74138533BC2.dita"><apiname>ESendAsRecipientTo</apiname></xref> -
       
    49 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> -
       
    51 The recipient goes in the 'Cc' 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> -
       
    53 The recipient goes in the 'Bcc' field </p> </li>
       
    54 </ul> <p>If the 'Cc' field is not supported, the recipient will instead be
       
    55 added to the 'To' field since these are functionally equivalent. </p> <p>If
       
    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>
       
    57 </ul> <p>The example also displays the names of the accounts present in the
       
    58 list. </p> <p>To demonstrate this, 3 new accounts are appended and they are
       
    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>,
       
    60 where the <xref href="GUID-7D6D682B-4ACD-312E-B0BE-D182930182D0.dita"><apiname>MdcaPoint()</apiname></xref> function takes in the integer value
       
    61 of the current iteration in the for-loop and indexes into a descriptor array. </p> <p>The
       
    62 example also demonstrates how to refine the available message types of the
       
    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
       
    64 is used to end the session with SendAs server. </p> </section>
       
    65 <section id="GUID-5D17C0D4-1D8E-5E85-AEFD-7083A748C728"><title>Download</title> <p>Click
       
    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>
       
    67 <section id="GUID-3AE6EA98-02BC-41BD-AC4E-157A6700A12A"><title>Class summary</title><p> The SendAs v2 example application
       
    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>
       
    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
       
    70 how to build an application. </p> <p>The SendAs example builds an executable
       
    71 called <filepath>SendAs2Example.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i>&lt;build_variant&gt;</i> for
       
    72 CodeWarrior). After launching the executable, depending on the emulator you
       
    73 are using, you may need to task away from the app launcher/shell screen to
       
    74 view the console. </p> </section>
       
    75 <section id="GUID-E9152EC2-A404-549C-B7CA-25CAC97BA686"><title>See also</title> <p>To
       
    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
       
    77 documentation, which details all the features of the API. </p> </section>
       
    78 </conbody></concept>