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-07D2ED79-90B2-4ABC-A61F-108DAEE21955" xml:lang="en"><title>Implementing |
12 <concept id="GUID-07D2ED79-90B2-4ABC-A61F-108DAEE21955" xml:lang="en"><title>Implementing |
13 framework requirements</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 framework requirements</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
14 <fig id="GUID-9F184193-87DA-40F1-B946-BE7D101626DA"><title>Application menu</title><image href="GUID-98AC61E5-57C9-445E-98CB-79C6642CB041_d0e63518_href.png"/></fig> |
14 <fig id="GUID-0BBC3D60-0EF0-4446-A1A5-CF84A4728C72"><title>Application Menu</title><image href="GUID-3382507E-1B21-418C-A908-DD3F688C0672_d0e69813_href.png"/></fig> |
15 <p>In the Symbian platform, mobile device users start applications from |
15 <p>In the Symbian platform, mobile device users start applications from |
16 the application menu. When the mobile device user selects an application, |
16 the application menu. When the mobile device user selects an application, |
17 the application framework calls the application's entry point to launch the |
17 the application framework calls the application's entry point to launch the |
18 application. In some cases, applications can also be started by other executables.</p> |
18 application. In some cases, applications can also be started by other executables.</p> |
19 <fig id="GUID-5A76CBEA-8AF3-4F68-B2FB-9F402D748DF3"><title>Application launch</title><image href="GUID-370F4A51-EC67-4B6C-B14A-5C640A58688B_d0e63526_href.png"/></fig> |
19 <fig id="GUID-5A76CBEA-8AF3-4F68-B2FB-9F402D748DF3"><title>Application launch</title><image href="GUID-CC4CA423-0A14-457C-8CBE-4A9F0E8D0B96_d0e69821_href.png"/></fig> |
20 <p>When an application starts, objects are created in the following order:</p> |
20 <p>When an application starts, objects are created in the following order:</p> |
21 <ol> |
21 <ol> |
22 <li id="GUID-BC07E865-8B42-4654-90F9-4644B202EDBC"><p>application |
22 <li id="GUID-BC07E865-8B42-4654-90F9-4644B202EDBC"><p>application |
23 (<xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknApplication.html" format="application/java-archive"><parmname>CAknApplication</parmname></xref>)</p></li> |
23 (<xref href="GUID-4F825D83-47A4-36C9-9A25-943A6D799F84.dita"><apiname>CAknApplication</apiname></xref>)</p></li> |
24 <li id="GUID-0B6D8737-8FC7-486B-B3ED-6F91CFA69670"><p>document (<xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknDocument.html" format="application/java-archive"><parmname>CAknDocument</parmname></xref>)</p> |
24 <li id="GUID-0B6D8737-8FC7-486B-B3ED-6F91CFA69670"><p>document (<xref href="GUID-935C59EE-AD66-33FE-987B-BD97F5147CC1.dita"><apiname>CAknDocument</apiname></xref>)</p> |
25 </li> |
25 </li> |
26 <li id="GUID-FAAD10CF-2F0F-4589-B2B8-A2A8A3696CA5"><p>UI controller |
26 <li id="GUID-FAAD10CF-2F0F-4589-B2B8-A2A8A3696CA5"><p>UI controller |
27 (<xref href="GUID-B5DE1C86-2B16-4B22-887F-7079E54A8ED6.dita"><parmname>CAknAppUI</parmname></xref> or <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita"><parmname>CAknAppViewUI</parmname></xref> depending |
27 (<xref href="GUID-6F2BAB12-6273-3314-B9F1-9AA08403F5EF.dita"><apiname>CAknAppUI</apiname></xref> or <xref href="GUID-9CB85702-5D4F-371E-99D0-F6030DC86539.dita"><apiname>CAknAppViewUI</apiname></xref> depending |
28 upon your approach)</p></li> |
28 upon your approach)</p></li> |
29 <li id="GUID-ED56D892-18C4-447C-A7AB-811E1D90C2DA"><p>in <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita">Symbian |
29 <li id="GUID-ED56D892-18C4-447C-A7AB-811E1D90C2DA"><p>view controller |
30 view applications</xref> , view controller (<xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknView.html" format="application/java-archive"><parmname>CAknView</parmname></xref>)</p> |
30 (<xref href="GUID-11967EBB-7439-3775-B287-7560ECA0AF1F.dita"><apiname>CAknView</apiname></xref>) in <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita">Symbian |
|
31 view applications</xref></p></li> |
|
32 <li id="GUID-5BFF07E4-6575-4B23-9FA5-824DB057A55C"><p>view (<xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></xref>)</p> |
31 </li> |
33 </li> |
32 <li id="GUID-5BFF07E4-6575-4B23-9FA5-824DB057A55C"><p>view (<xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeControlClass.html" format="application/java-archive"><parmname>CCoeControl</parmname></xref>)</p></li> |
|
33 </ol> |
34 </ol> |
34 <section id="GUID-B8AA011F-23EB-4BA5-9FA6-1382D37E13A9"><title>Entry point</title> |
35 <section id="GUID-B8AA011F-23EB-4BA5-9FA6-1382D37E13A9"><title>Entry point</title> |
35 <p>The two methods that you need to implement for the entry point are as |
36 <p>The two methods that you need to implement for the entry point are as |
36 follows:</p> |
37 follows:</p> |
37 <ul> |
38 <ul> |
38 <li><p>an entry point for the application, with the following syntax:</p> |
39 <li><p>an entry point for the application, with the following syntax:</p> |
39 <itemgroup> |
40 <itemgroup> |
40 <codeblock id="GUID-F09C226F-B1D6-4435-8983-7DD62D1BBD26" xml:space="preserve">GLDEF_C TInt E32Main() |
41 <codeblock id="GUID-F09C226F-B1D6-4435-8983-7DD62D1BBD26" xml:space="preserve">GLDEF_C TInt E32Main() |
41 { |
42 { |
42 return EikStart::RunApplication( NewApplication ); |
43 return EikStart::RunApplication( NewApplication ); |
43 }</codeblock> |
44 }</codeblock> |
44 <p>where:</p> |
45 <p>where:</p> |
45 <p><parmname>E32Main()</parmname> is the entry point method called by the |
46 <p><parmname>E32Main()</parmname> is the entry point method called by the |
46 application framework</p> |
47 application framework</p> |
47 <p><parmname>return EikStart::RunApplication(NewApplication )</parmname> calls <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/EikStartClass.html#%3a%3aEikStart%3a%3aRunApplication%28%29" format="application/java-archive"><parmname>EikStart::RunApplication</parmname></xref></p> |
48 <p><parmname>return EikStart::RunApplication(NewApplication )</parmname> calls<xref href="GUID-E5533B10-D01F-3133-8E74-28071766885B.dita#GUID-E5533B10-D01F-3133-8E74-28071766885B/GUID-275C4B9B-53BD-38C5-8C8E-05D480358836"><apiname> EikStart::RunApplication()</apiname></xref></p> |
48 </itemgroup> |
49 </itemgroup> |
49 </li> |
50 </li> |
50 <li><p>a non-leaving factory method that creates a new instance |
51 <li><p>a non-leaving factory method that creates a new instance |
51 of the application class, or <parmname>NULL</parmname> if the class cannot |
52 of the application class, or <parmname>NULL</parmname> if the class cannot |
52 be instantiated. The expected syntax is as follows:</p> |
53 be instantiated. The expected syntax is as follows:</p> |
55 { |
56 { |
56 return new CMyAppClass; |
57 return new CMyAppClass; |
57 }</codeblock> |
58 }</codeblock> |
58 <p>where:</p> |
59 <p>where:</p> |
59 <p><parmname>NewApplication()</parmname> is a method that returns a pointer |
60 <p><parmname>NewApplication()</parmname> is a method that returns a pointer |
60 to a <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Application_Architecture/CApaApplicationClass.html" format="application/java-archive"><parmname>CApaApplication</parmname></xref> object.</p> |
61 to a <xref href="GUID-C0297A58-2E39-3211-A2B4-C334192CE2A7.dita"><apiname>CApaApplication</apiname></xref> object.</p> |
61 <p><parmname>return new CMyAppClass</parmname> returns an instance of the |
62 <p><parmname>return new CMyAppClass</parmname> returns an instance of the |
62 application class as created by the <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknApplication.html" format="application/java-archive"><parmname>CAknApplication</parmname></xref> derived |
63 application class as created by the <xref href="GUID-4F825D83-47A4-36C9-9A25-943A6D799F84.dita"><apiname>CAknApplication</apiname></xref> derived |
63 class</p> |
64 class</p> |
64 <p>The application framework expects the factory method to have exactly |
65 <p>The application framework expects the factory method to have exactly |
65 this prototype. In other words, the factory function should be like the above |
66 this prototype. In other words, the factory function should be like the above |
66 code fragment.</p> |
67 code fragment.</p> |
67 </itemgroup> |
68 </itemgroup> |
68 </li> |
69 </li> |
69 </ul> |
70 </ul> |
70 </section> |
71 </section> |
71 <section id="GUID-63C94373-F55D-4B58-9637-7BA0E1B14ACF"><title>CAknApplication</title> |
72 <section id="GUID-63C94373-F55D-4B58-9637-7BA0E1B14ACF"><title>CAknApplication</title> |
72 <p>You must implement at least the following two methods in your <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknApplication.html" format="application/java-archive"><parmname>CAknApplication</parmname></xref> derived |
73 <p>You must implement at least the following two methods in your <xref href="GUID-4F825D83-47A4-36C9-9A25-943A6D799F84.dita"><apiname>CAknApplication</apiname></xref> derived |
73 class:</p> |
74 class:</p> |
74 <ul> |
75 <ul> |
75 <li><p>a method that returns the application UID. The syntax is |
76 <li><p>a method that returns the application UID. The syntax is |
76 as follows:</p> |
77 as follows:</p> |
77 <codeblock id="GUID-77921F31-5A36-4A6B-AD2C-E9364A50E0F6" xml:space="preserve">TUid CMyAppClass::AppDllUid() const |
78 <codeblock id="GUID-77921F31-5A36-4A6B-AD2C-E9364A50E0F6" xml:space="preserve">TUid CMyAppClass::AppDllUid() const |
78 { |
79 { |
79 return KUidMyApp; |
80 return KUidMyApp; |
80 }</codeblock> |
81 }</codeblock> |
81 <p>where:</p> |
82 <p>where:</p> |
82 <itemgroup> |
83 <itemgroup> |
83 <p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Application_Architecture/CApaApplicationClass.html#%3a%3aCApaApplication%3a%3aAppDllUid%28%29const" format="application/java-archive">CApaApplication::AppDllUid()</xref> is used to get the application |
84 <p><xref href="GUID-C0297A58-2E39-3211-A2B4-C334192CE2A7.dita#GUID-C0297A58-2E39-3211-A2B4-C334192CE2A7/GUID-669C19DC-04C9-3979-A87E-8F9EFA8E4D99"><apiname>CApaApplication::AppDllUid()</apiname></xref> is used to get the application |
84 UID</p> |
85 UID</p> |
85 <p><parmname>KUidMyApp</parmname> is the UID for your application, which |
86 <p><parmname>KUidMyApp</parmname> is the UID for your application, which |
86 is typically declared in an application header file</p> |
87 is typically declared in an application header file.</p> |
87 </itemgroup> |
88 </itemgroup> |
88 <p>The application framework calls the <parmname>AppDllUid()</parmname> method |
89 <p>The application framework calls the <parmname>AppDllUid()</parmname> method |
89 to get the application UID. The application framework checks to see if there |
90 to get the application UID. The application framework checks to see if there |
90 is an instance of the application with the same UID already running. If so, |
91 is an instance of the application with the same UID already running. If so, |
91 then the application framework switches to the already existing application. </p> |
92 then the application framework switches to the already existing application. </p> |
100 return CMyAppDocument::NewL( *this ); |
101 return CMyAppDocument::NewL( *this ); |
101 } |
102 } |
102 </codeblock> |
103 </codeblock> |
103 <p>where:</p> |
104 <p>where:</p> |
104 <itemgroup> |
105 <itemgroup> |
105 <p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Application_Architecture/CApaApplicationClass.html#%3a%3aCApaApplication%3a%3aCreateDocumentL%28CApaProcess%20%2a%29" format="application/java-archive"><parmname>CEikApplication::CreateDocumentL</parmname></xref> is called |
106 <p><xref href="GUID-E36E2F07-09E7-32BC-BB83-14DF9232E7D9.dita#GUID-E36E2F07-09E7-32BC-BB83-14DF9232E7D9/GUID-D0810109-8F11-3B65-8806-9A61317D2128"><apiname>CEikApplication::CreateDocumentL()</apiname></xref> is called by the |
106 by the application framework</p> |
107 application framework.</p> |
107 <p> <parmname>return CMyAppDocument::NewL( *this )</parmname> returns an |
108 <p> <parmname>return CMyAppDocument::NewL( *this )</parmname> returns an |
108 instance of the <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknDocument.html" format="application/java-archive"><parmname>CAknDocument</parmname></xref> derived |
109 instance of the <xref href="GUID-935C59EE-AD66-33FE-987B-BD97F5147CC1.dita"><apiname>CAknDocument</apiname></xref> derived class of your application. |
109 class of your application. It represents the data that relates to a particular |
110 It represents the data that relates to a particular instance of the application |
110 instance of the application and owns the application <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI |
111 and owns the application <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI |
111 controller</xref>.</p> |
112 controller</xref>.</p> |
112 </itemgroup> |
113 </itemgroup> |
113 </li> |
114 </li> |
114 </ul> |
115 </ul> |
115 <note> |
116 <note> |
116 <p>The application framework owns the document object and is responsible |
117 <p>The application framework owns the document object and is responsible |
117 for destroying it.</p> |
118 for destroying it.</p> |
118 </note> |
119 </note> |
119 </section> |
120 </section> |
120 <section id="GUID-73A8D2EE-F22A-483D-A23A-5E46D709A718"><title>CAknDocument</title> |
121 <section id="GUID-73A8D2EE-F22A-483D-A23A-5E46D709A718"><title>CAknDocument</title> |
121 <p>You must implement a <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknDocument.html" format="application/java-archive"><parmname>CAknDocument</parmname></xref> derived |
122 <p>You must implement a <xref href="GUID-935C59EE-AD66-33FE-987B-BD97F5147CC1.dita"><apiname>CAknDocument</apiname></xref> derived class for |
122 class for your application, even if you do not store data, as this is the |
123 your application, even if you do not store data, as this is the class that |
123 class that owns the <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI |
124 owns the <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI controller</xref> for |
124 controller</xref> for your application. The expected syntax for creating the |
125 your application. The expected syntax for creating the UI controller class |
125 UI controller class is as follows:</p> |
126 is as follows:</p> |
126 <codeblock id="GUID-C016DB83-2B28-4DEC-8027-A9291E380191" xml:space="preserve">CEikAppUi* CMyAppDocument::CreateAppUiL() |
127 <codeblock id="GUID-C016DB83-2B28-4DEC-8027-A9291E380191" xml:space="preserve">CEikAppUi* CMyAppDocument::CreateAppUiL() |
127 { |
128 { |
128 return new ( ELeave ) CMyAppAppUi; |
129 return new ( ELeave ) CMyAppAppUi; |
129 }</codeblock> |
130 }</codeblock> |
130 <p>where:</p> |
131 <p>where:</p> |
131 <ul> |
132 <ul> |
132 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikDocumentClass.html#%3a%3aCEikDocument%3a%3aCreateAppUiL%28%29" format="application/java-archive"><parmname>CEikDocument::CreateAppUiL</parmname></xref> carries out the first phase construction of the UI controller</p> |
133 <li><p><xref href="GUID-B33A8A56-D1BE-3E3D-B5AC-F644A5C764DB.dita#GUID-B33A8A56-D1BE-3E3D-B5AC-F644A5C764DB/GUID-37544F28-FD9A-3E11-96B8-7DA8BC84CC59"><apiname>CEikDocument::CreateAppUiL()</apiname></xref> carries out |
133 </li> |
134 the first phase construction of the UI controller</p></li> |
134 <li><p><parmname>new ( ELeave ) CMyAppAppUi </parmname> is a method |
135 <li><p><parmname>new ( ELeave ) CMyAppAppUi </parmname> is a method |
135 that creates an instance of the UI controller class of your application</p> |
136 that creates an instance of the UI controller class of your application</p> |
136 </li> |
137 </li> |
137 </ul> |
138 </ul> |
138 <p>The application framework owns the UI controller object of the application |
139 <p>The application framework owns the UI controller object of the application |
139 and is responsible for destroying it. There are two alternate classes from |
140 and is responsible for destroying it. There are two alternate classes from |
140 which you can derive your UI controller class, <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknAppUi.html" format="application/java-archive"><parmname>CAknAppUi</parmname></xref> or <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknViewAppUi.html" format="application/java-archive"><parmname>CAknViewAppUi</parmname></xref>.</p> |
141 which you can derive your UI controller class, <xref href="GUID-77329067-34D9-3698-B764-294535E660EB.dita"><apiname>CAknAppUi</apiname></xref> or <xref href="GUID-2DBA2DA9-3DA7-381C-842C-9F6FEEDF973E.dita"><apiname>CAknViewAppUi</apiname></xref>.</p> |
141 <p>For more information on the UI controller options, see <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI controller</xref></p> |
142 <p>For more information on the UI controller options, see <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI controller</xref></p> |
142 </section> |
143 </section> |
143 </conbody></concept> |
144 </conbody></concept> |