|
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 task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-133999E8-0ACB-5929-949E-82BB16F8E267" xml:lang="en"><title>Writing |
|
13 a UI MTM </title><abstract><p>This section explains the initial set up steps to be performed |
|
14 to write a UI MTM. It does not explain the implementation of all <xref href="GUID-EB76BA4B-D6A2-5651-A310-647E1D2CDEBC.dita">UI |
|
15 MTM functionality</xref>, however, you can see the <xref href="GUID-385BB488-5C32-58A7-8401-F3F0A0707DD9.dita">UI |
|
16 MTM example</xref>for detailed implementation steps.</p></abstract><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
17 <context><p>The most basic functionality required in a UI MTM is to open a |
|
18 message (for viewing or editing) and close it again. The <xref href="GUID-A5982338-A057-3870-8832-F503AEAC470A.dita#GUID-A5982338-A057-3870-8832-F503AEAC470A/GUID-0DD6B979-0473-3AAD-AE14-F1B0AC1E73C5"><apiname>CBaseMtmUi::OpenL()</apiname></xref> function |
|
19 opens the current context; the actual behaviour is dependent on the entry |
|
20 that the context points at. </p> <p>The base class of UI MTM, <xref href="GUID-2AD22359-BB98-31D2-8138-4E5F17A4BFE7.dita"><apiname>CBaseUiMtm</apiname></xref>, |
|
21 defines functions that return <xref href="GUID-AF724192-6580-3DE3-9287-3A005C0AA932.dita"><apiname>CMsvOperation</apiname></xref> objects for |
|
22 control of asynchronous operations. Implementers of these functions are required |
|
23 to provide suitable classes that are derived from <xref href="GUID-AF724192-6580-3DE3-9287-3A005C0AA932.dita"><apiname>CMsvOperation</apiname></xref>. |
|
24 For example, if <xref href="GUID-2AD22359-BB98-31D2-8138-4E5F17A4BFE7.dita#GUID-2AD22359-BB98-31D2-8138-4E5F17A4BFE7/GUID-59FD3DB0-9F10-3052-B4F6-F9CF59854B8B"><apiname>CBaseUiMtm::EditL()</apiname></xref> is implemented to provide |
|
25 message editing, a derived <xref href="GUID-AF724192-6580-3DE3-9287-3A005C0AA932.dita"><apiname>CMsvOperation</apiname></xref> class must be |
|
26 provided that completes when the editing operation is complete. </p> </context> |
|
27 <steps id="GUID-DD170CFC-0DD8-5B20-856C-E9269FD98F29"> |
|
28 <step id="GUID-23F7AF46-A909-5802-8168-8416EF531AF1"><cmd/> |
|
29 <info>Derive a class from the <xref href="GUID-A5982338-A057-3870-8832-F503AEAC470A.dita"><apiname>CBaseMtmUi</apiname></xref> class. </info> |
|
30 </step> |
|
31 <step id="GUID-A37BCDA1-14CB-5FF2-931D-F32A8B92478B"><cmd/> |
|
32 <info>Register it using the <xref href="GUID-0D5D7FAC-4F14-3046-92FB-873B8350FF4C.dita"><apiname>CRegisteredMtmDll</apiname></xref> parameter. </info> |
|
33 </step> |
|
34 <step id="GUID-694A8171-AD7B-5671-86AA-87CC470213CE"><cmd/> |
|
35 <info>Create the <xref href="GUID-AF724192-6580-3DE3-9287-3A005C0AA932.dita"><apiname>CMsvOperation</apiname></xref> -based classes for performing |
|
36 the different operations that are required for your Messaging protocol. </info> |
|
37 </step> |
|
38 </steps> |
|
39 <example><title>UI MTM example</title><codeblock xml:space="preserve">// |
|
40 // CTextMtmUi: User Interface MTM |
|
41 // |
|
42 |
|
43 CTextMtmUi* CTextMtmUi::NewL(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll) |
|
44 { |
|
45 CTextMtmUi* self=new(ELeave) CTextMtmUi(aBaseMtm, aRegisteredMtmDll); |
|
46 CleanupStack::PushL(self); |
|
47 self->ConstructL(); |
|
48 CleanupStack::Pop(); |
|
49 return self; |
|
50 } |
|
51 |
|
52 CTextMtmUi::CTextMtmUi(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll) |
|
53 : CBaseMtmUi(aBaseMtm, aRegisteredMtmDll) |
|
54 { |
|
55 |
|
56 }</codeblock> <p>For more details on implementing all the |
|
57 UI MTM functions, see <xref href="GUID-385BB488-5C32-58A7-8401-F3F0A0707DD9.dita">example |
|
58 code</xref>. </p> </example> |
|
59 </taskbody><related-links> |
|
60 <link href="GUID-59217FA7-3078-53CA-88B3-78D6FB788271.dita"><linktext>MTM overview</linktext> |
|
61 </link> |
|
62 <link href="GUID-EB76BA4B-D6A2-5651-A310-647E1D2CDEBC.dita"><linktext>User Interface |
|
63 MTM</linktext></link> |
|
64 </related-links></task> |