mmfenh/enhancedmediaclient/Plugins/DataBufferSource/src/SourceQueueItem.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  This file contains definitions of the queue item class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef SOURCEQUEUEITEM_H
       
    21 #define SOURCEQUEUEITEM_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 class TMMFMessage;
       
    27 
       
    28 /**
       
    29 *  Class to encapsulate a queue item.
       
    30 *
       
    31 *  @lib S60StreamingSource.lib
       
    32 *  @since 3.0
       
    33 */
       
    34 class CSourceQueueItem : public CBase
       
    35     {
       
    36     public:  // Constructors and destructor
       
    37         
       
    38              /**
       
    39              * Two-phased constructor.
       
    40         */
       
    41         static CSourceQueueItem* NewL( TMMFMessage& aMessage );
       
    42         
       
    43         /**
       
    44         * Destructor.
       
    45         */
       
    46         virtual ~CSourceQueueItem();
       
    47         
       
    48         /**
       
    49         * Used to set the Message Status when completing the Message.
       
    50         * @since Series 60 3.1
       
    51         * @param status ErrorCode to be sent back when completing the message
       
    52         */
       
    53         void CompleteMessage( TInt status );
       
    54         
       
    55         TInt DataSize();
       
    56         TInt ReadData(TDes8 &aDes);
       
    57         TBool IsLastBuffer();
       
    58         TUint GetBufferSequenceNumber();
       
    59         
       
    60     private:
       
    61         
       
    62     /**
       
    63     * C++ default constructor.
       
    64         */
       
    65         CSourceQueueItem();
       
    66         
       
    67         /**
       
    68         * Construct a queue item object and initialize it with
       
    69         * @param aDataBuffer Buffer containing data
       
    70         */
       
    71         void ConstructL( TMMFMessage& aMessage );
       
    72         
       
    73     public:
       
    74         // next item
       
    75         TSglQueLink* iLink;
       
    76         
       
    77     private:
       
    78         // Message to complete when this buffer item is processed
       
    79         TMMFMessage* iMessage;
       
    80         TBool iLastBuffer; // streaming data last buffer indicator
       
    81         TUint iBufferSeqNum; // buffer sequence number
       
    82         
       
    83         // Definition used only in function CSourceQueueItem::ConstructL
       
    84         struct DataBufferAttributesStruct
       
    85             {
       
    86             TBool iLastBuffer; // streaming data last buffer indicator
       
    87             TUint iBufferSeqNum; // buffer sequence number
       
    88             };
       
    89        
       
    90     };
       
    91 
       
    92 #endif      // SOURCEQUEUEITEM_H
       
    93 
       
    94 // End of File