ncdengine/provider/server/inc/ncdrightsobjectoperationimpl.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_NCD_RIGHTS_OBJECT_OPERATION_H
       
    20 #define C_NCD_RIGHTS_OBJECT_OPERATION_H
       
    21 
       
    22 #include "ncdbaseoperation.h"
       
    23 #include "ncdoperationobserver.h"
       
    24 #include "catalogsconnectionmethod.h"
       
    25 
       
    26 class MNcdInstallationService;
       
    27 class CNcdDescriptorDownloadSubOperation;
       
    28 class TNcdConnectionMethod;
       
    29 
       
    30 /** 
       
    31  * DRM rights object download & install operation
       
    32  *
       
    33  */
       
    34 class CNcdRightsObjectOperation : public CNcdBaseOperation
       
    35     {
       
    36 public:
       
    37     
       
    38     /**
       
    39      * NewL
       
    40      *
       
    41      * @param aHttpSession HTTP session used for creating download operations
       
    42      *
       
    43      * @note Preferably the HTTP session has suitable defaults but if not then
       
    44      * Config() can be used to retrieve and change the settings for the download.
       
    45      * @note At least the access point must be set to the configuration. Target path
       
    46      *  is ignored (rights object is downloaded to memory only).
       
    47      */
       
    48     static CNcdRightsObjectOperation* NewL(
       
    49         CNcdGeneralManager& aGeneralManager,
       
    50         const TDesC& aDownloadUri,
       
    51         const TDesC& aMimeType,
       
    52         const TNcdConnectionMethod& aMethod,
       
    53         MNcdOperationRemoveHandler& aRemoveHandler, 
       
    54         MCatalogsHttpSession& aHttpSession,
       
    55         MCatalogsSession& aSession );
       
    56 
       
    57     
       
    58     /**
       
    59      * Destructor
       
    60      */
       
    61     ~CNcdRightsObjectOperation();
       
    62     
       
    63 public: // New methods
       
    64 
       
    65     /** 
       
    66      * HTTP configuration getter
       
    67      */
       
    68     MCatalogsHttpConfig& Config();
       
    69     
       
    70     
       
    71 public: // From CNcdBaseOperation
       
    72 
       
    73     /**
       
    74      * @see CNcdBaseOperation::Cancel()
       
    75      */
       
    76     void Cancel();
       
    77         
       
    78 
       
    79 public:  // from MNcdOperationObserver
       
    80 
       
    81     void Progress( CNcdBaseOperation& aOperation );
       
    82     
       
    83     void QueryReceived( CNcdBaseOperation& aOperation,
       
    84                         CNcdQuery* aQuery );
       
    85 
       
    86     void OperationComplete( CNcdBaseOperation* aOperation,
       
    87                             TInt aError );
       
    88 
       
    89 protected: // From CNcdBaseOperation
       
    90 
       
    91     /**
       
    92      * @see CNcdBaseOperation::RunOperation()
       
    93      */
       
    94     TInt RunOperation();        
       
    95     
       
    96     
       
    97 protected:
       
    98 
       
    99     // Constructor
       
   100     CNcdRightsObjectOperation(
       
   101         CNcdGeneralManager& aGeneralManager,
       
   102         MNcdOperationRemoveHandler& aRemoveHandler, 
       
   103         MCatalogsHttpSession& aHttpSession,
       
   104         MCatalogsSession& aSession );
       
   105         
       
   106     void ConstructL(
       
   107         const TNcdConnectionMethod& aMethod,
       
   108         const TDesC& aDownloadUri,
       
   109         const TDesC& aMimeType );
       
   110     
       
   111         
       
   112 private:
       
   113 
       
   114     MCatalogsHttpSession& iHttpSession;    
       
   115 
       
   116     MNcdInstallationService* iInstallationService;
       
   117     CNcdDescriptorDownloadSubOperation* iDownloadOp;
       
   118 
       
   119     HBufC8* iMimeType;
       
   120     TCatalogsConnectionMethod iConnectionMethod;
       
   121     };
       
   122 
       
   123 #endif // C_NCD_RIGHTS_OBJECT_OPERATION_H