150 } |
158 } |
151 |
159 |
152 // Store container. NULL is ok. |
160 // Store container. NULL is ok. |
153 iComponentContainer = aComponentContainer; |
161 iComponentContainer = aComponentContainer; |
154 |
162 |
155 // Set item size and position is needed here. |
163 if (iComponentContainer) |
156 TSize size = iItemPainter->Size(); |
164 { |
157 SetSizeL(size.iWidth, size.iHeight); |
165 // Set item size and position is needed here. |
158 TPoint position = iItemPainter->Position(); |
166 TSize size = iItemPainter->Size(); |
159 SetPosition(position.iX, position.iY); |
167 SetSizeL(size.iWidth, size.iHeight); |
160 |
168 TPoint position = iItemPainter->Position(); |
161 if (iUtils) |
169 SetPosition(position.iX, position.iY); |
162 { |
170 |
163 // Set canvas fullscreen size is needed here. |
171 if (iUtils) |
164 iItemPainter->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect()); |
172 { |
165 } |
173 // Set canvas fullscreen size is needed here. |
166 |
174 iItemPainter->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect()); |
|
175 } |
|
176 } |
167 DEBUG("CMIDCanvasGraphicsItem::SetParentL -"); |
177 DEBUG("CMIDCanvasGraphicsItem::SetParentL -"); |
168 } |
178 } |
169 |
179 |
170 // --------------------------------------------------------------------------- |
180 // --------------------------------------------------------------------------- |
171 // CMIDCanvasGraphicsItem::SetDirectContainerL |
181 // CMIDCanvasGraphicsItem::SetDirectContainerL |
314 // (other items are commented in the header file) |
324 // (other items are commented in the header file) |
315 // --------------------------------------------------------------------------- |
325 // --------------------------------------------------------------------------- |
316 // |
326 // |
317 void CMIDCanvasGraphicsItem::HandleFullscreenModeChange() |
327 void CMIDCanvasGraphicsItem::HandleFullscreenModeChange() |
318 { |
328 { |
319 // Calling all functions which set size and position. |
329 if (iUtils && iUtils->IsScalingEnabled()) |
|
330 { |
|
331 // We need reposition text editor. |
|
332 HandleChangeForScaling(EFullscreenChange); |
|
333 } |
|
334 } |
|
335 |
|
336 TBool CMIDCanvasGraphicsItem::IsScalingOn() const |
|
337 { |
|
338 return iUtils && iComponentContainer && iUtils->IsScalingEnabled() |
|
339 #ifdef RD_JAVA_S60_RELEASE_9_2 |
|
340 && !iPartialVKBOpen |
|
341 #endif // RD_JAVA_S60_RELEASE_9_2 |
|
342 && iComponentContainer->IsFullScreen(); |
|
343 } |
|
344 |
|
345 void CMIDCanvasGraphicsItem::HandleResourceChange(TInt aType) |
|
346 { |
|
347 #ifdef RD_JAVA_S60_RELEASE_9_2 |
|
348 if ((aType == KAknSplitInputEnabled) || |
|
349 (aType == KAknSplitInputDisabled)) |
|
350 { |
|
351 iPartialVKBOpen = (aType == KAknSplitInputEnabled); |
|
352 |
|
353 if (iUtils && iComponentContainer && iUtils->IsScalingEnabled() && |
|
354 iComponentContainer->IsFullScreen()) |
|
355 { |
|
356 // We need reposition text editor. |
|
357 HandleChangeForScaling(EPartialVKBChange); |
|
358 } |
|
359 } |
|
360 #endif // RD_JAVA_S60_RELEASE_9_2 |
|
361 |
|
362 if (KEikDynamicLayoutVariantSwitch) |
|
363 { |
|
364 if (iUtils && iComponentContainer && iUtils->IsScalingEnabled() && |
|
365 iComponentContainer->IsFullScreen()) |
|
366 { |
|
367 // We need reposition text editor. |
|
368 HandleChangeForScaling(EResolutionChange); |
|
369 } |
|
370 } |
|
371 } |
|
372 |
|
373 void CMIDCanvasGraphicsItem::HandleChangeForScaling(TChange aChange) |
|
374 { |
|
375 // Calling functions which set size and position. |
320 TRAPD(err, SetSizeL(iNonScaledSize.iWidth, iNonScaledSize.iHeight)); |
376 TRAPD(err, SetSizeL(iNonScaledSize.iWidth, iNonScaledSize.iHeight)); |
321 if (err != KErrNone) |
377 if (err != KErrNone) |
322 { |
378 { |
323 DEBUG_INT("CMIDCanvasGraphicsItem::HandleFullscreenModeChange: SetSizeL method leave with %d code", err); |
379 DEBUG_INT("CMIDCanvasGraphicsItem::HandleFullscreenModeChange: SetSizeL method leave with %d code", err); |
324 } |
380 } |
325 SetPosition(iNonScaledPosition.iX, iNonScaledPosition.iY); |
381 SetPosition(iNonScaledPosition.iX, iNonScaledPosition.iY); |
326 |
382 |
327 if (iUtils) |
383 if (aChange == EResolutionChange || aChange == EFullscreenChange) |
328 { |
384 { |
329 // Setting of fullscreen canvas rect. |
385 if (iUtils) |
330 iItemPainter->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect()); |
386 { |
331 } |
387 // Setting of fullscreen canvas rect. |
332 } |
388 iItemPainter->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect()); |
333 |
389 } |
334 // --------------------------------------------------------------------------- |
390 } |
335 // CMIDCanvasGraphicsItem::HandleResolutionChange |
391 |
336 // (other items are commented in the header file) |
392 #ifdef RD_JAVA_S60_RELEASE_9_2 |
337 // --------------------------------------------------------------------------- |
393 if (aChange == EPartialVKBChange) |
338 // |
394 { |
339 void CMIDCanvasGraphicsItem::HandleResolutionChange() |
395 if (iPartialVKBOpen) |
340 { |
396 { |
341 // Calling all functions which set size and position. |
397 // When partial VKB is opening, stop scaling. |
342 TRAPD(err, SetSizeL(iNonScaledSize.iWidth, iNonScaledSize.iHeight)); |
398 iItemPainter->SetOnScreenCanvasRect(iComponentContainer->Control().Rect()); |
343 if (err != KErrNone) |
399 } |
344 { |
400 else if (iUtils) |
345 DEBUG_INT("CMIDCanvasGraphicsItem::HandleFullscreenModeChange: SetSizeL method leave with %d code", err); |
401 { |
346 } |
402 // When partial VKB is closing, restore scaling. |
347 SetPosition(iNonScaledPosition.iX, iNonScaledPosition.iY); |
403 iItemPainter->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect()); |
348 if (iUtils) |
404 } |
349 { |
405 } |
350 // Setting of fullscreen canvas rect. |
406 #endif // RD_JAVA_S60_RELEASE_9_2 |
351 iItemPainter->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect()); |
|
352 } |
|
353 } |
|
354 |
|
355 TBool CMIDCanvasGraphicsItem::IsScalingOn() const |
|
356 { |
|
357 return iUtils && iComponentContainer && iUtils->IsScalingEnabled() && |
|
358 iComponentContainer->IsFullScreen(); |
|
359 } |
407 } |
360 |
408 |
361 // End of file |
409 // End of file |