ncdengine/provider/client/inc/ncdfiledownloadoperationproxy.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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_NCDFILEDOWNLOADOPERATIONPROXY_H	
       
    20 #define C_NCDFILEDOWNLOADOPERATIONPROXY_H
       
    21 
       
    22 #include "ncdbaseoperationproxy.h"
       
    23 #include "ncdfiledownloadoperation.h"
       
    24 #include "ncdoperationimpl.h"
       
    25 
       
    26 class MNcdFileDownloadOperationObserver;
       
    27 class CNcdNodeProxy;
       
    28 
       
    29 class CNcdFileDownloadOperationProxy : 
       
    30     public CNcdOperation< MNcdFileDownloadOperation >
       
    31     {
       
    32 public:
       
    33 
       
    34     /**
       
    35      * Constructor
       
    36      *
       
    37      * @param aSession is the session that is used between
       
    38      *                 the proxy and the server.
       
    39      * @param aHandle is the handle that identifies the serverside
       
    40      *                object that this proxy uses.
       
    41      * @param aRemoveHandler An observer that is called during destruction.
       
    42      * @param aNode The node this operation was started from.
       
    43      */    
       
    44     static CNcdFileDownloadOperationProxy* NewL( MCatalogsClientServer& aSession,
       
    45                         TInt aHandle,
       
    46                         MNcdOperationProxyRemoveHandler* aRemoveHandler,
       
    47                         CNcdNodeProxy* aNode,
       
    48                         CNcdNodeManagerProxy* aNodeManager,
       
    49                         const TDesC& aTargetFilename,
       
    50                         MNcdFileDownloadOperationObserver* aObserver,
       
    51                         TNcdDownloadDataType aDataType );
       
    52     /**
       
    53      * Constructor
       
    54      *
       
    55      * @param aSession is the session that is used between
       
    56      *                 the proxy and the server.
       
    57      * @param aHandle is the handle that identifies the serverside
       
    58      *                object that this proxy uses.
       
    59      * @param aRemoveHandler An observer that is called during destruction.
       
    60      * @param aNode The node this operation was started from.
       
    61      */
       
    62     static CNcdFileDownloadOperationProxy* NewLC(  MCatalogsClientServer& aSession,
       
    63                         TInt aHandle,
       
    64                         MNcdOperationProxyRemoveHandler* aRemoveHandler,
       
    65                         CNcdNodeProxy* aNode,
       
    66                         CNcdNodeManagerProxy* aNodeManager,
       
    67                         const TDesC& aTargetFilename,
       
    68                         MNcdFileDownloadOperationObserver* aObserver,
       
    69                         TNcdDownloadDataType aDataType );
       
    70 
       
    71         
       
    72 public: // From MNcdFileDownloadOperation
       
    73     
       
    74     /**
       
    75      * @see MNcdFileDownloadOperation::TargetFileName()
       
    76      */    
       
    77     const TDesC& TargetFileName() const;
       
    78         
       
    79     /**
       
    80      * @see MNcdFileDownloadOperation::PauseL()
       
    81      */
       
    82     void PauseL();
       
    83 
       
    84 
       
    85     /**
       
    86      * @see MNcdFileDownloadOperation::ResumeL()
       
    87      */
       
    88     void ResumeL();
       
    89 
       
    90 
       
    91     /**
       
    92      * @see MNcdFileDownloadOperation::IsPaused()
       
    93      */
       
    94     TBool IsPaused();
       
    95 
       
    96 
       
    97     /**
       
    98      * @see MNcdDownloadOperation::IsPausableL()
       
    99      */
       
   100     TBool IsPausableL();
       
   101   
       
   102   
       
   103     /**
       
   104      * @see MNcdFileDownloadOperation::DownloadDataType()
       
   105      */
       
   106     TNcdDownloadDataType DownloadDataType() const;
       
   107 
       
   108 
       
   109 public: // From MNcdOperation
       
   110 
       
   111     /**
       
   112      * @see MNcdOperation::OperationType()
       
   113      */
       
   114     TNcdInterfaceId OperationType() const;
       
   115     
       
   116 
       
   117 protected: // Constructor and destructor
       
   118 
       
   119     /**
       
   120      * Constructor
       
   121      *
       
   122      */
       
   123     CNcdFileDownloadOperationProxy( TNcdDownloadDataType aDataType );
       
   124     
       
   125     virtual ~CNcdFileDownloadOperationProxy();
       
   126 
       
   127 
       
   128     /**
       
   129      * ConstructL
       
   130      *
       
   131      * @param aSession is the session that is used between
       
   132      *                 the proxy and the server.
       
   133      * @param aHandle is the handle that identifies the serverside
       
   134      *                object that this proxy uses.
       
   135      * @param aRemoveHandler An observer that is called during destruction.
       
   136      * @param aNode The node this operation was started from.
       
   137      */         
       
   138     void ConstructL( MCatalogsClientServer& aSession,
       
   139         TInt aHandle,
       
   140         MNcdOperationProxyRemoveHandler* aRemoveHandler,
       
   141         CNcdNodeProxy* aNode,
       
   142         CNcdNodeManagerProxy* aNodeManager,
       
   143         MNcdFileDownloadOperationObserver* aObserver,
       
   144         const TDesC& aTargetFilename );
       
   145     
       
   146     
       
   147 protected: // From CNcdBaseOperationProxy
       
   148 
       
   149     /**
       
   150      * @see CNcdBaseOperationProxy::ProgressCallback()
       
   151      */
       
   152     void ProgressCallback();
       
   153     
       
   154     
       
   155     /**
       
   156      * @see CNcdBaseOperationProxy::QueryReceivedCallback()
       
   157      */
       
   158     void QueryReceivedCallback( CNcdQuery* aQuery );
       
   159     
       
   160     
       
   161     /**
       
   162      * @see CNcdBaseOperationProxy::CompleteCallback()
       
   163      */
       
   164     void CompleteCallback( TInt aError );
       
   165     
       
   166 
       
   167     /**
       
   168      * @see CNcdBaseOperationProxy::CreateInitializationBufferL()
       
   169      */    
       
   170     HBufC8* CreateInitializationBufferL();
       
   171     
       
   172     
       
   173     /**
       
   174      * @see CNcdBaseOperationProxy::InitializationCallback()    
       
   175      */
       
   176     void InitializationCallback( RReadStream& aReadStream, 
       
   177         TInt aDataLength );    
       
   178     
       
   179     
       
   180 private: // data
       
   181 
       
   182     /**
       
   183      * Operation observer, for callbacks.
       
   184      * Observer not own.
       
   185      */    
       
   186     MNcdFileDownloadOperationObserver* iObserver;
       
   187     
       
   188     // Name of the target file      
       
   189     HBufC* iTargetFilename;
       
   190     
       
   191     // Pause-state of the download
       
   192     TBool iIsPaused;
       
   193     
       
   194     TNcdDownloadDataType iDataType;
       
   195 
       
   196     };
       
   197 
       
   198 #endif // C_NCDFILEDOWNLOADOPERATIONPROXY_H