author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:21:16 +0100 | |
branch | RCL_3 |
changeset 27 | 1481bf457703 |
parent 26 | 1221b68b8a5f |
permissions | -rw-r--r-- |
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
27 | 2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Implementation class for WMDRM DLA Browser Container |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
// INCLUDE FILES |
12
8a03a285ab14
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
20 |
#include <AknDef.h> |
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <aknview.h> |
27 | 22 |
#include <brctlinterface.h> |
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include "wmdrmdlabrowserview.h" |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include "wmdrmdlabrowsercontainer.h" |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
|
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
// ======== MEMBER FUNCTIONS ======== |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
|
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
// --------------------------------------------------------------------------- |
27 | 29 |
// CWmDrmDlaBrowserContainer::ConstructL |
30 |
// --------------------------------------------------------------------------- |
|
31 |
// |
|
32 |
void CWmDrmDlaBrowserContainer::ConstructL( |
|
33 |
MBrCtlSpecialLoadObserver* aObserver ) |
|
34 |
{ |
|
35 |
CreateWindowL(); |
|
36 |
SetRect( iView->ClientRect() ); |
|
37 |
||
38 |
iBrCtlInterface = CreateBrowserControlL( |
|
39 |
this, // parent control |
|
40 |
iView->ClientRect(), // client rect |
|
41 |
TBrCtlDefs::ECapabilityLoadHttpFw | |
|
42 |
TBrCtlDefs::ECapabilityDisplayScrollBar | |
|
43 |
TBrCtlDefs::ECapabilityUseDlMgr | |
|
44 |
TBrCtlDefs::ECapabilityCursorNavigation, // Capabilities |
|
45 |
TBrCtlDefs::ECommandIdBase, // command base |
|
46 |
NULL, // Softkeys observer |
|
47 |
NULL, // LinkResolver |
|
48 |
aObserver, // Special load observer |
|
49 |
NULL, // Layout Observer |
|
50 |
NULL, // Dialog provider |
|
51 |
NULL, // window observer |
|
52 |
NULL // Download observer |
|
53 |
); |
|
54 |
||
55 |
iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsAutoLoadImages, |
|
56 |
ETrue ); |
|
57 |
iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsCookiesEnabled, |
|
58 |
ETrue ); |
|
59 |
iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsEmbedded, |
|
60 |
ETrue ); |
|
61 |
ActivateL(); |
|
62 |
} |
|
63 |
||
64 |
// --------------------------------------------------------------------------- |
|
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
// CWmDrmDlaBrowserContainer::CWmDrmDlaBrowserContainer |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
// --------------------------------------------------------------------------- |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
// |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
CWmDrmDlaBrowserContainer::CWmDrmDlaBrowserContainer( |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
CAknView* aView ) : iView( aView ) |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
{ |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
} |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
|
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
// --------------------------------------------------------------------------- |
27 | 74 |
// CWmDrmDlaBrowserContainer::NewL |
75 |
// --------------------------------------------------------------------------- |
|
76 |
// |
|
77 |
CWmDrmDlaBrowserContainer* CWmDrmDlaBrowserContainer::NewL( |
|
78 |
CAknView* aView, |
|
79 |
MBrCtlSpecialLoadObserver* aObserver ) |
|
80 |
{ |
|
81 |
CWmDrmDlaBrowserContainer* self |
|
82 |
= CWmDrmDlaBrowserContainer::NewLC( aView, aObserver ); |
|
83 |
CleanupStack::Pop( self ); |
|
84 |
return self; |
|
85 |
} |
|
86 |
||
87 |
||
88 |
// --------------------------------------------------------------------------- |
|
89 |
// CWmDrmDlaBrowserContainer::NewLC |
|
90 |
// --------------------------------------------------------------------------- |
|
91 |
// |
|
92 |
CWmDrmDlaBrowserContainer* CWmDrmDlaBrowserContainer::NewLC( |
|
93 |
CAknView* aView, |
|
94 |
MBrCtlSpecialLoadObserver* aObserver ) |
|
95 |
{ |
|
96 |
CWmDrmDlaBrowserContainer* self |
|
97 |
= new( ELeave ) CWmDrmDlaBrowserContainer( aView ); |
|
98 |
CleanupStack::PushL( self ); |
|
99 |
self->ConstructL( aObserver ); |
|
100 |
return self; |
|
101 |
} |
|
102 |
||
103 |
||
104 |
// --------------------------------------------------------------------------- |
|
105 |
// CWmDrmDlaBrowserContainer::~CWmDrmDlaBrowserContainer |
|
106 |
// --------------------------------------------------------------------------- |
|
107 |
// |
|
108 |
CWmDrmDlaBrowserContainer::~CWmDrmDlaBrowserContainer() |
|
109 |
{ |
|
110 |
if(iBrCtlInterface != NULL) |
|
111 |
{ |
|
112 |
TRAP_IGNORE( iBrCtlInterface->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelFetch + (TInt)TBrCtlDefs::ECommandIdBase )); |
|
113 |
} |
|
114 |
delete iBrCtlInterface; |
|
115 |
} |
|
116 |
||
117 |
// --------------------------------------------------------------------------- |
|
118 |
// CWmDrmDlaBrowserContainer::BrCtlInterface |
|
119 |
// --------------------------------------------------------------------------- |
|
120 |
// |
|
121 |
CBrCtlInterface* CWmDrmDlaBrowserContainer::BrCtlInterface() |
|
122 |
{ |
|
123 |
return iBrCtlInterface; |
|
124 |
} |
|
125 |
||
126 |
// --------------------------------------------------------------------------- |
|
127 |
// CWmDrmDlaBrowserContainer::CountComponentControls |
|
128 |
// --------------------------------------------------------------------------- |
|
129 |
// |
|
130 |
TInt CWmDrmDlaBrowserContainer::CountComponentControls() const |
|
131 |
{ |
|
132 |
if ( iBrCtlInterface ) |
|
133 |
{ |
|
134 |
return 1; |
|
135 |
} |
|
136 |
return 0; |
|
137 |
} |
|
138 |
||
139 |
// --------------------------------------------------------------------------- |
|
140 |
// CWmDrmDlaBrowserContainer::SizeChanged |
|
141 |
// --------------------------------------------------------------------------- |
|
142 |
// |
|
143 |
void CWmDrmDlaBrowserContainer::SizeChanged() |
|
144 |
{ |
|
145 |
if ( iBrCtlInterface ) |
|
146 |
{ |
|
147 |
iBrCtlInterface->SetRect( Rect() ); |
|
148 |
} |
|
149 |
} |
|
150 |
||
151 |
// --------------------------------------------------------------------------- |
|
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
// CWmDrmDlaBrowserContainer::ComponentControl |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
// --------------------------------------------------------------------------- |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
// |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
CCoeControl* CWmDrmDlaBrowserContainer::ComponentControl( |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
TInt aIndex ) const |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
{ |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
switch ( aIndex ) |
12
8a03a285ab14
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
159 |
{ |
27 | 160 |
case 0: |
161 |
return iBrCtlInterface; |
|
162 |
||
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
default: |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
return NULL; |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
} |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
} |
12
8a03a285ab14
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
167 |
|
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
// --------------------------------------------------------------------------- |
27 | 169 |
// CWmDrmDlaBrowserContainer::OfferKeyEventL |
170 |
// --------------------------------------------------------------------------- |
|
171 |
// |
|
172 |
TKeyResponse CWmDrmDlaBrowserContainer::OfferKeyEventL( |
|
173 |
const TKeyEvent& aKeyEvent, |
|
174 |
TEventCode aType ) |
|
175 |
{ |
|
176 |
if ( iBrCtlInterface ) |
|
177 |
{ |
|
178 |
return iBrCtlInterface->OfferKeyEventL( aKeyEvent, aType ); |
|
179 |
} |
|
180 |
return EKeyWasNotConsumed; |
|
181 |
} |
|
182 |
||
183 |
// --------------------------------------------------------------------------- |
|
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
// CWmDrmDlaBrowserContainer::FocusChanged |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
// --------------------------------------------------------------------------- |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
// |
12
8a03a285ab14
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
187 |
void CWmDrmDlaBrowserContainer::FocusChanged( |
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
TDrawNow aDrawNow ) |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
{ |
27 | 190 |
iBrCtlInterface->SetFocus( IsFocused() ); |
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
CCoeControl::FocusChanged( aDrawNow ); |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
} |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
|
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
// --------------------------------------------------------------------------- |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
// CWmDrmDlaBrowserContainer::HandleResourceChange |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
// --------------------------------------------------------------------------- |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
197 |
// |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
void CWmDrmDlaBrowserContainer::HandleResourceChange( |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
TInt aType ) |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
{ |
27 | 201 |
if ( iBrCtlInterface ) |
202 |
{ |
|
203 |
iBrCtlInterface->HandleResourceChange( aType ); |
|
204 |
} |
|
0
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
205 |
CCoeControl::HandleResourceChange( aType ); |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
if ( aType == KEikDynamicLayoutVariantSwitch ) |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
{ |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
SetRect( iView->ClientRect() ); |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
DrawDeferred(); |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
} |
95b198f216e5
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
} |