idlehomescreen/xmluicontroller/inc/transaction.h
changeset 0 f72a12da539e
child 88 3321d3e205b6
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:  Transaction
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_TRANSACTION_H
       
    20 #define C_TRANSACTION_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32cmn.h>
       
    24 #include <e32hashtab.h>
       
    25 #include "xnproperty.h"
       
    26 #include "xnnodeappif.h"
       
    27 #include "mtransaction.h"
       
    28 
       
    29 
       
    30 namespace AiXmlUiController
       
    31     {
       
    32     class MTransactionElement;
       
    33     class CTransactionElement;
       
    34     class MTransactionFactory;
       
    35     }
       
    36 
       
    37 
       
    38 namespace AiXmlUiController
       
    39 {
       
    40 
       
    41 /**
       
    42 *  @ingroup group_xmluicontroller
       
    43 * 
       
    44 *  CTransaction collects the transaction elements of one transaction
       
    45 *
       
    46 *  @lib AiXmlUiMain
       
    47 */
       
    48 class CTransaction : public CBase, public MTransaction
       
    49     {
       
    50 public:  // Constructors and destructor
       
    51     
       
    52     static CTransaction* NewL();
       
    53     
       
    54     virtual ~CTransaction();
       
    55 
       
    56 // From MTransaction
       
    57     
       
    58     void Append(MTransactionElement& aElement);
       
    59     
       
    60     void CommitL(TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap);
       
    61     
       
    62     void Reset(MTransactionFactory& aFactory);
       
    63     
       
    64     TDblQueIter<CTransactionElement> ElementIter();
       
    65 
       
    66     
       
    67 // New functions
       
    68     
       
    69     /**
       
    70      * Returns the transaction id of this transaction
       
    71      */
       
    72     TInt Id() const;
       
    73     
       
    74     /**
       
    75      * Initializes transaction.
       
    76      * @param aTxId transaction id.
       
    77      */
       
    78     void Initialize(TInt aTxId);
       
    79     
       
    80     /**
       
    81      * Returns the doubly linked list link offset.
       
    82      */
       
    83     inline static TInt LinkOffset();
       
    84     
       
    85     /**
       
    86      * Returns the singly linked list link offset
       
    87      */
       
    88     inline static TInt FactoryLinkOffset();
       
    89     
       
    90     /**
       
    91      * Deques this transaction from a doubly linked list
       
    92      */
       
    93     void Deque();
       
    94     
       
    95 private:
       
    96 
       
    97     CTransaction();
       
    98 
       
    99 private:    // Data
       
   100     
       
   101     /**
       
   102      * Transaction identifier.
       
   103      */
       
   104     TInt iTxId;
       
   105     
       
   106     /**
       
   107      * Doubly linked list of transaction elements.
       
   108      */
       
   109     TDblQue<CTransactionElement> iTransactionElements;
       
   110    
       
   111     /**
       
   112      * Doubly linked list link item.
       
   113      */
       
   114     TDblQueLink iLink;
       
   115     
       
   116     /**
       
   117      * Singly linked list link item.
       
   118      */
       
   119     TSglQueLink iFactoryLink;
       
   120         
       
   121     };
       
   122         
       
   123 // Inline implementations
       
   124 
       
   125 TInt CTransaction::LinkOffset()
       
   126     {
       
   127     return _FOFF(CTransaction, iLink);
       
   128     }
       
   129 
       
   130 TInt CTransaction::FactoryLinkOffset()
       
   131     {
       
   132     return _FOFF(CTransaction, iFactoryLink);
       
   133     }
       
   134 
       
   135 } // namespace AiXmlUiController
       
   136 
       
   137 #endif      // C_TRANSACTION_H 
       
   138            
       
   139 //  End of File