mpx/commonframework/common/inc/mpxdrmmediaagent.h
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     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:  Media agent base class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMPXDRMMEDIAAGENT_H
       
    21 #define CMPXDRMMEDIAAGENT_H
       
    22 
       
    23 #include "mpxdrmmediautility.h"
       
    24 
       
    25 
       
    26 // DATA TYPES
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CMPXMedia;
       
    30 
       
    31 /**
       
    32 * CMPXDrmMediaAgent class declaration
       
    33 * 
       
    34 * @lib mpxcommon.lib
       
    35 * @since S60 3.1
       
    36 */
       
    37 NONSHARABLE_CLASS(CMPXDrmMediaAgent) : public CBase
       
    38     {
       
    39 public:     // New Functions
       
    40     /**
       
    41     *  Initialize using a filename
       
    42     *
       
    43     *  @param aFileName file name
       
    44     */
       
    45     virtual void InitL(const TDesC& aFileName) = 0;
       
    46 
       
    47     /**
       
    48     *  Initialize using a file handle
       
    49     *
       
    50     *  @param aFile file handle
       
    51     */
       
    52     virtual void InitL(RFile& aFile) = 0;
       
    53 
       
    54     /**
       
    55     *  Gets media object
       
    56     *
       
    57     *  @param aAttributes attributes to retreive
       
    58     *  @return CMPXMedia object with the specified attributes
       
    59     */
       
    60     virtual const CMPXMedia& GetMediaL(TUint aAttributes) = 0;
       
    61 
       
    62     /**
       
    63     *  Consumes the rights for the current media according
       
    64     *  to the specified consume type
       
    65     *
       
    66     *  @param aType Type of consumption to execute
       
    67     */
       
    68     virtual void ConsumeL(TDrmConsumeType aType) = 0;
       
    69     
       
    70     /**
       
    71     *  Closes and uninitializes the agent and cleans up member variables
       
    72     *
       
    73     *  @return void
       
    74     */
       
    75     virtual void Close();
       
    76 
       
    77 protected:    // New methods
       
    78     /**
       
    79     * Creates a new media object
       
    80     */
       
    81     virtual void CreateMediaL();
       
    82 
       
    83     /**
       
    84     * Gets the protected attribute if not already obtained
       
    85     */
       
    86     virtual void GetProtectedL();
       
    87 
       
    88 protected:    // Data
       
    89     CMPXMedia* iMedia;  // owned
       
    90     CData* iData;   // owned
       
    91     };
       
    92 
       
    93 #endif // CMPXDRMMEDIAAGENT_H