68 #include <akntranseffect.h> |
69 #include <akntranseffect.h> |
69 #endif |
70 #endif |
70 #include <AknQueryDialog.h> |
71 #include <AknQueryDialog.h> |
71 #include <aknQueryControl.h> |
72 #include <aknQueryControl.h> |
72 #include <aknitemactionmenuregister.h> |
73 #include <aknitemactionmenuregister.h> |
|
74 #include <layoutmetadata.cdl.h> |
73 |
75 |
74 #include "akncbacontentobserver.h" |
76 #include "akncbacontentobserver.h" |
75 #include "akntrace.h" |
77 #include "akntrace.h" |
76 |
78 |
77 TBool IsBlankScreenDisplayed(); |
79 TBool IsBlankScreenDisplayed(); |
847 EXPORT_C void CEikDialog::SetSizeAndPosition(const TSize& aSize) |
849 EXPORT_C void CEikDialog::SetSizeAndPosition(const TSize& aSize) |
848 { |
850 { |
849 _AKNTRACE_FUNC_ENTER; |
851 _AKNTRACE_FUNC_ENTER; |
850 if (iDialogFlags&EEikDialogFlagFillAppClientRect) |
852 if (iDialogFlags&EEikDialogFlagFillAppClientRect) |
851 { |
853 { |
|
854 TRect destRect = iEikonEnv->EikAppUi()->ClientRect(); |
852 // if this is a view app then ask client rect from the currently active view |
855 // if this is a view app then ask client rect from the currently active view |
853 TVwsViewId uid; |
856 TVwsViewId uid; |
854 if ( iAvkonAppUi->GetActiveViewId( uid ) == KErrNone ) |
857 if ( iAvkonAppUi->GetActiveViewId( uid ) == KErrNone ) |
855 { |
858 { |
856 if ( uid.iAppUid != uid.iViewUid ) |
859 if ( uid.iAppUid != uid.iViewUid ) |
857 { |
860 { |
858 CAknView* view = iAvkonViewAppUi->View(uid.iViewUid); |
861 CAknView* view = iAvkonViewAppUi->View( uid.iViewUid ); |
859 if (view) |
862 if ( view ) |
860 { |
863 { |
861 SetRect(view->ClientRect()); |
864 destRect = view->ClientRect(); |
862 } |
|
863 else |
|
864 { |
|
865 SetRect(iEikonEnv->EikAppUi()->ClientRect()); |
|
866 } |
865 } |
867 } |
866 } |
868 else |
867 } |
|
868 |
|
869 if ( !Layout_Meta_Data::IsLandscapeOrientation() && iButtonGroupContainer != NULL ) |
|
870 { |
|
871 TRect controlPane; |
|
872 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EControlPane, controlPane ); |
|
873 |
|
874 if ( destRect.iBr.iY > controlPane.iTl.iY ) |
869 { |
875 { |
870 SetRect(iEikonEnv->EikAppUi()->ClientRect()); |
876 destRect.iBr.iY = controlPane.iTl.iY; |
871 } |
877 } |
872 } |
878 } |
873 else |
879 SetRect( destRect ); |
874 { |
880 } |
875 SetRect( iEikonEnv->EikAppUi()->ClientRect() ); |
|
876 } |
|
877 } |
|
878 else |
881 else |
879 { |
882 { |
880 SetRect( TRect( AknPopupUtils::Position( aSize, this ), aSize ) ); |
883 SetRect( TRect( AknPopupUtils::Position( aSize, this ), aSize ) ); |
881 } |
884 } |
882 _AKNTRACE_FUNC_EXIT; |
885 _AKNTRACE_FUNC_EXIT; |
1650 CAknTransitionUtils::SetAllParents(this); |
1653 CAknTransitionUtils::SetAllParents(this); |
1651 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
1654 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
1652 GfxTransEffect::NotifyExternalState(EInternalHandleSequence, (const TDesC8*)this); |
1655 GfxTransEffect::NotifyExternalState(EInternalHandleSequence, (const TDesC8*)this); |
1653 #endif |
1656 #endif |
1654 GfxTransEffect::Begin(this, KGfxControlAppearAction); |
1657 GfxTransEffect::Begin(this, KGfxControlAppearAction); |
|
1658 MTouchFeedback* feedback = NULL; |
|
1659 if(AknLayoutUtils::PenEnabled()) |
|
1660 { |
|
1661 feedback = static_cast<MTouchFeedback*>(ExtensionInterface(KExIfTactileFeedbackUid)); |
|
1662 } |
|
1663 if(feedback && CAknTransitionUtils::TransitionsEnabled(AknTransEffect::EComponentTransitionsOff )) |
|
1664 { |
|
1665 feedback->InstantFeedback(this, ETouchFeedbackIncreasingPopUp, |
|
1666 ETouchFeedbackVibra, TPointerEvent()); |
|
1667 } |
1655 GfxTransEffect::NotifyExternalState(ECaptureComponentsBegin, (const TDesC8*)this); |
1668 GfxTransEffect::NotifyExternalState(ECaptureComponentsBegin, (const TDesC8*)this); |
1656 |
1669 |
1657 TRect demarcation; |
1670 TRect demarcation; |
1658 CAknTransitionUtils::GetDemarcation(CAknTransitionUtils::EPopup, demarcation); |
1671 CAknTransitionUtils::GetDemarcation(CAknTransitionUtils::EPopup, demarcation); |
1659 GfxTransEffect::SetDemarcation(this, demarcation); |
1672 GfxTransEffect::SetDemarcation(this, demarcation); |
1662 CAknTransitionUtils::MakeVisibleSubComponents( this, |
1675 CAknTransitionUtils::MakeVisibleSubComponents( this, |
1663 CAknTransitionUtils::EAppearVisible ); |
1676 CAknTransitionUtils::EAppearVisible ); |
1664 |
1677 |
1665 GfxTransEffect::NotifyExternalState(ECaptureComponentsEnd, (const TDesC8*)this); |
1678 GfxTransEffect::NotifyExternalState(ECaptureComponentsEnd, (const TDesC8*)this); |
1666 GfxTransEffect::End(this); |
1679 GfxTransEffect::End(this); |
|
1680 if(feedback) |
|
1681 { |
|
1682 feedback->InstantFeedback(this, ETouchFeedbackPopUp, |
|
1683 ETouchFeedbackVibra, TPointerEvent()); |
|
1684 } |
1667 } |
1685 } |
1668 else |
1686 else |
1669 { |
1687 { |
1670 FadeBehindPopup(ETrue); |
1688 FadeBehindPopup(ETrue); |
1671 } |
1689 } |
1997 || aButtonId == EAknSoftkeyOk; |
2015 || aButtonId == EAknSoftkeyOk; |
1998 #endif |
2016 #endif |
1999 |
2017 |
2000 TBool effectTriggered = EFalse; |
2018 TBool effectTriggered = EFalse; |
2001 CAknAppUi* aknAppUi = static_cast<CAknAppUi*>(iEikonEnv->EikAppUi()); |
2019 CAknAppUi* aknAppUi = static_cast<CAknAppUi*>(iEikonEnv->EikAppUi()); |
2002 |
2020 |
|
2021 MTouchFeedback* feedback = NULL; |
|
2022 if(AknLayoutUtils::PenEnabled()) |
|
2023 { |
|
2024 feedback = static_cast<MTouchFeedback*>(ExtensionInterface(KExIfTactileFeedbackUid)); |
|
2025 } |
|
2026 |
2003 if (!(iDialogFlags & EEikDialogFlagDelayEffects) |
2027 if (!(iDialogFlags & EEikDialogFlagDelayEffects) |
2004 && IsFocusedWindowGroup( this ) |
2028 && IsFocusedWindowGroup( this ) |
2005 && GfxTransEffect::IsRegistered(this) && IsVisible() && effectButton |
2029 && GfxTransEffect::IsRegistered(this) && IsVisible() && effectButton |
2006 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
2030 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
2007 && !(iDialogFlags & EEikDialogFlagSleeping) |
2031 && !(iDialogFlags & EEikDialogFlagSleeping) |
2010 && !IsBlankScreenDisplayed() |
2034 && !IsBlankScreenDisplayed() |
2011 ) |
2035 ) |
2012 { |
2036 { |
2013 CAknTransitionUtils::SetAllParents(this); |
2037 CAknTransitionUtils::SetAllParents(this); |
2014 GfxTransEffect::Begin(this, KGfxControlDisappearAction); |
2038 GfxTransEffect::Begin(this, KGfxControlDisappearAction); |
|
2039 |
|
2040 if(feedback) |
|
2041 { |
|
2042 if(CAknTransitionUtils::TransitionsEnabled(AknTransEffect::EComponentTransitionsOff)) |
|
2043 { |
|
2044 feedback->InstantFeedback(this, ETouchFeedbackDecreasingPopUp, |
|
2045 ETouchFeedbackVibra, TPointerEvent()); |
|
2046 } |
|
2047 else |
|
2048 { |
|
2049 feedback->InstantFeedback(this, ETouchFeedbackPopUp, |
|
2050 ETouchFeedbackVibra, TPointerEvent()); |
|
2051 } |
|
2052 } |
|
2053 |
2015 GfxTransEffect::NotifyExternalState(ECaptureComponentsBegin, (const TDesC8*)this); |
2054 GfxTransEffect::NotifyExternalState(ECaptureComponentsBegin, (const TDesC8*)this); |
2016 TRect demarcation; |
2055 TRect demarcation; |
2017 CAknTransitionUtils::GetDemarcation(CAknTransitionUtils::EPopup, demarcation); |
2056 CAknTransitionUtils::GetDemarcation(CAknTransitionUtils::EPopup, demarcation); |
2018 GfxTransEffect::SetDemarcation(this, demarcation); |
2057 GfxTransEffect::SetDemarcation(this, demarcation); |
2019 effectTriggered = ETrue; |
2058 effectTriggered = ETrue; |
2078 ) |
2117 ) |
2079 { |
2118 { |
2080 TRect demarcation; |
2119 TRect demarcation; |
2081 CAknTransitionUtils::SetAllParents(this); |
2120 CAknTransitionUtils::SetAllParents(this); |
2082 GfxTransEffect::Begin(this, KGfxControlDisappearAction); |
2121 GfxTransEffect::Begin(this, KGfxControlDisappearAction); |
|
2122 |
|
2123 if(feedback) |
|
2124 { |
|
2125 if(CAknTransitionUtils::TransitionsEnabled(AknTransEffect::EComponentTransitionsOff)) |
|
2126 { |
|
2127 feedback->InstantFeedback(this, ETouchFeedbackDecreasingPopUp, |
|
2128 ETouchFeedbackVibra, TPointerEvent()); |
|
2129 } |
|
2130 else |
|
2131 { |
|
2132 feedback->InstantFeedback(this, ETouchFeedbackPopUp, |
|
2133 ETouchFeedbackVibra , TPointerEvent()); |
|
2134 } |
|
2135 } |
|
2136 |
2083 GfxTransEffect::NotifyExternalState(ECaptureComponentsBegin, (const TDesC8*)this); |
2137 GfxTransEffect::NotifyExternalState(ECaptureComponentsBegin, (const TDesC8*)this); |
2084 CAknTransitionUtils::GetDemarcation(CAknTransitionUtils::EPopup, demarcation); |
2138 CAknTransitionUtils::GetDemarcation(CAknTransitionUtils::EPopup, demarcation); |
2085 GfxTransEffect::SetDemarcation(this, demarcation); |
2139 GfxTransEffect::SetDemarcation(this, demarcation); |
2086 effectTriggered = ETrue; |
2140 effectTriggered = ETrue; |
2087 } |
2141 } |
3239 { |
3293 { |
3240 // Check that dialog is constructed and actually with embedded |
3294 // Check that dialog is constructed and actually with embedded |
3241 // softkeys |
3295 // softkeys |
3242 if ( iExtension && CbaEmbeddedInDialog( iDialogFlags ) ) |
3296 if ( iExtension && CbaEmbeddedInDialog( iDialogFlags ) ) |
3243 { |
3297 { |
3244 TSize dialogSize( Rect().Size() ); |
3298 TRect oldDialogRect( Rect() ); |
|
3299 TSize dialogSize( oldDialogRect.Size() ); |
3245 CEikCba* cba = static_cast<CEikCba*>( |
3300 CEikCba* cba = static_cast<CEikCba*>( |
3246 iButtonGroupContainer->ButtonGroup() ); |
3301 iButtonGroupContainer->ButtonGroup() ); |
3247 TBool cbaVisible( cba->IsVisible() && !cba->IsEmpty() ); |
3302 TBool cbaVisible( cba->IsVisible() && !cba->IsEmpty() ); |
3248 |
3303 |
3249 TRect screenRect; |
3304 TRect screenRect; |
3264 else |
3319 else |
3265 { |
3320 { |
3266 dialogSize.iHeight -= cbaRect.Rect().Height(); |
3321 dialogSize.iHeight -= cbaRect.Rect().Height(); |
3267 } |
3322 } |
3268 |
3323 |
3269 SetRect( TRect( |
3324 TRect newDialogRect( AknPopupUtils::Position( dialogSize, cbaVisible ), |
3270 AknPopupUtils::Position( dialogSize, this ), dialogSize ) ); |
3325 dialogSize ); |
|
3326 SetRect( newDialogRect ); |
|
3327 |
|
3328 if ( oldDialogRect != newDialogRect ) |
|
3329 { |
|
3330 DrawDeferred(); |
|
3331 } |
3271 } |
3332 } |
3272 } |
3333 } |
3273 |
3334 |
3274 |
3335 |
3275 TInt CEikDialog::HandleEmbeddedSoftkeyStateChangeCallBack( TAny* aAny ) |
3336 TInt CEikDialog::HandleEmbeddedSoftkeyStateChangeCallBack( TAny* aAny ) |