diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/transaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/transaction.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Transaction +* +*/ + + +#ifndef C_TRANSACTION_H +#define C_TRANSACTION_H + +#include +#include +#include +#include "xnproperty.h" +#include "xnnodeappif.h" +#include "mtransaction.h" + + +namespace AiXmlUiController + { + class MTransactionElement; + class CTransactionElement; + class MTransactionFactory; + } + + +namespace AiXmlUiController +{ + +/** +* @ingroup group_xmluicontroller +* +* CTransaction collects the transaction elements of one transaction +* +* @lib AiXmlUiMain +*/ +class CTransaction : public CBase, public MTransaction + { +public: // Constructors and destructor + + static CTransaction* NewL(); + + virtual ~CTransaction(); + +// From MTransaction + + void Append(MTransactionElement& aElement); + + void CommitL(TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap); + + void Reset(MTransactionFactory& aFactory); + + TDblQueIter ElementIter(); + + +// New functions + + /** + * Returns the transaction id of this transaction + */ + TInt Id() const; + + /** + * Initializes transaction. + * @param aTxId transaction id. + */ + void Initialize(TInt aTxId); + + /** + * Returns the doubly linked list link offset. + */ + inline static TInt LinkOffset(); + + /** + * Returns the singly linked list link offset + */ + inline static TInt FactoryLinkOffset(); + + /** + * Deques this transaction from a doubly linked list + */ + void Deque(); + +private: + + CTransaction(); + +private: // Data + + /** + * Transaction identifier. + */ + TInt iTxId; + + /** + * Doubly linked list of transaction elements. + */ + TDblQue iTransactionElements; + + /** + * Doubly linked list link item. + */ + TDblQueLink iLink; + + /** + * Singly linked list link item. + */ + TSglQueLink iFactoryLink; + + }; + +// Inline implementations + +TInt CTransaction::LinkOffset() + { + return _FOFF(CTransaction, iLink); + } + +TInt CTransaction::FactoryLinkOffset() + { + return _FOFF(CTransaction, iFactoryLink); + } + +} // namespace AiXmlUiController + +#endif // C_TRANSACTION_H + +// End of File