|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: view class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <aknviewappui.h> |
|
20 #include <bctestdomfntlay.rsg> |
|
21 |
|
22 #include "bctestdomfntlay.hrh" |
|
23 #include "bctestdomfntlayview.h" |
|
24 #include "bctestdomfntlaycontainer.h" |
|
25 #include "bctestutil.h" |
|
26 #include "bctestdomfntlaycase.h" |
|
27 #include "bctestdomskincase.h" |
|
28 #include "bctestdomlayoutdatacase.h" |
|
29 #include "bctestdomlayoutsystemcase.h" |
|
30 #include "bctestdomgraphiccase.h" |
|
31 |
|
32 // ======== MEMBER FUNCTIONS ======== |
|
33 |
|
34 // --------------------------------------------------------------------------- |
|
35 // Symbian 2nd static Constructor |
|
36 // --------------------------------------------------------------------------- |
|
37 // |
|
38 CBCTestDomFntlayView* CBCTestDomFntlayView::NewL() |
|
39 { |
|
40 CBCTestDomFntlayView* self = new( ELeave ) CBCTestDomFntlayView(); |
|
41 CleanupStack::PushL( self ); |
|
42 self->ConstructL(); |
|
43 CleanupStack::Pop( self ); |
|
44 return self; |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // C++ default Constructor |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 CBCTestDomFntlayView::CBCTestDomFntlayView() |
|
52 { |
|
53 |
|
54 |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // Symbian 2nd Constructor |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 void CBCTestDomFntlayView::ConstructL() |
|
62 { |
|
63 BaseConstructL( R_BCTESTDOMFNTLAY_VIEW ); |
|
64 |
|
65 iContainer = new( ELeave ) CBCTestDomFntlayContainer(); |
|
66 iContainer->SetMopParent( this ); |
|
67 iContainer->ConstructL( ClientRect() ); |
|
68 AppUi()->AddToStackL( *this, iContainer ); |
|
69 iContainer->MakeVisible( ETrue ); |
|
70 |
|
71 iTestUtil = CBCTestUtil::NewL(); |
|
72 |
|
73 // Add test case here. |
|
74 _LIT( KTxtFntlay, "Fntlay test case" ); |
|
75 iTestUtil->AddTestCaseL( CBCTestDomFntlayCase::NewL( iContainer ), |
|
76 KTxtFntlay ); |
|
77 |
|
78 _LIT( KTxtSkin, "Skin test case" ); |
|
79 iTestUtil->AddTestCaseL(CBCTestDomSkinCase::NewL(), |
|
80 KTxtSkin ); |
|
81 |
|
82 _LIT( KTxtLayoutData, "LayoutData test case" ); |
|
83 iTestUtil->AddTestCaseL(CBCTestDomLayoutDataCase::NewL(), |
|
84 KTxtLayoutData ); |
|
85 |
|
86 _LIT( KTxtLayoutSystem, "LayoutSystem test case" ); |
|
87 iTestUtil->AddTestCaseL(CBCTestDomLayoutSystemCase::NewL(), |
|
88 KTxtLayoutSystem ); |
|
89 |
|
90 _LIT( KTxtGraphic, "Graphic test case" ); |
|
91 iTestUtil->AddTestCaseL(CBCTestDomGraphicCase::NewL(), |
|
92 KTxtGraphic ); |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // Destructor |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 CBCTestDomFntlayView::~CBCTestDomFntlayView() |
|
100 { |
|
101 if ( iContainer ) |
|
102 { |
|
103 AppUi()->RemoveFromStack( iContainer ); |
|
104 } |
|
105 delete iContainer; |
|
106 delete iTestUtil; |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------------------------- |
|
110 // CBCTestDomFntlayView::Id |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 TUid CBCTestDomFntlayView::Id() const |
|
114 { |
|
115 return KBCTestDomFntlayViewId; |
|
116 } |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // CBCTestDomFntlayView::DoActivateL |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 void CBCTestDomFntlayView::DoActivateL( const TVwsViewId&, TUid, const TDesC8& ) |
|
123 { |
|
124 } |
|
125 |
|
126 // --------------------------------------------------------------------------- |
|
127 // CBCTestDomFntlayView::DoDeactivate |
|
128 // --------------------------------------------------------------------------- |
|
129 // |
|
130 void CBCTestDomFntlayView::DoDeactivate() |
|
131 { |
|
132 } |
|
133 |
|
134 // --------------------------------------------------------------------------- |
|
135 // CBCTestDomFntlayView::HandleCommandL |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 void CBCTestDomFntlayView::HandleCommandL( TInt aCommand ) |
|
139 { |
|
140 switch ( aCommand ) |
|
141 { |
|
142 case EProgCmdAutoTest: |
|
143 iTestUtil->RunL(); |
|
144 break; |
|
145 default: |
|
146 if ( aCommand > EBCTestDomCmdEmptyOutline && |
|
147 aCommand < EBCTestDomCmdMaxOutline ) |
|
148 { |
|
149 iTestUtil->RunL( aCommand ); |
|
150 } |
|
151 break; |
|
152 } |
|
153 } |