|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 #include <eikstart.h> |
|
23 #include <eikapp.h> |
|
24 #include "testappslow.h" |
|
25 #include "testapps.h" |
|
26 |
|
27 |
|
28 /** |
|
29 Standard DLL entry point function. |
|
30 Creates and returns an instance of the CApaApplication-derived class. |
|
31 @return an instance of the CApaApplication-derived class |
|
32 */ |
|
33 TInt E32Main() |
|
34 { |
|
35 return EikStart::RunApplication( CTestApplication::NewApplication ); |
|
36 } //lint -e714 Suppress 'not referenced' |
|
37 |
|
38 |
|
39 |
|
40 CTestApplication::CTestApplication() |
|
41 { |
|
42 } |
|
43 |
|
44 |
|
45 |
|
46 CTestApplication::~CTestApplication() |
|
47 { |
|
48 } |
|
49 |
|
50 |
|
51 |
|
52 /** |
|
53 @return The application's UID |
|
54 */ |
|
55 TUid CTestApplication::AppDllUid() const |
|
56 { |
|
57 const TUid dll = {KTestAppSlowUid}; |
|
58 return dll; |
|
59 } |
|
60 |
|
61 |
|
62 |
|
63 /** |
|
64 @return CTestApplication or NULL if KErrNoMemory |
|
65 */ |
|
66 CApaApplication* CTestApplication::NewApplication() |
|
67 { |
|
68 // As the framework has at this point not started up enough, and therefore the TRAP-harness and |
|
69 // exception handlers aren’t available yet, this factory function is a non-leaving function and |
|
70 // can't use the new(Eleave) operator. |
|
71 return new CTestApplication(); |
|
72 } |
|
73 |
|
74 |
|
75 |
|
76 /** |
|
77 Called by the UI framework at application start-up to create an instance of the document class. |
|
78 @leave KErrNoMemory |
|
79 @return A CTestDocument |
|
80 */ |
|
81 CApaDocument* CTestApplication::CreateDocumentL() |
|
82 { |
|
83 return CTestDocument::NewL(*this); |
|
84 } |
|
85 |
|
86 |
|
87 |
|
88 CTestDocument::CTestDocument(CEikApplication& aApp) : CEikDocument(aApp) |
|
89 { |
|
90 } |
|
91 |
|
92 |
|
93 |
|
94 CTestDocument::~CTestDocument() |
|
95 { |
|
96 } |
|
97 |
|
98 |
|
99 |
|
100 /** |
|
101 Factory function for this class |
|
102 @return a new CEndTaskTestDocument instance. |
|
103 */ |
|
104 CTestDocument* CTestDocument::NewL(CEikApplication& aApp) |
|
105 { |
|
106 return new(ELeave) CTestDocument(aApp); |
|
107 } |
|
108 |
|
109 |
|
110 |
|
111 /** |
|
112 Called by the UI framework to construct the application UI class. |
|
113 Note that the app UI's ConstructL() is called by the UI framework. |
|
114 */ |
|
115 CEikAppUi* CTestDocument::CreateAppUiL() |
|
116 { |
|
117 return new(ELeave) CTestAppUi(); |
|
118 } |
|
119 |
|
120 |
|
121 |
|
122 CTestAppUi::CTestAppUi() |
|
123 { |
|
124 } |
|
125 |
|
126 |
|
127 |
|
128 CTestAppUi::~CTestAppUi() |
|
129 { |
|
130 } |
|
131 |
|
132 |
|
133 |
|
134 void CTestAppUi::ConstructL() |
|
135 { |
|
136 // Complete the UI framework's construction of the App UI. |
|
137 BaseConstructL(CEikAppUi::ENoAppResourceFile); |
|
138 |
|
139 // Slugabed startup delay. |
|
140 User::After( KTestAppSlowTimeout ); |
|
141 } |