|
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 <eikappui.h> |
|
23 #include <eikapp.h> |
|
24 #include <eikdoc.h> |
|
25 #include <eikenv.h> |
|
26 #include <eikstart.h> |
|
27 |
|
28 /** KTUnProtectedAppTestPassed is a number chosen at random to be used as an exit reason |
|
29 for UnProtectedApp.exe's application thread to signify that the test passed */ |
|
30 const TInt KTUnProtectedAppTestPassed = 1234; |
|
31 |
|
32 // |
|
33 // |
|
34 // CExampleAppUi |
|
35 // |
|
36 // |
|
37 class CExampleAppUi : public CEikAppUi |
|
38 { |
|
39 public: |
|
40 void ConstructL(); |
|
41 ~CExampleAppUi(); |
|
42 }; |
|
43 |
|
44 |
|
45 void CExampleAppUi::ConstructL() |
|
46 { |
|
47 BaseConstructL(); |
|
48 User::Exit(KTUnProtectedAppTestPassed); |
|
49 } |
|
50 |
|
51 CExampleAppUi::~CExampleAppUi() |
|
52 { |
|
53 } |
|
54 |
|
55 // |
|
56 // |
|
57 // CExampleDocument |
|
58 // |
|
59 // |
|
60 class CExampleDocument : public CEikDocument |
|
61 { |
|
62 public: |
|
63 static CExampleDocument* NewL(CEikApplication& aApp); |
|
64 CExampleDocument(CEikApplication& aApp); |
|
65 void ConstructL(); |
|
66 private: |
|
67 // Inherited from CEikDocument |
|
68 CEikAppUi* CreateAppUiL(); |
|
69 }; |
|
70 |
|
71 CExampleDocument::CExampleDocument(CEikApplication& aApp) |
|
72 : CEikDocument(aApp) |
|
73 { |
|
74 } |
|
75 |
|
76 CEikAppUi* CExampleDocument::CreateAppUiL() |
|
77 { |
|
78 return new(ELeave) CExampleAppUi; |
|
79 } |
|
80 |
|
81 // |
|
82 // |
|
83 // CExampleApplication |
|
84 // |
|
85 // |
|
86 |
|
87 class CExampleApplication : public CEikApplication |
|
88 { |
|
89 private: |
|
90 // Inherited from class CApaApplication |
|
91 CApaDocument* CreateDocumentL(); |
|
92 TUid AppDllUid() const; |
|
93 private: |
|
94 CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); } |
|
95 }; |
|
96 |
|
97 const TUid KUidUnProctectedUidApp = { 0xA0001C5E }; |
|
98 |
|
99 TUid CExampleApplication::AppDllUid() const |
|
100 { |
|
101 return KUidUnProctectedUidApp; |
|
102 } |
|
103 |
|
104 CApaDocument* CExampleApplication::CreateDocumentL() |
|
105 { |
|
106 return new (ELeave) CExampleDocument(*this); |
|
107 } |
|
108 |
|
109 EXPORT_C CApaApplication* NewApplication() |
|
110 { |
|
111 return new CExampleApplication; |
|
112 } |
|
113 |
|
114 GLDEF_C TInt E32Main() |
|
115 { |
|
116 return EikStart::RunApplication(NewApplication); |
|
117 } |