|
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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file |
|
20 @test |
|
21 @internalComponent - Internal Symbian test code |
|
22 */ |
|
23 |
|
24 #include <eikappui.h> |
|
25 #include <eikapp.h> |
|
26 #include <eikdoc.h> |
|
27 #include <eikenv.h> |
|
28 #include <EIKSTART.H> |
|
29 |
|
30 /** KTUnProtectedAppTestPassed is a number chosen at random to be used as an exit reason |
|
31 for UnProtectedApp.exe's application thread to signify that the test passed */ |
|
32 const TInt KTUnProtectedAppTestPassed = 1234; |
|
33 |
|
34 /////////////////////////////////////////////////////////////////////// |
|
35 // |
|
36 // CExampleAppUi |
|
37 // |
|
38 //////////////////////////////////////////////////////////////////////// |
|
39 class CExampleAppUi : public CEikAppUi |
|
40 { |
|
41 public: |
|
42 void ConstructL(); |
|
43 ~CExampleAppUi(); |
|
44 }; |
|
45 |
|
46 |
|
47 void CExampleAppUi::ConstructL() |
|
48 { |
|
49 BaseConstructL(); |
|
50 User::Exit(KTUnProtectedAppTestPassed); |
|
51 } |
|
52 |
|
53 CExampleAppUi::~CExampleAppUi() |
|
54 { |
|
55 } |
|
56 |
|
57 //////////////////////////////////////////////////////////////////////// |
|
58 // |
|
59 // CExampleDocument |
|
60 // |
|
61 //////////////////////////////////////////////////////////////////////// |
|
62 class CExampleDocument : public CEikDocument |
|
63 { |
|
64 public: |
|
65 static CExampleDocument* NewL(CEikApplication& aApp); |
|
66 CExampleDocument(CEikApplication& aApp); |
|
67 void ConstructL(); |
|
68 private: |
|
69 // Inherited from CEikDocument |
|
70 CEikAppUi* CreateAppUiL(); |
|
71 }; |
|
72 |
|
73 CExampleDocument::CExampleDocument(CEikApplication& aApp) |
|
74 : CEikDocument(aApp) |
|
75 { |
|
76 } |
|
77 |
|
78 CEikAppUi* CExampleDocument::CreateAppUiL() |
|
79 { |
|
80 return new(ELeave) CExampleAppUi; |
|
81 } |
|
82 |
|
83 //////////////////////////////////////////////////////////////////////// |
|
84 // |
|
85 // CExampleApplication |
|
86 // |
|
87 //////////////////////////////////////////////////////////////////////// |
|
88 |
|
89 class CExampleApplication : public CEikApplication |
|
90 { |
|
91 private: |
|
92 // Inherited from class CApaApplication |
|
93 CApaDocument* CreateDocumentL(); |
|
94 TUid AppDllUid() const; |
|
95 private: |
|
96 CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); } |
|
97 }; |
|
98 |
|
99 const TUid KUidUnProctectedUidApp = { 0xA0001C5E }; |
|
100 |
|
101 TUid CExampleApplication::AppDllUid() const |
|
102 { |
|
103 return KUidUnProctectedUidApp; |
|
104 } |
|
105 |
|
106 CApaDocument* CExampleApplication::CreateDocumentL() |
|
107 { |
|
108 return new (ELeave) CExampleDocument(*this); |
|
109 } |
|
110 |
|
111 EXPORT_C CApaApplication* NewApplication() |
|
112 { |
|
113 return new CExampleApplication; |
|
114 } |
|
115 |
|
116 GLDEF_C TInt E32Main() |
|
117 { |
|
118 return EikStart::RunApplication(NewApplication); |
|
119 } |