|
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 // testappslow.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @test |
|
21 @internalComponent - Internal Symbian test code |
|
22 */ |
|
23 |
|
24 #include <eikstart.h> |
|
25 #include <eikapp.h> |
|
26 #include "testappnorv.h" |
|
27 #include "testapps.h" |
|
28 |
|
29 /** |
|
30 Standard DLL entry point function. |
|
31 Creates and returns an instance of the CApaApplication-derived class. |
|
32 @return an instance of the CApaApplication-derived class |
|
33 */ |
|
34 TInt E32Main() |
|
35 { |
|
36 return EikStart::RunApplication( CTestApplication::NewApplication ); |
|
37 } |
|
38 |
|
39 CTestApplication::CTestApplication() |
|
40 { |
|
41 } |
|
42 |
|
43 CTestApplication::~CTestApplication() |
|
44 { |
|
45 } |
|
46 |
|
47 /** |
|
48 @return The application's UID |
|
49 */ |
|
50 TUid CTestApplication::AppDllUid() const |
|
51 { |
|
52 const TUid dll = {KTestAppNoRvUid}; |
|
53 return dll; |
|
54 } |
|
55 |
|
56 /** |
|
57 @return CTestApplication or NULL if KErrNoMemory |
|
58 */ |
|
59 CApaApplication* CTestApplication::NewApplication() |
|
60 { |
|
61 // As the framework has at this point not started up enough, and therefore the TRAP-harness and |
|
62 // exception handlers aren’t available yet, this factory function is a non-leaving function and |
|
63 // can't use the new(Eleave) operator. |
|
64 return new CTestApplication(); |
|
65 } |
|
66 |
|
67 /** |
|
68 Called by the UI framework at application start-up to create an instance of the document class. |
|
69 @leave KErrNoMemory |
|
70 @return A CTestDocument |
|
71 */ |
|
72 CApaDocument* CTestApplication::CreateDocumentL() |
|
73 { |
|
74 return CTestDocument::NewL(*this); |
|
75 } |
|
76 |
|
77 CTestDocument::CTestDocument(CEikApplication& aApp) : CEikDocument(aApp) |
|
78 { |
|
79 } |
|
80 |
|
81 CTestDocument::~CTestDocument() |
|
82 { |
|
83 } |
|
84 |
|
85 /** |
|
86 Factory function for this class |
|
87 @return a new CEndTaskTestDocument instance. |
|
88 */ |
|
89 CTestDocument* CTestDocument::NewL(CEikApplication& aApp) |
|
90 { |
|
91 return new(ELeave) CTestDocument(aApp); |
|
92 } |
|
93 |
|
94 |
|
95 /** |
|
96 Called by the UI framework to construct the application UI class. |
|
97 Note that the app UI's ConstructL() is called by the UI framework. |
|
98 */ |
|
99 CEikAppUi* CTestDocument::CreateAppUiL() |
|
100 { |
|
101 return new(ELeave) CTestAppUi(); |
|
102 } |
|
103 |
|
104 CTestAppUi::CTestAppUi() |
|
105 { |
|
106 } |
|
107 |
|
108 CTestAppUi::~CTestAppUi() |
|
109 { |
|
110 } |
|
111 |
|
112 |
|
113 void CTestAppUi::ConstructL() |
|
114 { |
|
115 // Complete the UI framework's construction of the App UI. |
|
116 BaseConstructL(CEikAppUi::ENoAppResourceFile); |
|
117 } |
|
118 |
|
119 |
|
120 /** |
|
121 Overload this CCoeAppUi virtual method so that the framework no longer calls rendezvous. |
|
122 We can than fail to call it ourselves in order to simulate a pooly behaved application. |
|
123 */ |
|
124 TBool CTestAppUi::FrameworkCallsRendezvous() const |
|
125 { |
|
126 return EFalse; |
|
127 } |