idlehomescreen/xmluicontroller/inc/databuffertransactionelement.h
branchRCL_3
changeset 34 5456b4e8b3a8
equal deleted inserted replaced
33:5f0182e07bfb 34:5456b4e8b3a8
       
     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:  Data buffer transaction
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_DATABUFFERTRANSACTIONELEMENT_H
       
    20 #define C_DATABUFFERTRANSACTIONELEMENT_H
       
    21 
       
    22 #include "transactionelement.h"
       
    23 
       
    24 namespace AiUtility
       
    25     {
       
    26     class CContentPriorityMap;
       
    27     }
       
    28 
       
    29 class CXnNodeAppIf;
       
    30 
       
    31 namespace AiXmlUiController
       
    32 {
       
    33 
       
    34 /**
       
    35  *  @ingroup group_xmluicontroller
       
    36  * 
       
    37  * CDataBufferTransactionElement corresponds one text content publishing operation.
       
    38  *
       
    39  *  @lib AiXmlUiMain
       
    40  */
       
    41 class CDataBufferTransactionElement : public CTransactionElement
       
    42     {
       
    43 public:  // Constructors and destructor
       
    44     
       
    45     static CDataBufferTransactionElement*
       
    46         NewL( AiUtility::CContentPriorityMap& aContentPriorityMap );
       
    47     
       
    48     virtual ~CDataBufferTransactionElement();
       
    49 
       
    50 // New functions
       
    51     
       
    52     /**
       
    53     * Initializes this transaction element to publish content aData
       
    54     * to node aTarget.
       
    55     *
       
    56     * @param aTarget - the target of publishing.
       
    57     * @param aData - the content. 
       
    58     */
       
    59     void InitializeL(CXnNodeAppIf& aTarget, const TDesC8& aData);
       
    60 
       
    61     /**
       
    62     * Initializes this transaction element to publish content aData
       
    63     * to node aTarget.
       
    64     *
       
    65     * @param aTarget - the target of publishing.
       
    66     * @param aData - the content. 
       
    67     * @param aCid - the content id.
       
    68     * @param aIndex - the content index.
       
    69     */    
       
    70     void InitializeL(CXnNodeAppIf& aTarget, const TDesC8& aData, 
       
    71         const TDesC& aCid, TInt aIndex);
       
    72     
       
    73     /**
       
    74      * Checks if given content type is supported by target ui element.
       
    75      *
       
    76      * @param aTarget target ui element.
       
    77      * @param aContentType content type
       
    78      * @return ETrue if content type is supported
       
    79      */
       
    80     static TBool IsSupported( CXnNodeAppIf& aTarget,
       
    81                               const TDesC8& aContentType );
       
    82     
       
    83 // Functions from CTransactionElement
       
    84 
       
    85     void Reset();
       
    86 
       
    87     void UpdateDataL();
       
    88     
       
    89 private:
       
    90 
       
    91     CDataBufferTransactionElement(
       
    92         AiUtility::CContentPriorityMap& aContentPriorityMap );
       
    93 
       
    94     void CheckTypeL( CXnNodeAppIf& aTarget );
       
    95     
       
    96     void SetDataL();
       
    97     
       
    98 private:    // Data
       
    99 
       
   100     /**
       
   101      * New content, owned.
       
   102      */
       
   103     HBufC8* iNewData;
       
   104     
       
   105     /**
       
   106      * Content id, owned.
       
   107      */
       
   108     HBufC* iCid;
       
   109     
       
   110     /*
       
   111      * Content index
       
   112      */
       
   113     TInt iIndex;
       
   114     };
       
   115 
       
   116 }   // namespace AiXmlUiController
       
   117 
       
   118 #endif      // C_TEXTTRANSACTIONELEMENT_H  
       
   119            
       
   120 //  End of File