equal
deleted
inserted
replaced
52 // |
52 // |
53 // |
53 // |
54 // |
54 // |
55 // ---------------------------------------------------------------------------- |
55 // ---------------------------------------------------------------------------- |
56 // |
56 // |
57 CWidgetClient* CWidgetClient::NewL(MWidgetCallback& aWidgetCallback, |
57 CWidgetClient* CWidgetClient::NewL( MWidgetCallback& aWidgetCallback, |
58 MWidgetEngineCallbacks& aWidgetEngineCallback, |
58 MJSObjectProtector* protector, |
59 WidgetPreferences* preferences) |
59 MWidgetEngineCallbacks& aWidgetEngineCallback, |
|
60 WidgetPreferences* preferences |
|
61 ) |
60 { |
62 { |
61 CWidgetClient* self = new ( ELeave ) CWidgetClient(aWidgetCallback, aWidgetEngineCallback, preferences); |
63 CWidgetClient* self = new ( ELeave ) CWidgetClient(aWidgetCallback, aWidgetEngineCallback, preferences); |
62 CleanupStack::PushL( self ); |
64 CleanupStack::PushL( self ); |
63 self->ConstructL(aWidgetEngineCallback); |
65 self->ConstructL(aWidgetEngineCallback, protector); |
64 CleanupStack::Pop(); |
66 CleanupStack::Pop(); |
65 return self; |
67 return self; |
66 } |
68 } |
67 |
69 |
68 // ---------------------------------------------------------------------------- |
70 // ---------------------------------------------------------------------------- |
90 // |
92 // |
91 // ---------------------------------------------------------------------------- |
93 // ---------------------------------------------------------------------------- |
92 // |
94 // |
93 CWidgetClient::~CWidgetClient() |
95 CWidgetClient::~CWidgetClient() |
94 { |
96 { |
95 if (m_jswidget) { |
|
96 KJS::Collector::unprotect(m_jswidget); |
|
97 } |
|
98 |
|
99 delete m_renderer; |
97 delete m_renderer; |
100 } |
98 } |
101 |
99 |
102 |
100 |
103 // ---------------------------------------------------------------------------- |
101 // ---------------------------------------------------------------------------- |
105 // |
103 // |
106 // |
104 // |
107 // |
105 // |
108 // ---------------------------------------------------------------------------- |
106 // ---------------------------------------------------------------------------- |
109 // |
107 // |
110 void CWidgetClient::ConstructL(MWidgetEngineCallbacks& aWidgetEngineCallback) |
108 void CWidgetClient::ConstructL(MWidgetEngineCallbacks& aWidgetEngineCallback, MJSObjectProtector* protector) |
111 { |
109 { |
112 m_jswidget = new KJS::JSWidget(this); |
110 m_jswidget = new KJS::JSWidget(this, protector); |
113 m_renderer = new (ELeave) WidgetRenderer(aWidgetEngineCallback); |
111 m_renderer = new (ELeave) WidgetRenderer(aWidgetEngineCallback); |
114 KJS::Collector::protect(m_jswidget); |
|
115 } |
112 } |
116 |
113 |
117 |
114 |
118 // ---------------------------------------------------------------------------- |
115 // ---------------------------------------------------------------------------- |
119 // CWidgetClient::OnShowSelected |
116 // CWidgetClient::OnShowSelected |
278 { |
275 { |
279 m_widgetenginecallback->setTabbednavigation(!aEnable); |
276 m_widgetenginecallback->setTabbednavigation(!aEnable); |
280 } |
277 } |
281 |
278 |
282 // ---------------------------------------------------------------------------- |
279 // ---------------------------------------------------------------------------- |
|
280 // CWidgetClient::setNavigationType |
|
281 // |
|
282 // |
|
283 // |
|
284 // ---------------------------------------------------------------------------- |
|
285 // |
|
286 void CWidgetClient::setNavigationType( const TDesC& aType ) |
|
287 { |
|
288 m_widgetenginecallback->setNavigationType(aType); |
|
289 } |
|
290 |
|
291 // ---------------------------------------------------------------------------- |
283 // CWidgetClient::prepareForTransition |
292 // CWidgetClient::prepareForTransition |
284 // |
293 // |
285 // |
294 // |
286 // |
295 // |
287 // ---------------------------------------------------------------------------- |
296 // ---------------------------------------------------------------------------- |
308 // |
317 // |
309 // |
318 // |
310 // |
319 // |
311 // ---------------------------------------------------------------------------- |
320 // ---------------------------------------------------------------------------- |
312 // |
321 // |
313 TInt CWidgetClient::preferenceForKey( const TDesC& aKey, TPtrC& aValue ) |
322 TInt CWidgetClient::preferenceForKey( const TDesC& aKey, HBufC*& aValue ) |
314 { |
323 { |
315 TInt ret = KErrNotFound; |
324 TInt ret = KErrNotFound; |
316 TRAP_IGNORE( ret = m_preferences->preferenceL( aKey, aValue ) ); |
325 TRAP_IGNORE( ret = m_preferences->preferenceL( aKey, aValue ) ); |
317 return ret; |
326 return ret; |
318 } |
327 } |