mpx/commonframework/common/inc/mpxdrmmediaomaagent.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:  OMA DRM media agent
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMPXDRMMEDIAOMAAGENT_H
       
    21 #define CMPXDRMMEDIAOMAAGENT_H
       
    22 
       
    23 #include "mpxdrmmediaagent.h"
       
    24 #ifdef CAMESE_IN_DRM_UTILITY
       
    25 #include <drmutilitytypes.h>
       
    26 #endif
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CMPXMedia;
       
    30 #ifdef CAMESE_IN_DRM_UTILITY
       
    31 class CDRMRightsConstraints;
       
    32 class DRMCommon;
       
    33 
       
    34 namespace DRM 
       
    35 	{
       
    36 	class CDrmUiHandling;
       
    37 	}
       
    38 #else
       
    39 class CDRMHelper;
       
    40 class CDRMHelperRightsConstraints;
       
    41 #endif
       
    42 
       
    43 /**
       
    44 * CMPXDrmMediaOmaAgent class declaration
       
    45 * 
       
    46 * @lib mpxcommon.lib
       
    47 * @since S60 3.1
       
    48 */
       
    49 NONSHARABLE_CLASS(CMPXDrmMediaOmaAgent) : public CMPXDrmMediaAgent
       
    50     {
       
    51 public:     // Constructors and Destructors
       
    52     /**
       
    53     *  Two-phase constructor
       
    54     *
       
    55     *  @return object created
       
    56     */
       
    57     static CMPXDrmMediaOmaAgent* NewL();
       
    58 
       
    59     /**
       
    60     *  Two-phase constructor
       
    61     *
       
    62     *  @return object created
       
    63     */
       
    64     static CMPXDrmMediaOmaAgent* NewLC();
       
    65 
       
    66     /**
       
    67     *  Destructor
       
    68     */
       
    69     virtual ~CMPXDrmMediaOmaAgent();
       
    70 
       
    71 public:     // New Functions
       
    72     /**
       
    73     *  From MMPXDrmMediaAgent
       
    74     *  Initialize using a filename
       
    75     *
       
    76     *  @param aFileName file name
       
    77     */
       
    78     void InitL(const TDesC& aFileName);
       
    79 
       
    80     /**
       
    81     *  From MMPXDrmMediaAgent
       
    82     *  Initialize using a file handle
       
    83     *
       
    84     *  @param aFile file handle
       
    85     */
       
    86     void InitL(RFile& aFile);
       
    87 
       
    88     /**
       
    89     *  From MMPXDrmMediaAgent
       
    90     *  Gets media object
       
    91     *
       
    92     *  @param aAttributes attributes to retreive
       
    93     *  @return CMPXMedia object with the specified attributes
       
    94     */
       
    95     const CMPXMedia& GetMediaL(TUint aAttributes);
       
    96 
       
    97     /**
       
    98     *  From MMPXDrmMediaAgent
       
    99     *  Consumes the rights for the current media according
       
   100     *  to the specified consume type
       
   101     *
       
   102     *  @param aType Type of consumption to execute
       
   103     */
       
   104     void ConsumeL(TDrmConsumeType aType);
       
   105 
       
   106     /**
       
   107     *  Closes and uninitializes the agent and cleans up member variables
       
   108     *
       
   109     *  @return void
       
   110     */
       
   111     void Close();
       
   112 
       
   113 private:    // Constructors
       
   114     /**
       
   115     *  C++ default constructor.
       
   116     */
       
   117     CMPXDrmMediaOmaAgent();
       
   118 
       
   119     /**
       
   120     * 2nd phase contructor
       
   121     */
       
   122     void ConstructL();
       
   123     
       
   124 private:    // New Functions
       
   125     /**
       
   126     * Creates a new media object
       
   127     */
       
   128     void CreateMediaL();
       
   129 
       
   130     /**
       
   131     * Gets the rights details
       
   132     */
       
   133     void GetRightsDetailsL();
       
   134 
       
   135     /**
       
   136     * Gets the rights type attribute if not already obtained
       
   137     */
       
   138     void GetRightsTypeL();
       
   139 
       
   140     /**
       
   141     * Gets the count attribute if not already obtained
       
   142     */
       
   143     void GetCountL();
       
   144 
       
   145     /**
       
   146     * Gets the start time attribute if not already obtained
       
   147     */
       
   148     void GetStartTimeL();
       
   149 
       
   150     /**
       
   151     * Gets the end time attribute if not already obtained
       
   152     */
       
   153     void GetEndTimeL();
       
   154 
       
   155     /**
       
   156     * Gets the interval attribute if not already obtained
       
   157     */
       
   158     void GetIntervalL();
       
   159 
       
   160     /**
       
   161     * Gets the interval start time attribute if not already obtained
       
   162     */
       
   163     void GetIntervalStartTimeL();
       
   164 
       
   165     /**
       
   166     * Gets the accumlated time attribute if not already obtained
       
   167     */
       
   168     void GetAccumulatedTimeL();
       
   169 
       
   170     /**
       
   171     * Gets the can set automated attribute if not already obtained
       
   172     */
       
   173     void GetCanSetAutomatedL();
       
   174 
       
   175     /**
       
   176     * Gets the info url attribute if not already obtained
       
   177     */
       
   178     void GetHasInfoUrlL();
       
   179 
       
   180     /**
       
   181     * Gets the preview url attribute if not already obtained
       
   182     */
       
   183     void GetHasPreviewUrlL();
       
   184     
       
   185     /**
       
   186     * Gets whether the DRM object is about to expire or not
       
   187     */
       
   188     void GetAboutToExpireL();
       
   189 
       
   190 private:    // Data
       
   191 #ifdef CAMESE_IN_DRM_UTILITY
       
   192     DRM::CDrmUiHandling* iDrmHandler;       // owned
       
   193     DRMCommon* iDRMCommon;					// owned
       
   194     CDRMRightsConstraints* iRightsConstraints;    // owned
       
   195 #else
       
   196     CDRMHelper* iDrmHelper; // owned
       
   197     CDRMHelperRightsConstraints* iRightsConstraints;    // owned
       
   198 #endif
       
   199 
       
   200     RFile iFile;    // owned (duplicate)
       
   201     RFs iFs;
       
   202     };
       
   203 
       
   204 
       
   205 #endif // CMPXDRMMEDIAOMAAGENT_H