epoc32/include/mmf/common/mmfdrmcustomcommands.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 mmfdrmcustomcommands.h
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __MMF_DRM_CUSTOM_COMMANDS_H__
       
    17 #define __MMF_DRM_CUSTOM_COMMANDS_H__
       
    18 
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <mmf/common/mmcaf.h>
       
    22 #include <mmf/common/mmfstandardcustomcommands.h>
       
    23 
       
    24 
       
    25 /**
       
    26 @publishedAll
       
    27 @released
       
    28 */
       
    29 const TUid KUidInterfaceMMFDRMControl = {0x101F7D8D};
       
    30 
       
    31 /**
       
    32 @internalComponent
       
    33 */
       
    34 enum TMMFDRMControlMessages
       
    35 	{
       
    36 	EMMFDRMControlEvaluateIntent,
       
    37 	EMMFDRMControlExecuteIntent,
       
    38 	EMMFDRMControlDisableAutomaticIntent,
       
    39 	EMMFDRMControlSetAgentProperty,
       
    40 	EMMFDRMControlIsSupported
       
    41 	};
       
    42 
       
    43 
       
    44 /**
       
    45 @publishedAll
       
    46 @released
       
    47 
       
    48 Mixin class to be derived from by controller plugins wishing to support the DRM Intent
       
    49 custom commands.
       
    50 */
       
    51 class MMMFDRMCustomCommandImplementor
       
    52 	{
       
    53 public:
       
    54 
       
    55 	/**
       
    56 	Disable the automatic (controller specified) execution of intent
       
    57 
       
    58 	@param  aIntent
       
    59 	        The intent to execute
       
    60 
       
    61 	*/
       
    62 	virtual TInt MdcDisableAutomaticIntent(TBool aDisableAutoIntent)=0;
       
    63 
       
    64 
       
    65 	/**
       
    66 	Executes a particular intent
       
    67 
       
    68 	@param  aIntent
       
    69 	        The intent to execute
       
    70 
       
    71 	*/
       
    72 	virtual TInt MdcExecuteIntent(ContentAccess::TIntent aIntent)=0;
       
    73 
       
    74 	/**
       
    75 	Evaluate a particular intent
       
    76 
       
    77 	@param  aIntent
       
    78 	        The intent to evaluate
       
    79 
       
    80 	*/
       
    81 	virtual TInt MdcEvaluateIntent(ContentAccess::TIntent aIntent)=0;
       
    82 	
       
    83 	/**
       
    84 	
       
    85 	
       
    86 	*/
       
    87 	virtual TInt MdcSetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)=0;
       
    88 	};
       
    89 
       
    90 class CMMFDRMCustomCommandParser : public CMMFCustomCommandParserBase
       
    91 	{
       
    92 public:
       
    93 
       
    94 	/**
       
    95 	Creates a new custom command parser capable of DRM Intent controller commands.
       
    96 
       
    97 	@param  aImplementor
       
    98 	        A reference to the controller plugin that owns this new object.
       
    99 
       
   100 	@return A pointer to the object created.
       
   101 
       
   102 	@since  7.0s
       
   103 	*/
       
   104 	IMPORT_C static CMMFDRMCustomCommandParser* NewL(MMMFDRMCustomCommandImplementor& aImplementor);
       
   105 
       
   106 	/**
       
   107 	Destructor.
       
   108 
       
   109 	@since  7.0s
       
   110 	*/
       
   111 	IMPORT_C ~CMMFDRMCustomCommandParser();
       
   112 
       
   113 	/**
       
   114 	Handles a request from the client. Called by the controller framework.
       
   115 
       
   116 	@param  aMessage
       
   117 	        The message to be handled.
       
   118 
       
   119 	@since  7.0s
       
   120 	*/
       
   121 	void HandleRequest(TMMFMessage& aMessage);
       
   122 
       
   123 private:
       
   124 	/**
       
   125 	Constructor.
       
   126 
       
   127 	@param  aImplementor
       
   128 	        A reference to the controller plugin that owns this new object.
       
   129 	@since  7.0s
       
   130 	*/
       
   131 	CMMFDRMCustomCommandParser(MMMFDRMCustomCommandImplementor& aImplementor);
       
   132 	// Internal request handling methods.
       
   133 
       
   134 	void DoHandleRequestL(TMMFMessage& aMessage);
       
   135 	void DoEvaluateIntentL(TMMFMessage& aMessage);
       
   136 	void DoExecuteIntentL(TMMFMessage& aMessage);
       
   137 	void DoDisableAutomaticIntentL(TMMFMessage& aMessage);
       
   138 	void DoSetAgentPropertyL(TMMFMessage& aMessage);
       
   139 
       
   140 private:
       
   141 	MMMFDRMCustomCommandImplementor& iImplementor;
       
   142 	};
       
   143 	
       
   144 	
       
   145 /**
       
   146 @publishedAll
       
   147 @released
       
   148 
       
   149 Generic Mixin class to be used by a client utility wishing to pass DRM Intent
       
   150 custom commands to a controller plugin.
       
   151 */
       
   152 class MMMFDRMCustomCommand
       
   153 	{
       
   154 public:
       
   155 
       
   156 	/**
       
   157 	Disable the automatic (controller specified) execution of intent
       
   158 
       
   159 	@param  aIntent
       
   160 	        The intent to execute
       
   161 
       
   162 	*/
       
   163 	virtual TInt DisableAutomaticIntent(TBool aDisableAutoIntent)=0;
       
   164 
       
   165 
       
   166 	/**
       
   167 	Executes a particular intent
       
   168 
       
   169 	@param  aIntent
       
   170 	        The intent to execute
       
   171 
       
   172 	*/
       
   173 	virtual TInt ExecuteIntent(ContentAccess::TIntent aIntent)=0;
       
   174 
       
   175 	/**
       
   176 	Evaluate a particular intent
       
   177 
       
   178 	@param  aIntent
       
   179 	        The intent to evaluate
       
   180 
       
   181 	*/
       
   182 	virtual TInt EvaluateIntent(ContentAccess::TIntent aIntent)=0;
       
   183 	
       
   184 	/**
       
   185 	
       
   186 	
       
   187 	*/
       
   188 	virtual TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)=0;
       
   189 	};
       
   190 
       
   191 class RMMFDRMCustomCommands : public RMMFCustomCommandsBase,
       
   192                               public MMMFDRMCustomCommand
       
   193 	{
       
   194 public:
       
   195 
       
   196 	/**
       
   197 	Constructor.
       
   198 
       
   199 	@param  aController
       
   200 	        The client side controller object to be used by this custom command interface.
       
   201 
       
   202 	*/
       
   203 	IMPORT_C RMMFDRMCustomCommands(RMMFController& aController);
       
   204 	
       
   205 	/**
       
   206 	*/
       
   207 	IMPORT_C TInt DisableAutomaticIntent(TBool aBool);
       
   208 
       
   209 	/**
       
   210 	*/
       
   211 	IMPORT_C TInt EvaluateIntent(ContentAccess::TIntent aIntent);
       
   212 	
       
   213 	/**
       
   214 	*/
       
   215 	IMPORT_C TInt ExecuteIntent(ContentAccess::TIntent aIntent);
       
   216 	
       
   217 	/**
       
   218 	*/
       
   219 	IMPORT_C TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue);
       
   220 	
       
   221 	/**
       
   222 	*/
       
   223 	IMPORT_C TBool IsSupported();
       
   224 	
       
   225 	};
       
   226 
       
   227 
       
   228 #endif // __MMF_DRM_CUSTOM_COMMANDS_H__