|
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: Manager for video keypad |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <eikenv.h> |
|
21 #include <eikapp.h> |
|
22 #include <gulicon.h> |
|
23 #include <w32std.h> |
|
24 #include <eikimage.h> // CEikImage |
|
25 #include <barsread.h> // TResourceReader |
|
26 #include <aknappui.h> |
|
27 #include <AknUtils.h> |
|
28 #include <AknsDrawUtils.h> |
|
29 #include <AknLayoutFont.h> |
|
30 #include <AknLayout2Def.h> |
|
31 #include <layoutmetadata.cdl.h> |
|
32 #include <AknLayout2ScalableDef.h> |
|
33 #include <aknlayoutscalable_apps.cdl.h> |
|
34 #include <AknsBasicBackgroundControlContext.h> |
|
35 #include <AknsFrameBackgroundControlContext.h> |
|
36 |
|
37 #include "cdialervideocontainer.h" |
|
38 #include "dialercommon.h" |
|
39 |
|
40 |
|
41 // CONSTS |
|
42 const TInt KNumberOfButtons = 0; // Number of command buttons in container. |
|
43 const TInt KVideoControlCount = KNumberOfButtons + 1; // = Video window |
|
44 |
|
45 |
|
46 // ========================= MEMBER FUNCTIONS ================================ |
|
47 |
|
48 // --------------------------------------------------------------------------- |
|
49 // CDialerVideoContainer::NewL |
|
50 // Symbian OS two phased constructor |
|
51 // |
|
52 // --------------------------------------------------------------------------- |
|
53 // |
|
54 CDialerVideoContainer* CDialerVideoContainer::NewL( |
|
55 const CCoeControl& aContainer, |
|
56 CCoeControl& aVideoWindow ) |
|
57 { |
|
58 CDialerVideoContainer* self = |
|
59 new( ELeave )CDialerVideoContainer( aContainer, aVideoWindow ); |
|
60 CleanupStack::PushL( self ); |
|
61 self->ConstructL(); |
|
62 CleanupStack::Pop(); // self |
|
63 return self; |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------------------------- |
|
67 // CDialerVideoContainer::ConstructL |
|
68 // Symbian OS two phased constructor |
|
69 // |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 void CDialerVideoContainer::ConstructL() |
|
73 { |
|
74 BaseConstructL(); |
|
75 |
|
76 iVideoWindow.SetContainerWindowL( *this ); |
|
77 iVideoWindow.SetParent( this ); |
|
78 iVideoWindow.SetMopParent( this ); |
|
79 |
|
80 ActivateL(); |
|
81 } |
|
82 |
|
83 |
|
84 // Constructor |
|
85 CDialerVideoContainer::CDialerVideoContainer( |
|
86 const CCoeControl& aContainer, |
|
87 CCoeControl& aVideoWindow ) |
|
88 : CDialerContainerBase ( const_cast<CCoeControl&>(aContainer) ), |
|
89 iVideoWindow ( aVideoWindow ) |
|
90 { |
|
91 // Empty. |
|
92 } |
|
93 |
|
94 // Destructor |
|
95 CDialerVideoContainer::~CDialerVideoContainer() |
|
96 { |
|
97 // Empty. |
|
98 } |
|
99 |
|
100 |
|
101 // Methods from base class |
|
102 |
|
103 // |
|
104 // Methods from CDialerContainerBase |
|
105 // |
|
106 |
|
107 // --------------------------------------------------------------------------- |
|
108 // CDialerVideoContainer::SetFocus |
|
109 // |
|
110 // --------------------------------------------------------------------------- |
|
111 // |
|
112 void CDialerVideoContainer::SetFocus( TBool aFocus, |
|
113 TDrawNow /*aDrawNow*/ ) |
|
114 { |
|
115 iVideoWindow.SetFocus( aFocus ); |
|
116 } |
|
117 |
|
118 |
|
119 // --------------------------------------------------------------------------- |
|
120 // CDialerVideoContainer::SetVariety |
|
121 // Set variety according to status |
|
122 // |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 void CDialerVideoContainer::SetVariety() |
|
126 { |
|
127 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
128 { |
|
129 iVariety = EVideoVarietyLandscape; |
|
130 } |
|
131 else |
|
132 { |
|
133 iVariety = EVideoVarietyPortrait; |
|
134 } |
|
135 } |
|
136 |
|
137 // --------------------------------------------------------------------------- |
|
138 // CDialerVideoContainer::SetLayout |
|
139 // |
|
140 // --------------------------------------------------------------------------- |
|
141 // |
|
142 void CDialerVideoContainer::SetLayout() |
|
143 { |
|
144 iVideoWindow.SetRect( Rect() ); |
|
145 } |
|
146 |
|
147 |
|
148 // --------------------------------------------------------------------------- |
|
149 // CDialerKeyPadContainer::CountComponentControls |
|
150 // |
|
151 // --------------------------------------------------------------------------- |
|
152 // |
|
153 TInt CDialerVideoContainer::CountComponentControls() const |
|
154 { |
|
155 return KVideoControlCount; |
|
156 } |
|
157 |
|
158 // --------------------------------------------------------------------------- |
|
159 // CDialerVideoContainer::ComponentControl |
|
160 // |
|
161 // --------------------------------------------------------------------------- |
|
162 // |
|
163 CCoeControl* CDialerVideoContainer::ComponentControl( TInt aIndex ) const |
|
164 { |
|
165 __ASSERT_DEBUG( aIndex < KVideoControlCount, |
|
166 User::Panic(_L("Dialer"), KErrArgument) ); |
|
167 return &iVideoWindow; |
|
168 } |
|
169 |
|
170 // --------------------------------------------------------------------------- |
|
171 // CDialerVideoContainer::Draw |
|
172 // |
|
173 // --------------------------------------------------------------------------- |
|
174 // |
|
175 void CDialerVideoContainer::Draw( const TRect& /*aRect */) const |
|
176 { |
|
177 CWindowGc& gc = SystemGc( ); |
|
178 gc.SetBrushColor( AKN_LAF_COLOR( 0 /** White - get from layout */ )); |
|
179 TRect rect = Rect(); |
|
180 |
|
181 // Draw the skin background of the parent |
|
182 AknsDrawUtils::DrawBackground( AknsUtils::SkinInstance(), |
|
183 AknsDrawUtils::ControlContextOfParent(this), this, gc, |
|
184 rect.iTl, rect, KAknsDrawParamDefault ); |
|
185 |
|
186 gc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
187 } |
|
188 |
|
189 // End of File |