ncdengine/inc/ncdfiledownloadoperation.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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:   File download operation interface definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_NCD_FILE_DOWNLOAD_OPERATION_H
       
    20 #define M_NCD_FILE_DOWNLOAD_OPERATION_H
       
    21 
       
    22 #include <e32cmn.h>
       
    23 
       
    24 #include "ncdoperation.h"
       
    25 #include "ncdinterfaceids.h"
       
    26 #include "ncdoperationdatatypes.h"
       
    27 
       
    28 class MNcdFileDownloadOperationObserver;
       
    29 
       
    30 /**
       
    31  *  File download operation interface.
       
    32  *
       
    33  *  A file download operation handles the downloading of one file to a
       
    34  *  specified location in the local filesystem.
       
    35  *
       
    36  *  
       
    37  *  @see MNcdFileDownloadOperationObserver
       
    38  */
       
    39 class MNcdFileDownloadOperation : public MNcdOperation
       
    40     {
       
    41     
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Unique identifier for the interface, required for all MCatalogsBase interfaces.
       
    46      *
       
    47      * 
       
    48      */
       
    49     enum { KInterfaceUid = ENcdFileDownloadOperationUid };
       
    50 
       
    51 
       
    52     /**
       
    53      * Get target file name.
       
    54      *
       
    55      * 
       
    56      * @returns Full path to target file. Empty string if the path has not
       
    57      *          been set.
       
    58      */
       
    59     virtual const TDesC& TargetFileName() const = 0;
       
    60 
       
    61 
       
    62     /**
       
    63      * Pause the download.
       
    64      *
       
    65      * @note Does nothing if the download was already paused, or if the
       
    66      *  operation is not yet started.
       
    67      *
       
    68      * 
       
    69      * @exception Leave System wide error code.
       
    70      */
       
    71     virtual void PauseL() = 0;
       
    72 
       
    73     /**
       
    74      * Resume a paused download.
       
    75      *
       
    76      * @note Does nothing if the download has not been paused, or if the
       
    77      *  operation is not yet started.
       
    78      *
       
    79      * 
       
    80      * @exception Leave System wide error code.
       
    81      */
       
    82     virtual void ResumeL() = 0;
       
    83 
       
    84     /**
       
    85      * Return the paused state of the download.
       
    86      *
       
    87      * 
       
    88      * @return ETrue, if the operation has been started and PauseL() has
       
    89      *  been called successfully, pausing the download. EFalse otherwise.
       
    90      */
       
    91     virtual TBool IsPaused() = 0;
       
    92 
       
    93 
       
    94     /**
       
    95      * Can download be paused
       
    96      *
       
    97      * @return ETrue if the operation can be paused, EFalse if pausing is not
       
    98      * allowed
       
    99      * @note Some DRM content is not pausable
       
   100      * @note Pausable state may change during the operation
       
   101      */
       
   102     virtual TBool IsPausableL() = 0;
       
   103 
       
   104 
       
   105     /**
       
   106      * Download data type getter
       
   107      *
       
   108      * @return Type of the data the operation is downloading
       
   109      * @see ncdoperationdatatypes.h
       
   110      */
       
   111     virtual TNcdDownloadDataType DownloadDataType() const = 0;
       
   112     
       
   113     
       
   114 protected:
       
   115 
       
   116     /**
       
   117      * Destructor.
       
   118      *
       
   119      * @see MCatalogsBase::~MCatalogsBase
       
   120      */
       
   121     virtual ~MNcdFileDownloadOperation() {}
       
   122 
       
   123     };
       
   124 
       
   125 	
       
   126 #endif //  M_NCD_FILE_DOWNLOAD_OPERATION_H