17 |
17 |
18 |
18 |
19 // INCLUDE FILES |
19 // INCLUDE FILES |
20 #include <AknDef.h> |
20 #include <AknDef.h> |
21 #include <aknview.h> |
21 #include <aknview.h> |
|
22 #include <brctlinterface.h> |
22 #include "wmdrmdlabrowserview.h" |
23 #include "wmdrmdlabrowserview.h" |
23 #include "wmdrmdlabrowsercontainer.h" |
24 #include "wmdrmdlabrowsercontainer.h" |
24 |
25 |
25 // ======== MEMBER FUNCTIONS ======== |
26 // ======== MEMBER FUNCTIONS ======== |
26 |
27 |
27 // --------------------------------------------------------------------------- |
28 // --------------------------------------------------------------------------- |
|
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 // --------------------------------------------------------------------------- |
28 // CWmDrmDlaBrowserContainer::CWmDrmDlaBrowserContainer |
65 // CWmDrmDlaBrowserContainer::CWmDrmDlaBrowserContainer |
29 // --------------------------------------------------------------------------- |
66 // --------------------------------------------------------------------------- |
30 // |
67 // |
31 CWmDrmDlaBrowserContainer::CWmDrmDlaBrowserContainer( |
68 CWmDrmDlaBrowserContainer::CWmDrmDlaBrowserContainer( |
32 CAknView* aView ) : iView( aView ) |
69 CAknView* aView ) : iView( aView ) |
33 { |
70 { |
34 } |
71 } |
35 |
72 |
36 // --------------------------------------------------------------------------- |
73 // --------------------------------------------------------------------------- |
|
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 // --------------------------------------------------------------------------- |
37 // CWmDrmDlaBrowserContainer::ComponentControl |
152 // CWmDrmDlaBrowserContainer::ComponentControl |
38 // --------------------------------------------------------------------------- |
153 // --------------------------------------------------------------------------- |
39 // |
154 // |
40 CCoeControl* CWmDrmDlaBrowserContainer::ComponentControl( |
155 CCoeControl* CWmDrmDlaBrowserContainer::ComponentControl( |
41 TInt aIndex ) const |
156 TInt aIndex ) const |
42 { |
157 { |
43 switch ( aIndex ) |
158 switch ( aIndex ) |
44 { |
159 { |
|
160 case 0: |
|
161 return iBrCtlInterface; |
|
162 |
45 default: |
163 default: |
46 return NULL; |
164 return NULL; |
47 } |
165 } |
48 } |
166 } |
49 |
167 |
50 // --------------------------------------------------------------------------- |
168 // --------------------------------------------------------------------------- |
|
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 // --------------------------------------------------------------------------- |
51 // CWmDrmDlaBrowserContainer::FocusChanged |
184 // CWmDrmDlaBrowserContainer::FocusChanged |
52 // --------------------------------------------------------------------------- |
185 // --------------------------------------------------------------------------- |
53 // |
186 // |
54 void CWmDrmDlaBrowserContainer::FocusChanged( |
187 void CWmDrmDlaBrowserContainer::FocusChanged( |
55 TDrawNow aDrawNow ) |
188 TDrawNow aDrawNow ) |
56 { |
189 { |
|
190 iBrCtlInterface->SetFocus( IsFocused() ); |
57 CCoeControl::FocusChanged( aDrawNow ); |
191 CCoeControl::FocusChanged( aDrawNow ); |
58 } |
192 } |
59 |
193 |
60 // --------------------------------------------------------------------------- |
194 // --------------------------------------------------------------------------- |
61 // CWmDrmDlaBrowserContainer::HandleResourceChange |
195 // CWmDrmDlaBrowserContainer::HandleResourceChange |
62 // --------------------------------------------------------------------------- |
196 // --------------------------------------------------------------------------- |
63 // |
197 // |
64 void CWmDrmDlaBrowserContainer::HandleResourceChange( |
198 void CWmDrmDlaBrowserContainer::HandleResourceChange( |
65 TInt aType ) |
199 TInt aType ) |
66 { |
200 { |
|
201 if ( iBrCtlInterface ) |
|
202 { |
|
203 iBrCtlInterface->HandleResourceChange( aType ); |
|
204 } |
67 CCoeControl::HandleResourceChange( aType ); |
205 CCoeControl::HandleResourceChange( aType ); |
68 if ( aType == KEikDynamicLayoutVariantSwitch ) |
206 if ( aType == KEikDynamicLayoutVariantSwitch ) |
69 { |
207 { |
70 SetRect( iView->ClientRect() ); |
208 SetRect( iView->ClientRect() ); |
71 DrawDeferred(); |
209 DrawDeferred(); |