wvuing/wvuiave/AppSrc/CCARefreshView.cpp
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Main view class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include	"CCARefreshView.h"
       
    21 #include    "ChatDebugPrint.h"
       
    22 #include    "CCAEmptyControl.h"
       
    23 #include    "CCAUISessionManager.h"
       
    24 #include    "CAExternalInterface.h"
       
    25 
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CCARefreshView::~CCARefreshView
       
    31 // Destructor
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 CCARefreshView::~CCARefreshView()
       
    35     {
       
    36     delete iContainer;
       
    37     }
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CCARefreshView::CCARefreshView
       
    41 // Constructor
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CCARefreshView::CCARefreshView( TInt& aRefreshFlag )
       
    45         : iRefreshFlag( aRefreshFlag )
       
    46     {
       
    47     }
       
    48 
       
    49 
       
    50 // ---------------------------------------------------------
       
    51 // CCARefreshView::DoActivateL(
       
    52 //   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
       
    53 //   const TDesC8& /*aCustomMessage*/)
       
    54 // From CAknView, Gets called from framework when activating this view
       
    55 // (other items were commented in a header).
       
    56 // ---------------------------------------------------------
       
    57 //
       
    58 void CCARefreshView::DoActivateL(
       
    59     const TVwsViewId& aPrevViewId, TUid /*aCustomMessageId*/,
       
    60     const TDesC8& /*aCustomMessage*/ )
       
    61     {
       
    62     CHAT_DP_TXT( "CCARefreshView::DoActivateL" );
       
    63     iRefreshFlag = ETrue;
       
    64 
       
    65     iContainer = CCAEmptyControl::NewL( ClientRect() );
       
    66     iContainer->SetMopParent( this );
       
    67 
       
    68     AppUi()->AddToViewStackL( *this, iContainer );
       
    69 
       
    70     CAAppUi()->CaptureEventsL();
       
    71 
       
    72     TUid id;
       
    73 
       
    74     if ( aPrevViewId.iAppUid != CAAppUi()->Application()->AppDllUid() )
       
    75         {
       
    76         id = KUidFriendsListView;
       
    77         }
       
    78     else
       
    79         {
       
    80         id = CAAppUi()->AfterRefreshViewId( aPrevViewId.iViewUid );
       
    81         }
       
    82 
       
    83     CAViewSwitcher()->SwitchViewL( id );
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------
       
    87 // CCARefreshView::DoDeactivate()
       
    88 // From AknView, Gets called from framework when deactivating this view
       
    89 // (other items were commented in a header).
       
    90 // ---------------------------------------------------------
       
    91 //
       
    92 void CCARefreshView::DoDeactivate()
       
    93     {
       
    94     CHAT_DP_TXT( "CCARefreshView::DoDeactivate" );
       
    95     iRefreshFlag = EFalse;
       
    96 
       
    97     if ( iContainer )
       
    98         {
       
    99         AppUi()->RemoveFromViewStack( *this, iContainer );
       
   100         }
       
   101 
       
   102     delete iContainer;
       
   103     iContainer = NULL;
       
   104 
       
   105     TRAPD( err, CAAppUi()->ReleaseCapturingL() );
       
   106     if ( err != KErrNone )
       
   107         {
       
   108         CActiveScheduler::Current()->Error( err );
       
   109         }
       
   110     }
       
   111 
       
   112 
       
   113 // End of File
       
   114