os/mm/mmlibs/mmfw/inc/mmf/ControllerFramework/mmfdrmcustomcommands.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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 "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.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 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    25 #include <mmf/common/mmfdrmcustomcommandsenum.h>
    26 #endif
    27 
    28 /**
    29 @publishedAll
    30 @released
    31 */
    32 const TUid KUidInterfaceMMFDRMControl = {0x101F7D8D};
    33 
    34 /**
    35 @publishedAll
    36 @released
    37 
    38 Mixin class to be derived from by controller plugins wishing to support the DRM Intent
    39 custom commands.
    40 */
    41 class MMMFDRMCustomCommandImplementor
    42 	{
    43 public:
    44 
    45 	/**
    46 	Disable the automatic (controller specified) execution of intent
    47 
    48 	@param  aIntent
    49 	        The intent to execute
    50 
    51 	*/
    52 	virtual TInt MdcDisableAutomaticIntent(TBool aDisableAutoIntent)=0;
    53 
    54 
    55 	/**
    56 	Executes a particular intent
    57 
    58 	@param  aIntent
    59 	        The intent to execute
    60 
    61 	*/
    62 	virtual TInt MdcExecuteIntent(ContentAccess::TIntent aIntent)=0;
    63 
    64 	/**
    65 	Evaluate a particular intent
    66 
    67 	@param  aIntent
    68 	        The intent to evaluate
    69 
    70 	*/
    71 	virtual TInt MdcEvaluateIntent(ContentAccess::TIntent aIntent)=0;
    72 	
    73 	/**
    74 	
    75 	
    76 	*/
    77 	virtual TInt MdcSetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)=0;
    78 	};
    79 
    80 class CMMFDRMCustomCommandParser : public CMMFCustomCommandParserBase
    81 	{
    82 public:
    83 
    84 	/**
    85 	Creates a new custom command parser capable of DRM Intent controller commands.
    86 
    87 	@param  aImplementor
    88 	        A reference to the controller plugin that owns this new object.
    89 
    90 	@return A pointer to the object created.
    91 
    92 	@since  7.0s
    93 	*/
    94 	IMPORT_C static CMMFDRMCustomCommandParser* NewL(MMMFDRMCustomCommandImplementor& aImplementor);
    95 
    96 	/**
    97 	Destructor.
    98 
    99 	@since  7.0s
   100 	*/
   101 	IMPORT_C ~CMMFDRMCustomCommandParser();
   102 
   103 	/**
   104 	Handles a request from the client. Called by the controller framework.
   105 
   106 	@param  aMessage
   107 	        The message to be handled.
   108 
   109 	@since  7.0s
   110 	*/
   111 	void HandleRequest(TMMFMessage& aMessage);
   112 
   113 private:
   114 	/**
   115 	Constructor.
   116 
   117 	@param  aImplementor
   118 	        A reference to the controller plugin that owns this new object.
   119 	@since  7.0s
   120 	*/
   121 	CMMFDRMCustomCommandParser(MMMFDRMCustomCommandImplementor& aImplementor);
   122 	// Internal request handling methods.
   123 
   124 	void DoHandleRequestL(TMMFMessage& aMessage);
   125 	void DoEvaluateIntentL(TMMFMessage& aMessage);
   126 	void DoExecuteIntentL(TMMFMessage& aMessage);
   127 	void DoDisableAutomaticIntentL(TMMFMessage& aMessage);
   128 	void DoSetAgentPropertyL(TMMFMessage& aMessage);
   129 
   130 private:
   131 	MMMFDRMCustomCommandImplementor& iImplementor;
   132 	};
   133 	
   134 	
   135 /**
   136 @publishedAll
   137 @released
   138 
   139 Generic Mixin class to be used by a client utility wishing to pass DRM Intent
   140 custom commands to a controller plugin.
   141 */
   142 class MMMFDRMCustomCommand
   143 	{
   144 public:
   145 
   146 	/**
   147 	Disable the automatic (controller specified) execution of intent
   148 
   149 	@param  aIntent
   150 	        The intent to execute
   151 
   152 	*/
   153 	virtual TInt DisableAutomaticIntent(TBool aDisableAutoIntent)=0;
   154 
   155 
   156 	/**
   157 	Executes a particular intent
   158 
   159 	@param  aIntent
   160 	        The intent to execute
   161 
   162 	*/
   163 	virtual TInt ExecuteIntent(ContentAccess::TIntent aIntent)=0;
   164 
   165 	/**
   166 	Evaluate a particular intent
   167 
   168 	@param  aIntent
   169 	        The intent to evaluate
   170 
   171 	*/
   172 	virtual TInt EvaluateIntent(ContentAccess::TIntent aIntent)=0;
   173 	
   174 	/**
   175 	
   176 	
   177 	*/
   178 	virtual TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)=0;
   179 	};
   180 
   181 class RMMFDRMCustomCommands : public RMMFCustomCommandsBase,
   182                               public MMMFDRMCustomCommand
   183 	{
   184 public:
   185 
   186 	/**
   187 	Constructor.
   188 
   189 	@param  aController
   190 	        The client side controller object to be used by this custom command interface.
   191 
   192 	*/
   193 	IMPORT_C RMMFDRMCustomCommands(RMMFController& aController);
   194 	
   195 	/**
   196 	*/
   197 	IMPORT_C TInt DisableAutomaticIntent(TBool aBool);
   198 
   199 	/**
   200 	*/
   201 	IMPORT_C TInt EvaluateIntent(ContentAccess::TIntent aIntent);
   202 	
   203 	/**
   204 	*/
   205 	IMPORT_C TInt ExecuteIntent(ContentAccess::TIntent aIntent);
   206 	
   207 	/**
   208 	*/
   209 	IMPORT_C TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue);
   210 	
   211 	/**
   212 	*/
   213 	IMPORT_C TBool IsSupported();
   214 	
   215 	};
   216 
   217 
   218 #endif // __MMF_DRM_CUSTOM_COMMANDS_H__