idlehomescreen/xmluicontroller/inc/mtransaction.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 base class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_TRANSACTION_H
       
    20 #define M_TRANSACTION_H
       
    21 
       
    22 #include <e32hashtab.h>
       
    23 
       
    24 
       
    25 inline TUint32 NodeHash(const TAny* aPtr)
       
    26     {
       
    27     return (TUint32)aPtr;
       
    28     };
       
    29 
       
    30 inline TBool NodeRelation(const TAny* aPtr1, const TAny* aPtr2)
       
    31     {
       
    32     return aPtr1 == aPtr2;
       
    33     };
       
    34 
       
    35 // Default functions for xnnode type
       
    36 
       
    37 TEMPLATE_SPECIALIZATION class RHashTableBase::Defaults<
       
    38                                         CXnNodeAppIf,
       
    39                                         RHashTableBase::EDefaultSpecifier_Normal>
       
    40 	{
       
    41 public:
       
    42 	inline static TGeneralHashFunction32 Hash();
       
    43 	inline static TGeneralIdentityRelation Id();
       
    44 	};
       
    45 
       
    46 inline TGeneralHashFunction32 RHashTableBase::Defaults<
       
    47                                         CXnNodeAppIf,
       
    48                                         RHashTableBase::EDefaultSpecifier_Normal>::Hash()
       
    49 	{return (TGeneralHashFunction32)&NodeHash;}
       
    50 
       
    51 inline TGeneralIdentityRelation RHashTableBase::Defaults<
       
    52                                         CXnNodeAppIf,
       
    53                                         RHashTableBase::EDefaultSpecifier_Normal>::Id()
       
    54 	{return (TGeneralIdentityRelation)&NodeRelation;}
       
    55 
       
    56 	
       
    57 namespace AiXmlUiController
       
    58 {
       
    59     
       
    60 class CTransactionElement;
       
    61 class MTransactionElement;
       
    62 class MTransactionFactory;
       
    63 
       
    64 typedef RPointerArray<CXnProperty> RPropertyArray;
       
    65 
       
    66 typedef RPtrHashMap<CXnNodeAppIf, RPropertyArray> RPropertyHashMap;
       
    67 
       
    68 /**
       
    69  *  MTransaction represents a transaction of publish operations.
       
    70  *
       
    71  *  @lib AiXmlUiMain
       
    72  */
       
    73 class MTransaction
       
    74     {
       
    75 
       
    76 public:
       
    77 
       
    78     /**
       
    79      * Appends a transaction element in this transaction.
       
    80      *
       
    81      * @param aElement the transaction element
       
    82      */
       
    83     virtual void Append(MTransactionElement& aElement) = 0;
       
    84     
       
    85     /**
       
    86      * Commits this transaction by committing all transaction elements.
       
    87      *
       
    88      * @param [out] aLayoutChanged true if UI layout changes
       
    89      */
       
    90     virtual void CommitL( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) = 0;
       
    91     
       
    92     /**
       
    93      * Resets this transaction for reuse.
       
    94      *
       
    95      * @param aFactory the factory which created this transaction
       
    96      */
       
    97     virtual void Reset(MTransactionFactory& aFactory) = 0;
       
    98     
       
    99     virtual TDblQueIter<CTransactionElement> ElementIter() = 0;
       
   100 protected:
       
   101 
       
   102     ~MTransaction() {};
       
   103 
       
   104     };
       
   105 
       
   106 } // namespace AiXmlUiController
       
   107 
       
   108 #endif // M_UPDATETRANSACTION_H