localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPObjectRequest.h
branchRCL_3
changeset 39 4096754ee773
parent 38 3dcb815346df
child 40 52a167391590
equal deleted inserted replaced
38:3dcb815346df 39:4096754ee773
     1 /*
       
     2 * Copyright (c) 2002 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:  GetReferencedObjects -operation controller
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BTSBPP_OBJECT_REQUEST_H
       
    21 #define BTSBPP_OBJECT_REQUEST_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <obex.h>   // Obex
       
    25 #include <badesca.h>// CDesCArray
       
    26 
       
    27 // CLASS DECLARATION
       
    28 /**
       
    29 *  A class handling GetReferencedObjects -operation.
       
    30 */
       
    31 NONSHARABLE_CLASS (CBTSBPPObjectRequest) : public CBase
       
    32     {
       
    33     public: // Constructors and destructor
       
    34         
       
    35         /**
       
    36         * Two-phased constructor.
       
    37         */
       
    38         static CBTSBPPObjectRequest* NewL( CObexBaseObject* aGetOperation,
       
    39                                            const CDesCArray* aRefObjectList );
       
    40         
       
    41         /**
       
    42         * Destructor.
       
    43         */
       
    44         virtual ~CBTSBPPObjectRequest();
       
    45 
       
    46     public: // Functions from base classes
       
    47 
       
    48         /**
       
    49         * Returns the requested Object.
       
    50         * @param None.
       
    51         * @return A pointer to the requested object. NULL if the request 
       
    52         *         cannot be fullfilled.
       
    53         */
       
    54         CObexBufObject* GetResponse();
       
    55 
       
    56     private:
       
    57 
       
    58         /**
       
    59         * C++ default constructor.
       
    60         */
       
    61         CBTSBPPObjectRequest( CObexBaseObject* aGetOperation,
       
    62                             const CDesCArray* aRefObjectList );
       
    63 
       
    64         /**
       
    65         * By default Symbian 2nd phase constructor is private.
       
    66         */
       
    67         void ConstructL();
       
    68 
       
    69         // CHECK REQUEST ------------------------------------------------------
       
    70 
       
    71         /**
       
    72         * Checks the validity of the Get-operation and it's parameters.
       
    73         * @return None.
       
    74         */
       
    75         void CheckGetRequestL();
       
    76 
       
    77         /**
       
    78         * Checks the existence, validity and contents of Type header.        
       
    79         * @return None.
       
    80         */
       
    81         void CheckTypeHeaderL();
       
    82 
       
    83         /**
       
    84         * Checks the existence, validity and contents of Name header.        
       
    85         * @return None.
       
    86         */
       
    87         void CheckNameHeaderL();
       
    88 
       
    89         /**
       
    90         * Checks the existence, validity and contents of 
       
    91         * Application Parameters header.        
       
    92         * @return None.
       
    93         */
       
    94         void CheckAppParamsHeaderL();
       
    95 
       
    96 
       
    97         // EXECUTE REQUEST ----------------------------------------------------
       
    98 
       
    99         /**
       
   100         * Executes any tasks needed and creates the requested object.        
       
   101         * @return None.
       
   102         */
       
   103         void ExecuteGetRequestL();
       
   104         
       
   105         /**
       
   106         * Resolves the actual part of data that is requested.
       
   107         * @return None.
       
   108         */
       
   109         void ResolveGetRequestL();
       
   110 
       
   111         /**
       
   112         * Reads the requested part of a file into a buffer.        
       
   113         * @return None.
       
   114         */
       
   115         void ReadFileToBufferL();
       
   116 
       
   117         /**
       
   118         * Creates the response object with correct data and headers.        
       
   119         * @return None.
       
   120         */
       
   121         void CreateResponseObjectL();
       
   122 
       
   123     private: // Data definitions
       
   124 
       
   125         struct TBTSBPPObjectParams
       
   126             {
       
   127             const TDesC* iName; // The name of the object.
       
   128             TInt  iFileSize; // The total size of the object.
       
   129             TInt  iOffset;   // The offset to the the object (starting point).
       
   130             TInt  iCount;    // The number of bytes to be sent.
       
   131             };
       
   132 
       
   133     private:    // Data
       
   134 
       
   135         RFs                     iFileSession;
       
   136         TBTSBPPObjectParams     iRequestParams;
       
   137         CObexBufObject*         iResponse;
       
   138         CBufFlat*               iResponseBuffer;
       
   139 
       
   140         // Not owned
       
   141         //
       
   142         CObexBaseObject*        iRequest;
       
   143         const CDesCArray*       iObjectList;
       
   144     };
       
   145 
       
   146 #endif      // BTSBPP_OBJECT_REQUEST_H
       
   147             
       
   148 // End of File