|
1 // Copyright (c) 2005-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 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 |
|
22 #include <barsread.h> |
|
23 #include <eikenv.h> |
|
24 #include <techview/eikwbtb.h> |
|
25 #include <techview/eikwbut.h> |
|
26 #include <techview/eiktbar.h> |
|
27 #include <eikapp.h> |
|
28 #include <techview/eikbctrl.h> |
|
29 |
|
30 #include "tvwappui.H" |
|
31 #include "tvwview.H" |
|
32 |
|
33 // |
|
34 // CTestVwAppView. |
|
35 // |
|
36 |
|
37 CTestVwAppView::~CTestVwAppView() |
|
38 { |
|
39 } |
|
40 |
|
41 CTestVwAppView::CTestVwAppView(const TVwsViewId& aViewId,CTestVwAppUi& aAppUi) |
|
42 :iAppUi(aAppUi),iViewId(aViewId) |
|
43 { |
|
44 } |
|
45 |
|
46 void CTestVwAppView::ViewActivatedL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage) |
|
47 { |
|
48 DoActivateNarrowL(aPrevViewId,aCustomMessageId,aCustomMessage); |
|
49 } |
|
50 |
|
51 void CTestVwAppView::ViewConstructL() |
|
52 { |
|
53 } |
|
54 |
|
55 void CTestVwAppView::ViewDeactivated() |
|
56 { |
|
57 DoDeactivate(); |
|
58 } |
|
59 |
|
60 void CTestVwAppView::DoDeactivate() |
|
61 { |
|
62 } |
|
63 |
|
64 void CTestVwAppView::ActivateViewL(const TVwsViewId& aViewId) |
|
65 { |
|
66 STATIC_CAST(CCoeAppUi&,iAppUi).ActivateViewL(aViewId); |
|
67 } |
|
68 |
|
69 void CTestVwAppView::ActivateViewL(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC16& aCustomMessage) |
|
70 { |
|
71 iAppUi.ActivateViewL(aViewId,aCustomMessageId,aCustomMessage); |
|
72 } |
|
73 |
|
74 TRect CTestVwAppView::ClientRect() const |
|
75 { |
|
76 TRect rect(AppUi().ClientRect()); |
|
77 return rect; |
|
78 } |
|
79 |
|
80 CTestVwAppUi& CTestVwAppView::AppUi() const |
|
81 { |
|
82 return iAppUi; |
|
83 } |
|
84 |
|
85 void CTestVwAppView::ProcessCommandL(TInt aCommand) |
|
86 { |
|
87 HandleCommandL(aCommand); |
|
88 } |
|
89 |
|
90 void CTestVwAppView::AddToStackL(CCoeControl* aControl,TInt aPriority,TInt aStackingFlags) |
|
91 { |
|
92 iAppUi.AddToViewStackL(*this,aControl,aPriority,aStackingFlags); |
|
93 } |
|
94 |
|
95 void CTestVwAppView::RemoveFromStack(CCoeControl* aControl) |
|
96 { |
|
97 iAppUi.RemoveFromViewStack(*this,aControl); |
|
98 } |
|
99 |
|
100 void CTestVwAppView::UpdateStackedControlFlags(CCoeControl* aControl,TInt aFlags,TInt aMask) |
|
101 { |
|
102 iAppUi.UpdateViewStackedControlFlags(*this,aControl,aFlags,aMask); |
|
103 } |
|
104 |
|
105 TVwsViewId CTestVwAppView::ViewId() const |
|
106 { |
|
107 return iViewId; |
|
108 } |
|
109 |
|
110 void CTestVwAppView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,const TDesC16& /*aCustomMessage*/) |
|
111 { |
|
112 ASSERT(EFalse); |
|
113 } |
|
114 |
|
115 void CTestVwAppView::DoActivateNarrowL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage) |
|
116 { |
|
117 HBufC16* wideCustomMessage=HBufC16::NewLC(aCustomMessage.Size()); |
|
118 TPtr16 ptr=wideCustomMessage->Des(); |
|
119 ptr.Copy((TUint16*)aCustomMessage.Ptr(),aCustomMessage.Length()); |
|
120 DoActivateL(aPrevViewId,aCustomMessageId,ptr); |
|
121 CleanupStack::PopAndDestroy(); // wideCustomMessage. |
|
122 } |
|
123 |
|
124 void CTestVwAppView::HandleCommandL(TInt /*aCommand*/) |
|
125 { |
|
126 } |
|
127 |
|
128 void CTestVwAppView::SetEmphasis(CCoeControl* /*aMenuControl*/,TBool /*aEmphasis*/) |
|
129 { |
|
130 } |
|
131 |
|
132 void CTestVwAppView::HandleModelChangeL() |
|
133 { |
|
134 } |
|
135 |