44 #include <avkondomainpskeys.h> |
44 #include <avkondomainpskeys.h> |
45 #include <aknglobalpopupprioritycontroller.h> |
45 #include <aknglobalpopupprioritycontroller.h> |
46 #endif |
46 #endif |
47 |
47 |
48 #include <AknTasHook.h> // for testability hooks |
48 #include <AknTasHook.h> // for testability hooks |
|
49 #include "akntrace.h" |
49 const TInt EEikDialogFlagSleeping =0x20000; |
50 const TInt EEikDialogFlagSleeping =0x20000; |
50 |
51 |
51 // ----------------------------------------------------------------------------- |
52 // ----------------------------------------------------------------------------- |
52 // Finds out if this control belongs to the window group that is in focus. |
53 // Finds out if this control belongs to the window group that is in focus. |
53 // This information can be used to skip effects when the window group is |
54 // This information can be used to skip effects when the window group is |
179 ////////////////////////////////////////////////////////////////////// |
180 ////////////////////////////////////////////////////////////////////// |
180 |
181 |
181 EXPORT_C CAknNoteDialog::CAknNoteDialog() : CEikDialog(), |
182 EXPORT_C CAknNoteDialog::CAknNoteDialog() : CEikDialog(), |
182 iTimeoutInMicroseconds(ENoTimeout), iTone(ENoTone) |
183 iTimeoutInMicroseconds(ENoTimeout), iTone(ENoTone) |
183 { |
184 { |
|
185 _AKNTRACE_FUNC_ENTER; |
184 AKNTASHOOK_ADD( this, "CAknNoteDialog" ); |
186 AKNTASHOOK_ADD( this, "CAknNoteDialog" ); |
|
187 _AKNTRACE_FUNC_EXIT; |
185 } |
188 } |
186 |
189 |
187 EXPORT_C CAknNoteDialog::CAknNoteDialog(const TTone& aTone, const TTimeout& aTimeout) : |
190 EXPORT_C CAknNoteDialog::CAknNoteDialog(const TTone& aTone, const TTimeout& aTimeout) : |
188 CEikDialog(), iTimeoutInMicroseconds(aTimeout), iTone(aTone) |
191 CEikDialog(), iTimeoutInMicroseconds(aTimeout), iTone(aTone) |
189 { |
192 { |
|
193 _AKNTRACE_FUNC_ENTER; |
|
194 _AKNTRACE("iTimeoutInMicroseconds = %d", aTimeout); |
190 AKNTASHOOK_ADD( this, "CAknNoteDialog" ); |
195 AKNTASHOOK_ADD( this, "CAknNoteDialog" ); |
|
196 _AKNTRACE_FUNC_EXIT; |
191 } |
197 } |
192 |
198 |
193 EXPORT_C CAknNoteDialog::CAknNoteDialog(CEikDialog** aSelfPtr,const TTone& aTone, const TTimeout& aTimeout) : |
199 EXPORT_C CAknNoteDialog::CAknNoteDialog(CEikDialog** aSelfPtr,const TTone& aTone, const TTimeout& aTimeout) : |
194 CEikDialog(), iTimeoutInMicroseconds(aTimeout), iSelfPtr(aSelfPtr), iTone(aTone) |
200 CEikDialog(), iTimeoutInMicroseconds(aTimeout), iSelfPtr(aSelfPtr), iTone(aTone) |
195 { |
201 { |
|
202 _AKNTRACE_FUNC_ENTER; |
|
203 _AKNTRACE("iTimeoutInMicroseconds = %d", aTimeout); |
196 AKNTASHOOK_ADD( this, "CAknNoteDialog" ); |
204 AKNTASHOOK_ADD( this, "CAknNoteDialog" ); |
|
205 _AKNTRACE_FUNC_EXIT; |
197 } |
206 } |
198 |
207 |
199 EXPORT_C CAknNoteDialog::~CAknNoteDialog() |
208 EXPORT_C CAknNoteDialog::~CAknNoteDialog() |
200 { |
209 { |
|
210 _AKNTRACE_FUNC_ENTER; |
201 AKNTASHOOK_REMOVE(); |
211 AKNTASHOOK_REMOVE(); |
202 // FIXME: Experimental heuristics for determining popup type |
212 // FIXME: Experimental heuristics for determining popup type |
203 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
213 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
204 |
214 |
205 if ( GfxTransEffect::IsRegistered( this ) ) |
215 if ( GfxTransEffect::IsRegistered( this ) ) |
380 return EKeyWasConsumed; |
391 return EKeyWasConsumed; |
381 } |
392 } |
382 |
393 |
383 EXPORT_C void CAknNoteDialog::LayoutAndDraw() |
394 EXPORT_C void CAknNoteDialog::LayoutAndDraw() |
384 { |
395 { |
|
396 _AKNTRACE_FUNC_ENTER; |
385 if (IsActivated()) |
397 if (IsActivated()) |
386 { |
398 { |
387 TRect screenRect = iAvkonAppUi->ApplicationRect(); |
399 TRect screenRect = iAvkonAppUi->ApplicationRect(); |
388 SetSizeAndPosition(PreferredSize( screenRect.Size()/*TSize(AKN_LAYOUT_WINDOW_screen.iW,AKN_LAYOUT_WINDOW_screen.iH)*/)); |
400 SetSizeAndPosition(PreferredSize( screenRect.Size()/*TSize(AKN_LAYOUT_WINDOW_screen.iW,AKN_LAYOUT_WINDOW_screen.iH)*/)); |
389 DrawNow(); |
401 DrawNow(); |
395 { |
407 { |
396 RDebug::Print(_L("CAknNoteDialog allowing opt. draw, %d"), (TUint)this ); |
408 RDebug::Print(_L("CAknNoteDialog allowing opt. draw, %d"), (TUint)this ); |
397 attr->AllowOptimizedDrawing(); |
409 attr->AllowOptimizedDrawing(); |
398 } |
410 } |
399 } |
411 } |
|
412 _AKNTRACE_FUNC_EXIT; |
400 } |
413 } |
401 |
414 |
402 EXPORT_C TInt CAknNoteDialog::RunLD() |
415 EXPORT_C TInt CAknNoteDialog::RunLD() |
403 { |
416 { |
|
417 _AKNTRACE_FUNC_ENTER; |
404 PlayTone(); |
418 PlayTone(); |
405 ReportUserActivity(); |
419 ReportUserActivity(); |
406 |
420 |
407 // FIXME: Experimental heuristics for finding out popup context from image/animation |
421 // FIXME: Experimental heuristics for finding out popup context from image/animation |
408 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
422 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
412 { |
426 { |
413 GfxTransEffect::Register( this, TUid::Uid( uid ) ); |
427 GfxTransEffect::Register( this, TUid::Uid( uid ) ); |
414 CAknTransitionUtils::RemoveData( ( TInt )NoteControl() ); |
428 CAknTransitionUtils::RemoveData( ( TInt )NoteControl() ); |
415 } |
429 } |
416 #endif |
430 #endif |
417 |
431 |
|
432 _AKNTRACE_FUNC_EXIT; |
418 return CEikDialog::RunLD(); |
433 return CEikDialog::RunLD(); |
419 } |
434 } |
420 |
435 |
421 EXPORT_C TInt CAknNoteDialog::StaticDeleteL(TAny *aThis) |
436 EXPORT_C TInt CAknNoteDialog::StaticDeleteL(TAny *aThis) |
422 { |
437 { |
|
438 _AKNTRACE_FUNC_ENTER; |
423 CAknNoteDialog* self = REINTERPRET_CAST(CAknNoteDialog*,aThis); |
439 CAknNoteDialog* self = REINTERPRET_CAST(CAknNoteDialog*,aThis); |
424 |
440 |
425 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
441 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
426 if ( self->IsVisible() && GfxTransEffect::IsRegistered( self ) && |
442 if ( self->IsVisible() && GfxTransEffect::IsRegistered( self ) && |
427 IsFocusedWindowGroup( self ) ) |
443 IsFocusedWindowGroup( self ) ) |
476 self->iTimer->Cancel(); |
492 self->iTimer->Cancel(); |
477 self->OkToExitL(KErrCancel); |
493 self->OkToExitL(KErrCancel); |
478 self->ExitSleepingDialog(); |
494 self->ExitSleepingDialog(); |
479 self->NoteControl()->Reset(); |
495 self->NoteControl()->Reset(); |
480 } |
496 } |
|
497 _AKNTRACE_FUNC_EXIT; |
481 return EFalse; |
498 return EFalse; |
482 } |
499 } |
483 |
500 |
484 |
501 |
485 EXPORT_C void CAknNoteDialog::SetSizeAndPosition( const TSize& aSize ) |
502 EXPORT_C void CAknNoteDialog::SetSizeAndPosition( const TSize& aSize ) |
486 { |
503 { |
|
504 _AKNTRACE_FUNC_ENTER; |
487 SetBorder( TGulBorder::ENone ); |
505 SetBorder( TGulBorder::ENone ); |
488 CAknNoteControl* note = NoteControl(); |
506 CAknNoteControl* note = NoteControl(); |
489 if (note) |
507 if (note) |
490 { |
508 { |
491 if (!ControlAttributes()->IsLayoutNeeded()) // if we have a note control, there must be attributes also |
509 if (!ControlAttributes()->IsLayoutNeeded()) // if we have a note control, there must be attributes also |
829 //------------------------------------------------------------------------------ |
850 //------------------------------------------------------------------------------ |
830 // |
851 // |
831 |
852 |
832 EXPORT_C void CAknNoteDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
853 EXPORT_C void CAknNoteDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
833 { |
854 { |
|
855 _AKNTRACE_FUNC_ENTER; |
834 if ( AknLayoutUtils::PenEnabled() ) |
856 if ( AknLayoutUtils::PenEnabled() ) |
835 { |
857 { |
836 CCoeControl* ctrl = GrabbingComponent(); |
858 CCoeControl* ctrl = GrabbingComponent(); |
837 CCoeControl::HandlePointerEventL(aPointerEvent); |
859 CCoeControl::HandlePointerEventL(aPointerEvent); |
838 |
860 |