1931 Extension()->StartDelayedExit(); |
1931 Extension()->StartDelayedExit(); |
1932 _AKNTRACE("CEikDialog::TryExitL return with delayedExit"); |
1932 _AKNTRACE("CEikDialog::TryExitL return with delayedExit"); |
1933 return; |
1933 return; |
1934 } |
1934 } |
1935 |
1935 |
1936 TBool needToCheckExit = ETrue; |
1936 TBool effectTriggered = EFalse; |
1937 |
1937 |
1938 if (aButtonId != EEikBidCancel) |
|
1939 { |
|
1940 PrepareForFocusTransitionL(); |
|
1941 } |
|
1942 else if (!(iDialogFlags & EEikDialogFlagNotifyEsc)) |
|
1943 { |
|
1944 needToCheckExit = EFalse; |
|
1945 } |
|
1946 |
|
1947 if (needToCheckExit) |
|
1948 { |
|
1949 if (!OkToExitL(aButtonId)) |
|
1950 { |
|
1951 _AKNTRACE("CEikDialog::TryExitL return with OkToExitL false"); |
|
1952 return; |
|
1953 } |
|
1954 |
|
1955 if (aButtonId != EEikBidCancel) |
|
1956 { |
|
1957 GetAutoValues(); |
|
1958 } |
|
1959 } |
|
1960 |
|
1961 if (iExitConfirmed) |
|
1962 { |
|
1963 *iExitConfirmed = (MappedCommandId(aButtonId) == EEikBidCancel) ? 0 : aButtonId; |
|
1964 } |
|
1965 // Remove content observer in order to prevent unnecessary layout |
|
1966 // calculations in dialog shutdown. |
|
1967 EnableContentObserver(EFalse); |
|
1968 |
|
1969 if (iDialogFlags & EEikDialogFlagSleeping) |
|
1970 { |
|
1971 ExitSleepingDialog(); |
|
1972 } |
|
1973 else |
|
1974 { |
|
1975 // Trigger the transition effects for the exiting dialog. |
|
1976 CAknAppUi* aknAppUi = static_cast<CAknAppUi*>(iEikonEnv->EikAppUi()); |
|
1977 TBool effectButton = aButtonId == EEikBidCancel |
1938 TBool effectButton = aButtonId == EEikBidCancel |
1978 || aButtonId == EAknSoftkeyExit |
1939 || aButtonId == EAknSoftkeyExit |
1979 || aButtonId == EAknSoftkeyBack |
1940 || aButtonId == EAknSoftkeyBack |
1980 || aButtonId == EAknSoftkeyNo; |
1941 || aButtonId == EAknSoftkeyNo; |
1981 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
1942 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
1982 effectButton = effectButton |
1943 effectButton = effectButton |
1983 || aButtonId == EAknSoftkeyClose |
1944 || aButtonId == EAknSoftkeyClose |
1984 || aButtonId == EAknSoftkeyDone; |
1945 || aButtonId == EAknSoftkeyDone |
|
1946 || aButtonId == EAknSoftkeyOk; |
1985 #endif |
1947 #endif |
1986 |
1948 CAknAppUi* aknAppUi = static_cast<CAknAppUi*>( iEikonEnv->EikAppUi() ); |
1987 if (GfxTransEffect::IsRegistered(this) && IsVisible() && effectButton |
1949 if (GfxTransEffect::IsRegistered(this) && IsVisible() && effectButton |
|
1950 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
|
1951 && !(iDialogFlags&EEikDialogFlagSleeping) |
|
1952 #endif |
1988 && (!aknAppUi->IsFullScreenApp() || aknAppUi->IsForeground()) |
1953 && (!aknAppUi->IsFullScreenApp() || aknAppUi->IsForeground()) |
1989 && !IsBlankScreenDisplayed()) |
1954 && !IsBlankScreenDisplayed() |
1990 { |
1955 ) |
1991 // Begin transition. |
1956 { |
1992 TRect demarcation; |
1957 CAknTransitionUtils::SetAllParents(this); |
1993 CAknTransitionUtils::SetAllParents(this); |
1958 GfxTransEffect::Begin(this, KGfxControlDisappearAction); |
1994 GfxTransEffect::Begin(this, KGfxControlDisappearAction); |
1959 GfxTransEffect::NotifyExternalState(ECaptureComponentsBegin, (const TDesC8*)this); |
1995 GfxTransEffect::NotifyExternalState(ECaptureComponentsBegin, (const TDesC8*)this); |
1960 TRect demarcation; |
1996 CAknTransitionUtils::GetDemarcation(CAknTransitionUtils::EPopup, demarcation); |
1961 CAknTransitionUtils::GetDemarcation(CAknTransitionUtils::EPopup, |
1997 GfxTransEffect::SetDemarcation(this, demarcation); |
1962 demarcation); |
1998 |
1963 GfxTransEffect::SetDemarcation(this, demarcation); |
1999 // End transiton. |
1964 effectTriggered = ETrue; |
2000 MakeVisible(EFalse); |
1965 } |
2001 CAknTransitionUtils::MakeVisibleSubComponents(this, |
1966 |
2002 CAknTransitionUtils::EForceInvisible); |
1967 if (aButtonId!=EEikBidCancel) |
2003 GfxTransEffect::NotifyExternalState(ECaptureComponentsEnd, (const TDesC8*)this); |
1968 PrepareForFocusTransitionL(); |
2004 GfxTransEffect::End(this); |
1969 else if (!(iDialogFlags&EEikDialogFlagNotifyEsc)) |
|
1970 goto finished; |
|
1971 if (!OkToExitL(aButtonId)) |
|
1972 { |
|
1973 if ( effectTriggered ) |
|
1974 { |
|
1975 GfxTransEffect::NotifyExternalState( ECaptureComponentsAbort, |
|
1976 ( const TDesC8* ) this ); |
|
1977 GfxTransEffect::Abort( this ); |
|
1978 } |
|
1979 _AKNTRACE_FUNC_EXIT; |
|
1980 return; |
|
1981 } |
|
1982 |
|
1983 if (aButtonId != EEikBidCancel) |
|
1984 GetAutoValues(); |
|
1985 finished: |
|
1986 if (iExitConfirmed) |
|
1987 *iExitConfirmed=((MappedCommandId( aButtonId ) ==EEikBidCancel)? 0: aButtonId); |
|
1988 |
|
1989 // Remove content observer in order to prevent unnecessary layout |
|
1990 // calculations in dialog shutdown. |
|
1991 EnableContentObserver( EFalse ); |
|
1992 |
|
1993 if (iDialogFlags&EEikDialogFlagSleeping) |
|
1994 ExitSleepingDialog(); |
|
1995 else |
|
1996 { |
|
1997 // Remove content observer in order to prevent unnecessary layout |
|
1998 // calculations in dialog shutdown. |
|
1999 EnableContentObserver( EFalse ); |
|
2000 |
|
2001 if ( effectTriggered ) |
|
2002 { |
|
2003 MakeVisible(EFalse); |
|
2004 CAknTransitionUtils::MakeVisibleSubComponents( this, |
|
2005 CAknTransitionUtils::EForceInvisible ); |
|
2006 |
|
2007 GfxTransEffect::NotifyExternalState(ECaptureComponentsEnd, (const TDesC8*)this); |
|
2008 GfxTransEffect::End(this); |
|
2009 } |
|
2010 else |
|
2011 { |
|
2012 MakeVisible(EFalse); |
|
2013 CAknTransitionUtils::MakeVisibleSubComponents( this, |
|
2014 CAknTransitionUtils::EForceInvisible ); |
|
2015 GfxTransEffect::NotifyExternalState( ECaptureComponentsAbort, |
|
2016 ( const TDesC8* ) this ); |
|
2017 GfxTransEffect::Abort(this); |
2005 } |
2018 } |
2006 delete(this); |
2019 delete(this); |
2007 } |
2020 } |
2008 _AKNTRACE_FUNC_EXIT; |
2021 _AKNTRACE_FUNC_EXIT; |
2009 } |
2022 } |