codhandler/codeng/inc/DrmHandler.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 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 the License "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:  Declaration of class CDrmHandler.   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DRM_HANDLER_H
       
    20 #define DRM_HANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <DRMRightsClient.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 class DRMCommon;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 * DRM handler.
       
    35 * This class is a container for DRM-related class objects and also provides
       
    36 * the cleanup. The content itself is processed as any other (non-DRM) content,
       
    37 * by CodEngBase.
       
    38 */
       
    39 NONSHARABLE_CLASS( CDrmHandler ): public CBase
       
    40     {
       
    41     public:     // Constructors and destructor.
       
    42 
       
    43         /**
       
    44         * Two phased constructor. Leaves on failure.
       
    45         * @param aFname File name.
       
    46         * @return The created object.
       
    47         */      
       
    48         static CDrmHandler* NewL( const TDesC& aFname );
       
    49 
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         ~CDrmHandler();
       
    54 
       
    55     public:     // new methods
       
    56 
       
    57         /**
       
    58         * Cleanup DRM rights.
       
    59         * This is to be called if RO received but install-notify failed.
       
    60         */
       
    61         void Cleanup();
       
    62 
       
    63         /**
       
    64         * Get MIME type (of content inside DCF).
       
    65         * @return Type inside DCF.
       
    66         */
       
    67         TPtrC8 Type() const;
       
    68 
       
    69     private:    // Constructors and destructor.
       
    70 
       
    71         /**
       
    72         * Constructor.
       
    73         */
       
    74         CDrmHandler();
       
    75 
       
    76         /**
       
    77         * Second phase constructor. Leaves on failure.
       
    78         * @param aFname File name.
       
    79         */
       
    80         void ConstructL( const TDesC& aFname );
       
    81 
       
    82     private:    // new methods
       
    83     
       
    84         /**
       
    85         * Check if MIME type aType is supported by DRM Engine; leave with
       
    86         * KMimeNotSupported if not. (Can leave with general failures as well).
       
    87         * @param aType Content type to check.
       
    88         */
       
    89         void CheckTypeL( const TDataType& aType ) const;
       
    90 
       
    91     private:    // data
       
    92 
       
    93         DRMCommon* iDrmCommon;          ///< DRM Engine or NULL. Owned.
       
    94         RDRMRightsClient iRightsClient; ///< DRM Rights Client. Owned.
       
    95         HBufC8* iContentUri;            ///< Content-URI or NULL. Owned.
       
    96         HBufC8* iType;                  ///< MIME type or NULL. Owned.
       
    97 
       
    98     };
       
    99 
       
   100 #endif /* def DRM_HANDLER_H */