idlehomescreen/xmluicontroller/inc/activetransactionstack.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Active transaction stack
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_ACTIVETRANSACTIONSTACK_H
       
    20 #define C_ACTIVETRANSACTIONSTACK_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 
       
    25 namespace AiXmlUiController
       
    26     {
       
    27     class MTransaction;
       
    28     class CTransaction;
       
    29     }
       
    30 
       
    31 
       
    32 namespace AiXmlUiController
       
    33 {
       
    34 
       
    35 /**
       
    36 *  @ingroup group_xmluicontroller
       
    37 * 
       
    38 *  CActiveTransactionStack is a stack for CTransactions
       
    39 *
       
    40 *  @lib AiXmlUiMain
       
    41 */
       
    42 class CActiveTransactionStack : public CBase
       
    43     {
       
    44 public:  // Constructors and destructor
       
    45     
       
    46     static CActiveTransactionStack* NewL();
       
    47     
       
    48     virtual ~CActiveTransactionStack();
       
    49 
       
    50     // New functions
       
    51     
       
    52     /**
       
    53     * Checks if stack is empty.
       
    54     * @return ETrue if stack is empty
       
    55     */
       
    56     TBool IsEmpty() const;
       
    57     
       
    58     /**
       
    59     * Pushes a transaction into the stack.
       
    60     * @param aTransaction the transaction
       
    61     */
       
    62     void Push( MTransaction* aTransaction );
       
    63     
       
    64     /**
       
    65     * Pops the topmost transaction from the stack.
       
    66     * @return the topmost transaction from the stack
       
    67     */
       
    68     MTransaction* Pop();
       
    69     
       
    70     /**
       
    71     * Returns the topmost transaction from the stack.
       
    72     * @return the topmost transaction from the stack
       
    73     */
       
    74     MTransaction* Top() const;
       
    75     
       
    76     /**
       
    77     * Lookups a transaction from the stack.
       
    78     * @param aTxId the transaction id of the transaction
       
    79     * @return the transaction with aTxId from the stack
       
    80     */
       
    81     MTransaction* Lookup( TInt aTxId ) const;
       
    82     
       
    83     /**
       
    84     * Removes a transaction from the stack.
       
    85     * @param aTxId the transaction id of the transaction
       
    86     * @return the transaction with aTxId from the stack
       
    87     */
       
    88     MTransaction* Remove( TInt aTxId );
       
    89     
       
    90 private:
       
    91 
       
    92     CActiveTransactionStack();
       
    93     
       
    94     CTransaction* DoTop() const;
       
    95     
       
    96     CTransaction* DoLookup( TInt aTxId ) const;
       
    97 
       
    98 private:    // Data
       
    99     
       
   100     /**
       
   101      * Doubly linked list of transactions
       
   102      */ 
       
   103     TDblQue< CTransaction > iTransactions;
       
   104     };
       
   105     
       
   106 } // namespace AiXmlUiController
       
   107 
       
   108 #endif      // C_ACTIVETRANSACTIONSTACK_H
       
   109            
       
   110 //  End of File