upnpmediaserver/contentdirectoryservice/inc/upnpfiletransfer.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /** @file
       
     2 * Copyright (c) 2005-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:  Implements th upnpfiletransfer class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CUPNPFILETRANSFER_H
       
    21 #define C_CUPNPFILETRANSFER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 
       
    26 #include "upnpcons.h"
       
    27 #include "upnphttpmessage.h" 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CUpnpFileTransferEvent;
       
    31 
       
    32 
       
    33 /**
       
    34 *  Storage Struct for file transfer
       
    35 *
       
    36 *  @lib ContentDirectory
       
    37 *  @since Series 60 2.6
       
    38 */
       
    39 class CUpnpFileTransfer: public CBase
       
    40 {
       
    41 public:
       
    42 //transfer type
       
    43 enum TTransferType
       
    44     {
       
    45     EImport, 
       
    46     EExport,
       
    47     EUpload
       
    48     };
       
    49 
       
    50 public:
       
    51     // Constructors and destructor
       
    52     
       
    53     /**
       
    54     * Two-phased constructor. returns a pointer to the new element.    
       
    55     */
       
    56     static CUpnpFileTransfer* NewL(TInt aTransferId, TInt aObjectId, TTransferType aType);
       
    57     
       
    58     /**
       
    59     * Two-phased constructor. returns a pointer to the new element.    
       
    60     */
       
    61     static CUpnpFileTransfer* NewLC(TInt aTransferId, TInt aObjectId, TTransferType aType);
       
    62 
       
    63     /**
       
    64     * Destructor. Deletes the element from memory. 
       
    65     */
       
    66     virtual ~CUpnpFileTransfer();
       
    67     
       
    68     TTransferStatus TransferState( );
       
    69     
       
    70     void SetTransferState(TTransferStatus aState);
       
    71     
       
    72     TInt ImportNumber();
       
    73     
       
    74     void SetImportNumber(TInt aNum);
       
    75     
       
    76     TInt TransferLength();
       
    77     
       
    78     void SetTransferLength(TInt aLen);
       
    79     
       
    80     TInt TransferTotal();
       
    81     
       
    82     void SetTransferTotal(TInt aTotal);
       
    83     
       
    84     TTransferType TransferType();
       
    85     
       
    86     TInt ObjectId();
       
    87     
       
    88     CUpnpFileTransferEvent* Event();
       
    89     
       
    90     void SetEvent(CUpnpFileTransferEvent* aEvent);
       
    91     
       
    92     CUpnpFileTransferEvent* RemoveEvent();
       
    93     
       
    94     TInt TransferId();
       
    95     
       
    96     
       
    97 private:
       
    98 
       
    99     /**
       
   100     * C++ default constructor.
       
   101     */
       
   102     CUpnpFileTransfer(TInt aTransferId, TInt aObjectId, TTransferType aType);
       
   103     
       
   104     void ConstructL();    
       
   105 
       
   106 public:
       
   107     // Data
       
   108     
       
   109     // Transfer Id
       
   110     TInt         iTransferId;
       
   111 
       
   112     // Transfer state
       
   113     TTransferStatus iTransferState;
       
   114     
       
   115     //
       
   116     TBool        iRemove;
       
   117     
       
   118     // used for checking if file transfer is Import (GET)
       
   119     // or Export (POST). iGet is ETrue if transfer was Import
       
   120     TBool        iGet;
       
   121     
       
   122     TTransferType iType;
       
   123     
       
   124     // last number in Import uri to match HTTP 200 OK with Import uri
       
   125     // number
       
   126     TInt         iImportNumber;
       
   127     
       
   128     TInt         iTransferLength;
       
   129     TInt         iTransferTotal;
       
   130     // Object id
       
   131     TInt         iObjectId;
       
   132     
       
   133     CUpnpFileTransferEvent* iEvent;
       
   134     
       
   135 };
       
   136 
       
   137 #endif      // C_CUPNPFILETRANSFER_H   
       
   138         
       
   139 // End of File