phonebookui/Phonebook/App/inc/CViewActivationTransactionImpl.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Phonebook transaction view implementation class methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CViewActivationTransactionImpl_H__
       
    21 #define __CViewActivationTransactionImpl_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include "CPbkAppUi.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CDigViewNode;
       
    28 class CAknTitlePane;
       
    29 class CAknContextPane;
       
    30 class CEikImage;
       
    31 class CAknNavigationDecorator;
       
    32 class CAknTabGroup;
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Transaction class for updating application-wide state leave-safely
       
    39  * at view switch.
       
    40  * @see CPbkAppUi::HandleViewActivationLC
       
    41  */
       
    42 class CPbkAppUi::CViewActivationTransactionImpl
       
    43         : public CPbkAppUiBase::CViewActivationTransaction
       
    44     {
       
    45     public:  // Interface
       
    46         /**
       
    47          * Creates an instace of this transaction, performs all update 
       
    48          * operations of this transaction and saves rollback data in case 
       
    49          * the transaction is not committed.
       
    50          *
       
    51          * @param aAppUi phonebook's application UI
       
    52          * @param aViewId activated view's id
       
    53          * @param aPrevViewId previously active view's id
       
    54          * @param aTitlePaneText text to put into title pane, if NULL
       
    55          *        default text is used
       
    56          * @param aContextPanePicture picture to put into context pane, if
       
    57          *        NULL default picture is used
       
    58          * @return instance of this class
       
    59          */
       
    60         static CViewActivationTransactionImpl* NewLC
       
    61             (CPbkAppUi& aAppUi, 
       
    62             const TUid& aViewId, const TVwsViewId& aPrevViewId,
       
    63             const TDesC* aTitlePaneText, 
       
    64             const CEikImage* aContextPanePicture,
       
    65             TUint aFlags);
       
    66 
       
    67         /**
       
    68          * Destructor. Rolls back changes done in NewLC if this transaction
       
    69          * is not committed.
       
    70          */
       
    71         ~CViewActivationTransactionImpl();
       
    72 
       
    73     public:  // From CViewActivationTransaction
       
    74         /**
       
    75          * Commits this transaction. After this call all changes done in
       
    76          * NewLC are kept.
       
    77          */
       
    78         void Commit();
       
    79 
       
    80     private:  // Implementation
       
    81 		CViewActivationTransactionImpl(CPbkAppUi& aAppUi, const TUid& aViewId,
       
    82 			const TVwsViewId& aPrevViewId, TUint aFlags);
       
    83 		void ConstructL(const TDesC* aTitlePaneText,
       
    84 			const CEikImage* aContextPanePicture);
       
    85         void UpdateViewNavigationState();
       
    86         void UpdateNaviPaneL(TUid aViewId);
       
    87         void SetTitlePaneTextL(const TDesC* aTitlePaneText);
       
    88         void SetContextPanePictureL(const CEikImage* aContextPanePicture);
       
    89         CEikImage* CopyL(const CEikImage& aSrc);
       
    90 
       
    91     private:  // Data
       
    92         /// Ref: Phonebook Application UI
       
    93         CPbkAppUi* iAppUi;
       
    94         /// Own: Activated view's id
       
    95         TUid iViewId;
       
    96         /// Own: Deactivated view's id
       
    97         TVwsViewId iPrevViewId;
       
    98         /// Own: flags
       
    99         TUint iFlags;
       
   100         /// Ref: Saved previous view node state
       
   101         CDigViewNode* iSavePreviousViewNode;
       
   102         /// Ref: Application's title pane
       
   103         CAknTitlePane* iTitlePane;
       
   104         /// Own: Saved title pane text
       
   105         HBufC* iSaveTitlePaneText;
       
   106         /// Ref: Application's context pane
       
   107         CAknContextPane* iContextPane;
       
   108         /// Own: Saved picture from context pane
       
   109         CEikImage* iSaveContextPanePicture;
       
   110         /// Ref: navigation decorator pushed on the navi pane, if NULL
       
   111         /// nothing was pushed.
       
   112         CAknNavigationDecorator* iPushedNaviDecorator;
       
   113         /// Ref: Modified tab group
       
   114         CAknTabGroup* iTabGroup;
       
   115         /// Own: Saved index of active tab in iTabGroup
       
   116         TInt iSaveTabIndex;
       
   117     };
       
   118 
       
   119 
       
   120 #endif // __CViewActivationTransactionImpl_H__
       
   121             
       
   122 // End of File