|
1 /* |
|
2 * Copyright (c) 2006 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 |
|
21 #include "BCTestCmDlg.hrh" |
|
22 #include <bctestcmdlg.rsg> |
|
23 #include "BCTestCmDlgview.h" |
|
24 #include "BCTestCmDlgcontainer.h" |
|
25 #include "bctestutil.h" |
|
26 #include "BCTestCmDlgcase.h" |
|
27 #include "bctestmemselpage.h" |
|
28 #include "bctestfileseldlg.h" |
|
29 #include "bctestfilenamedlg.h" |
|
30 #include "bctestcommondlg.h" |
|
31 #include "bctestmemselitem.h" |
|
32 |
|
33 // ======== MEMBER FUNCTIONS ======== |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // Symbian 2nd static Constructor |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 CBCTestCmDlgView* CBCTestCmDlgView::NewL() |
|
40 { |
|
41 CBCTestCmDlgView* self = new( ELeave ) CBCTestCmDlgView(); |
|
42 CleanupStack::PushL( self ); |
|
43 self->ConstructL(); |
|
44 CleanupStack::Pop( self ); |
|
45 return self; |
|
46 } |
|
47 |
|
48 // --------------------------------------------------------------------------- |
|
49 // C++ default Constructor |
|
50 // --------------------------------------------------------------------------- |
|
51 // |
|
52 CBCTestCmDlgView::CBCTestCmDlgView() |
|
53 { |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // Symbian 2nd Constructor |
|
58 // --------------------------------------------------------------------------- |
|
59 // |
|
60 void CBCTestCmDlgView::ConstructL() |
|
61 { |
|
62 BaseConstructL( R_BCTESTCMDLG_VIEW ); |
|
63 |
|
64 iContainer = new( ELeave ) CBCTestCmDlgContainer(); |
|
65 iContainer->SetMopParent( this ); |
|
66 iContainer->ConstructL( ClientRect() ); |
|
67 AppUi()->AddToStackL( *this, iContainer ); |
|
68 iContainer->MakeVisible( ETrue ); |
|
69 |
|
70 iTestUtil = CBCTestUtil::NewL(); |
|
71 |
|
72 // Add test case here. |
|
73 iTestUtil->AddTestCaseL( CBCTestCmDlgCase::NewL(), |
|
74 _L("Mem selection dialog") ); |
|
75 iTestUtil->AddTestCaseL( CBCTestMemSelSettingPage::NewL(), |
|
76 _L("Mem selection setting page") ); |
|
77 iTestUtil->AddTestCaseL( CBCTestFileSelDlg::NewL(), |
|
78 _L("File selection dialog") ); |
|
79 iTestUtil->AddTestCaseL( CBCTestFileNameDlg::NewL(), |
|
80 _L("File name prompt dialog") ); |
|
81 iTestUtil->AddTestCaseL( CBCTestCommonDlg::NewL(), |
|
82 _L("Common dialog") ); |
|
83 iTestUtil->AddTestCaseL( CBCTestMemSelSettingItem::NewL(), |
|
84 _L("Mem selection setting item") ); |
|
85 } |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // Destructor |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 CBCTestCmDlgView::~CBCTestCmDlgView() |
|
92 { |
|
93 if ( iContainer ) |
|
94 { |
|
95 AppUi()->RemoveFromStack( iContainer ); |
|
96 } |
|
97 delete iContainer; |
|
98 delete iTestUtil; |
|
99 } |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // CBCTestCmDlgView::Id |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 TUid CBCTestCmDlgView::Id() const |
|
106 { |
|
107 return KBCTestCmDlgViewId; |
|
108 } |
|
109 |
|
110 // --------------------------------------------------------------------------- |
|
111 // CBCTestCmDlgView::DoActivateL |
|
112 // --------------------------------------------------------------------------- |
|
113 // |
|
114 void CBCTestCmDlgView::DoActivateL( const TVwsViewId&, TUid, const TDesC8& ) |
|
115 { |
|
116 } |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // CBCTestCmDlgView::DoDeactivate |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 void CBCTestCmDlgView::DoDeactivate() |
|
123 { |
|
124 } |
|
125 |
|
126 // --------------------------------------------------------------------------- |
|
127 // CBCTestCmDlgView::HandleCommandL |
|
128 // --------------------------------------------------------------------------- |
|
129 // |
|
130 void CBCTestCmDlgView::HandleCommandL( TInt aCommand ) |
|
131 { |
|
132 switch ( aCommand ) |
|
133 { |
|
134 case EProgCmdAutoTest: |
|
135 iTestUtil->RunL(); |
|
136 break; |
|
137 default: |
|
138 if ( aCommand > EBCTestCmdEmptyOutline && |
|
139 aCommand < EBCTestCmdMaxOutline ) |
|
140 { |
|
141 iTestUtil->RunL( aCommand ); |
|
142 } |
|
143 break; |
|
144 } |
|
145 } |