drm_plat/camese_utility_api/inc/CameseUtility.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Defines the entry point for the CameseUtility library.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMESEUTILITY_H
       
    20 #define CAMESEUTILITY_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CCameseEngine;
       
    27 class RConnection;
       
    28 class RFile;
       
    29 class MCameseObserver;
       
    30 
       
    31 /**
       
    32 * CCameseUtility
       
    33 *  Interface published by the Camese Utility library.
       
    34 *
       
    35 *  @lib CameseUtility.dll
       
    36 *  @since 5.0
       
    37 */
       
    38 NONSHARABLE_CLASS( CCameseUtility ) : public CBase
       
    39     {
       
    40     public:
       
    41         /**
       
    42          * Creates an new instance for license acquisition.
       
    43          * @param aObserver Observer interface to be notified on license 
       
    44          * acquisition states. If NULL then no notifications will be supplied 
       
    45          * (when handling the download result for example)
       
    46          * @return address of an instance of this class
       
    47          */
       
    48         IMPORT_C static CCameseUtility* NewL( MCameseObserver* aObserver = NULL );
       
    49 
       
    50 
       
    51         /**
       
    52          * Creates an new instance for license acquisition.
       
    53          * @param aIapNumber a IAP connection to use for communications.
       
    54          * @param aObserver Observer interface to be notified on license 
       
    55          * acquisition states. If NULL then no notifications will be supplied 
       
    56          * (when handling the download result for example)
       
    57          * @return address of an instance of this class
       
    58          */
       
    59         IMPORT_C static CCameseUtility* NewL( TInt aIapNumber, 
       
    60             MCameseObserver* aObserver = NULL );
       
    61 
       
    62 
       
    63         /** 
       
    64          * Creates an new instance for license acquisition.
       
    65          * @param aSockServHandle a socket server handle. If 0 a new socket 
       
    66          * server connection is created
       
    67          * @param aConnPtr a connection to use for communications. If NULL 
       
    68          * a new connection is created
       
    69          * @param aObserver Observer interface to be notified on license 
       
    70          * acquisition states. If NULL then no notifications will be supplied 
       
    71          * (when handling the download result for example)
       
    72          * @return address of an instance of this class
       
    73          */
       
    74         IMPORT_C static CCameseUtility* NewL( TInt aSockServHandle,
       
    75             RConnection* aConnPtr, MCameseObserver* aObserver = NULL );
       
    76 
       
    77 
       
    78         /**
       
    79          * Destructor
       
    80          */
       
    81         IMPORT_C virtual ~CCameseUtility();
       
    82 
       
    83 
       
    84         /**
       
    85          * Starts the license acquisition based on a specified DRM header.
       
    86          * @param aDrmHeader DRM header to use for license acquisition
       
    87          * @param aUrl Heap descriptor to populate with the content URL. 
       
    88          * Can be NULL.
       
    89          * @param aStatus Request status. On completion contains the error code
       
    90          */
       
    91         IMPORT_C void AcquireLicense( const TDesC8& aDrmHeader, HBufC8*& aUrl, 
       
    92             TRequestStatus& aStatus );
       
    93 
       
    94 
       
    95         /**
       
    96          * Starts the license acquisition based on a specified file handle.
       
    97          * @param aFileHandle a handle to the file for which the license is 
       
    98          * acquired.
       
    99          * @param aUrl Heap descriptor to populate with the Music Shop URL for 
       
   100          * non-silent acquisition or an error page. Can be NULL.
       
   101          * @param aStatus Request status. On completion contains the error code.
       
   102          */
       
   103         IMPORT_C void AcquireLicense( const RFile& aFileHandle, HBufC8*& aUrl, 
       
   104             TRequestStatus& aStatus );
       
   105 
       
   106 
       
   107         /**
       
   108          * Starts the license acquisition based on a specified file path.
       
   109          * @param aFileHandle a file handle to use for non-silent license 
       
   110          * acquisition
       
   111          * @param aLicenseResponse The license response sent by the license 
       
   112          * server in a non-silent post-delivery scenerio
       
   113          * @param aStatus Request status. On completion contains the error code.
       
   114          */
       
   115         IMPORT_C void AcquireLicense( const RFile& aFileHandle, 
       
   116             const TDesC8& aLicenseResponse, TRequestStatus& aStatus );
       
   117 
       
   118 
       
   119         /**
       
   120          * Sending the download result.
       
   121          * @param aContentUrl The URL to the Content Server where status 
       
   122          * should be reported.
       
   123          * @param aResult Symbian error code indicating the result of the 
       
   124          * content download operation
       
   125          * This will be converted to an HRESULT value before being sent to the 
       
   126          * Content Server.
       
   127          * @param aStatus Request status. On completion contains the error code.
       
   128          */
       
   129         IMPORT_C void SendDownloadResult(const TDesC8& aContentUrl, TInt aResult, 
       
   130             TRequestStatus& aStatus);
       
   131 
       
   132 
       
   133         /**
       
   134          * Cancels an existing asynchronous call.
       
   135          */
       
   136         IMPORT_C void Cancel();
       
   137 
       
   138 
       
   139         /**
       
   140          * Sets the IAP connection to use for communications.
       
   141          * @param aIapId The IAP connection that will be used
       
   142          */
       
   143         IMPORT_C void SetIapId( TInt aIapId );
       
   144 
       
   145     private:
       
   146         /**
       
   147          * Constructor
       
   148          */
       
   149         CCameseUtility();
       
   150 
       
   151 
       
   152         /**
       
   153          * Symbian OS 2nd phase constructor.
       
   154          */
       
   155         void ConstructL( TInt aIapNumber, MCameseObserver* aObserver );
       
   156 
       
   157     private:
       
   158         CCameseEngine* iEngine;
       
   159     };
       
   160 
       
   161 #endif  // CAMESEUTILITY_H
       
   162 
       
   163 // End of File