|
1 /* |
|
2 * Copyright (c) 2005 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 the License "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: A view to change settings. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "TestHarnessContainer.h" |
|
20 #include "TestHarnessView.h" |
|
21 #include "LeakTracker.h" |
|
22 |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CFeedContainer::NewL |
|
26 // |
|
27 // Two-phased constructor. |
|
28 // ----------------------------------------------------------------------------- |
|
29 // |
|
30 CTestHarnessContainer* CTestHarnessContainer::NewL(CTestHarnessView& aView, const TRect& aRect) |
|
31 { |
|
32 CTestHarnessContainer* self = new (ELeave) CTestHarnessContainer(aView); |
|
33 |
|
34 CleanupStack::PushL(self); |
|
35 self->ConstructL(aRect); |
|
36 CleanupStack::Pop(); |
|
37 |
|
38 return self; |
|
39 } |
|
40 |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CTestHarnessContainer::CTestHarnessContainer |
|
44 // |
|
45 // C++ default constructor. |
|
46 // ----------------------------------------------------------------------------- |
|
47 // |
|
48 CTestHarnessContainer::CTestHarnessContainer(CTestHarnessView& aView): |
|
49 iView(aView) |
|
50 { |
|
51 LEAK_TRACKER_INCREMENT(CLeakTracker::ETestHarnessContainer); |
|
52 } |
|
53 |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CFeedContainer::ConstructL |
|
57 // |
|
58 // Symbian 2nd phase constructor can leave. |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 void CTestHarnessContainer::ConstructL(const TRect& aRect) |
|
62 { |
|
63 CreateWindowL(); |
|
64 |
|
65 SetRect(aRect); |
|
66 ActivateL(); |
|
67 } |
|
68 |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CTestHarnessContainer::~CTestHarnessContainer |
|
72 // |
|
73 // Deconstructor. |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 CTestHarnessContainer::~CTestHarnessContainer() |
|
77 { |
|
78 LEAK_TRACKER_DECREMENT(CLeakTracker::ETestHarnessContainer); |
|
79 } |
|
80 |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CFeedContainer::OfferKeyEventL |
|
84 // |
|
85 // Handles key event. |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 TKeyResponse CTestHarnessContainer::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/, |
|
89 TEventCode /*aType*/) |
|
90 { |
|
91 return EKeyWasNotConsumed; |
|
92 } |
|
93 |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CTestHarnessContainer::SizeChanged |
|
97 // |
|
98 // Called by framework when the view size is changed. |
|
99 // ----------------------------------------------------------------------------- |
|
100 // |
|
101 void CTestHarnessContainer::SizeChanged() |
|
102 { |
|
103 } |
|
104 |
|
105 // ----------------------------------------------------------------------------- |
|
106 // CFolderContainer::CountComponentControls |
|
107 // |
|
108 // Returns number of components. |
|
109 // ----------------------------------------------------------------------------- |
|
110 // |
|
111 TInt CTestHarnessContainer::CountComponentControls() const |
|
112 { |
|
113 return 0; |
|
114 } |
|
115 |
|
116 |
|
117 // ----------------------------------------------------------------------------- |
|
118 // CFolderContainer::ComponentControl |
|
119 // |
|
120 // Returns pointer to particular component. |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 CCoeControl* CTestHarnessContainer::ComponentControl(TInt /*aIndex*/) const |
|
124 { |
|
125 return NULL; |
|
126 } |
|
127 |
|
128 |
|
129 // --------------------------------------------------------- |
|
130 // CTestHarnessContainer::Draw |
|
131 // |
|
132 // CBrCtlSampleAppContainer::Draw(const TRect& aRect) const |
|
133 // --------------------------------------------------------- |
|
134 // |
|
135 void CTestHarnessContainer::Draw(const TRect& aRect) const |
|
136 { |
|
137 CWindowGc& gc = SystemGc(); |
|
138 gc.SetPenStyle(CGraphicsContext::ESolidPen); |
|
139 gc.SetBrushColor(KRgbGray); |
|
140 gc.SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
141 gc.DrawRect(aRect); |
|
142 } |
|
143 |