mmfenh/enhancedmediaclient/Plugins/CacheSource/src/ReadWriteRequestAO.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:  header of ReadWriteRequestAO class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef READWRITEREQUESTAO_H
       
    20 #define READWRITEREQUESTAO_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 class CCacheSource; 
       
    26 class CMMFBuffer;
       
    27 class CMMFDataBuffer;
       
    28 
       
    29 /**
       
    30 *  Class to encapsulate a queue item.
       
    31 */
       
    32 class CReadWriteRequestAO : public CActive
       
    33     {
       
    34 
       
    35     public:  // Constructors and destructor
       
    36 
       
    37         enum TRequestType
       
    38             {
       
    39                 EReadRequest,
       
    40                 EWriteRequest
       
    41             };    
       
    42 
       
    43         static CReadWriteRequestAO* NewL(CCacheSource& aSource,TRequestType aType);
       
    44         virtual ~CReadWriteRequestAO();
       
    45         
       
    46         void SetActive();
       
    47         TInt Error();
       
    48         CMMFDataBuffer* Buffer();
       
    49         TRequestType RequestType();
       
    50         TInt SetBuffer(CMMFBuffer* aBuffer);
       
    51 
       
    52         
       
    53     protected:
       
    54         // From CActive
       
    55         void RunL();
       
    56         void DoCancel();
       
    57         TInt RunError( TInt aError );
       
    58         
       
    59     private:
       
    60         CReadWriteRequestAO( CCacheSource& aSource,TRequestType aType );
       
    61         void ConstructL();
       
    62         
       
    63     private:
       
    64         CCacheSource& iSource;
       
    65         CMMFBuffer* iBuffer;
       
    66         TRequestType iType;
       
    67         TInt iError;
       
    68     };
       
    69 
       
    70 
       
    71 #endif // READWRITEREQUESTAO_H
       
    72 
       
    73 // End of File