os/mm/mmlibs/mmfw/inc/mmf/ControllerFramework/mmfdrmcustomcommands.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/inc/mmf/ControllerFramework/mmfdrmcustomcommands.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,218 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __MMF_DRM_CUSTOM_COMMANDS_H__
    1.20 +#define __MMF_DRM_CUSTOM_COMMANDS_H__
    1.21 +
    1.22 +
    1.23 +#include <e32base.h>
    1.24 +#include <mmf/common/mmcaf.h>
    1.25 +#include <mmf/common/mmfstandardcustomcommands.h>
    1.26 +
    1.27 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.28 +#include <mmf/common/mmfdrmcustomcommandsenum.h>
    1.29 +#endif
    1.30 +
    1.31 +/**
    1.32 +@publishedAll
    1.33 +@released
    1.34 +*/
    1.35 +const TUid KUidInterfaceMMFDRMControl = {0x101F7D8D};
    1.36 +
    1.37 +/**
    1.38 +@publishedAll
    1.39 +@released
    1.40 +
    1.41 +Mixin class to be derived from by controller plugins wishing to support the DRM Intent
    1.42 +custom commands.
    1.43 +*/
    1.44 +class MMMFDRMCustomCommandImplementor
    1.45 +	{
    1.46 +public:
    1.47 +
    1.48 +	/**
    1.49 +	Disable the automatic (controller specified) execution of intent
    1.50 +
    1.51 +	@param  aIntent
    1.52 +	        The intent to execute
    1.53 +
    1.54 +	*/
    1.55 +	virtual TInt MdcDisableAutomaticIntent(TBool aDisableAutoIntent)=0;
    1.56 +
    1.57 +
    1.58 +	/**
    1.59 +	Executes a particular intent
    1.60 +
    1.61 +	@param  aIntent
    1.62 +	        The intent to execute
    1.63 +
    1.64 +	*/
    1.65 +	virtual TInt MdcExecuteIntent(ContentAccess::TIntent aIntent)=0;
    1.66 +
    1.67 +	/**
    1.68 +	Evaluate a particular intent
    1.69 +
    1.70 +	@param  aIntent
    1.71 +	        The intent to evaluate
    1.72 +
    1.73 +	*/
    1.74 +	virtual TInt MdcEvaluateIntent(ContentAccess::TIntent aIntent)=0;
    1.75 +	
    1.76 +	/**
    1.77 +	
    1.78 +	
    1.79 +	*/
    1.80 +	virtual TInt MdcSetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)=0;
    1.81 +	};
    1.82 +
    1.83 +class CMMFDRMCustomCommandParser : public CMMFCustomCommandParserBase
    1.84 +	{
    1.85 +public:
    1.86 +
    1.87 +	/**
    1.88 +	Creates a new custom command parser capable of DRM Intent controller commands.
    1.89 +
    1.90 +	@param  aImplementor
    1.91 +	        A reference to the controller plugin that owns this new object.
    1.92 +
    1.93 +	@return A pointer to the object created.
    1.94 +
    1.95 +	@since  7.0s
    1.96 +	*/
    1.97 +	IMPORT_C static CMMFDRMCustomCommandParser* NewL(MMMFDRMCustomCommandImplementor& aImplementor);
    1.98 +
    1.99 +	/**
   1.100 +	Destructor.
   1.101 +
   1.102 +	@since  7.0s
   1.103 +	*/
   1.104 +	IMPORT_C ~CMMFDRMCustomCommandParser();
   1.105 +
   1.106 +	/**
   1.107 +	Handles a request from the client. Called by the controller framework.
   1.108 +
   1.109 +	@param  aMessage
   1.110 +	        The message to be handled.
   1.111 +
   1.112 +	@since  7.0s
   1.113 +	*/
   1.114 +	void HandleRequest(TMMFMessage& aMessage);
   1.115 +
   1.116 +private:
   1.117 +	/**
   1.118 +	Constructor.
   1.119 +
   1.120 +	@param  aImplementor
   1.121 +	        A reference to the controller plugin that owns this new object.
   1.122 +	@since  7.0s
   1.123 +	*/
   1.124 +	CMMFDRMCustomCommandParser(MMMFDRMCustomCommandImplementor& aImplementor);
   1.125 +	// Internal request handling methods.
   1.126 +
   1.127 +	void DoHandleRequestL(TMMFMessage& aMessage);
   1.128 +	void DoEvaluateIntentL(TMMFMessage& aMessage);
   1.129 +	void DoExecuteIntentL(TMMFMessage& aMessage);
   1.130 +	void DoDisableAutomaticIntentL(TMMFMessage& aMessage);
   1.131 +	void DoSetAgentPropertyL(TMMFMessage& aMessage);
   1.132 +
   1.133 +private:
   1.134 +	MMMFDRMCustomCommandImplementor& iImplementor;
   1.135 +	};
   1.136 +	
   1.137 +	
   1.138 +/**
   1.139 +@publishedAll
   1.140 +@released
   1.141 +
   1.142 +Generic Mixin class to be used by a client utility wishing to pass DRM Intent
   1.143 +custom commands to a controller plugin.
   1.144 +*/
   1.145 +class MMMFDRMCustomCommand
   1.146 +	{
   1.147 +public:
   1.148 +
   1.149 +	/**
   1.150 +	Disable the automatic (controller specified) execution of intent
   1.151 +
   1.152 +	@param  aIntent
   1.153 +	        The intent to execute
   1.154 +
   1.155 +	*/
   1.156 +	virtual TInt DisableAutomaticIntent(TBool aDisableAutoIntent)=0;
   1.157 +
   1.158 +
   1.159 +	/**
   1.160 +	Executes a particular intent
   1.161 +
   1.162 +	@param  aIntent
   1.163 +	        The intent to execute
   1.164 +
   1.165 +	*/
   1.166 +	virtual TInt ExecuteIntent(ContentAccess::TIntent aIntent)=0;
   1.167 +
   1.168 +	/**
   1.169 +	Evaluate a particular intent
   1.170 +
   1.171 +	@param  aIntent
   1.172 +	        The intent to evaluate
   1.173 +
   1.174 +	*/
   1.175 +	virtual TInt EvaluateIntent(ContentAccess::TIntent aIntent)=0;
   1.176 +	
   1.177 +	/**
   1.178 +	
   1.179 +	
   1.180 +	*/
   1.181 +	virtual TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)=0;
   1.182 +	};
   1.183 +
   1.184 +class RMMFDRMCustomCommands : public RMMFCustomCommandsBase,
   1.185 +                              public MMMFDRMCustomCommand
   1.186 +	{
   1.187 +public:
   1.188 +
   1.189 +	/**
   1.190 +	Constructor.
   1.191 +
   1.192 +	@param  aController
   1.193 +	        The client side controller object to be used by this custom command interface.
   1.194 +
   1.195 +	*/
   1.196 +	IMPORT_C RMMFDRMCustomCommands(RMMFController& aController);
   1.197 +	
   1.198 +	/**
   1.199 +	*/
   1.200 +	IMPORT_C TInt DisableAutomaticIntent(TBool aBool);
   1.201 +
   1.202 +	/**
   1.203 +	*/
   1.204 +	IMPORT_C TInt EvaluateIntent(ContentAccess::TIntent aIntent);
   1.205 +	
   1.206 +	/**
   1.207 +	*/
   1.208 +	IMPORT_C TInt ExecuteIntent(ContentAccess::TIntent aIntent);
   1.209 +	
   1.210 +	/**
   1.211 +	*/
   1.212 +	IMPORT_C TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue);
   1.213 +	
   1.214 +	/**
   1.215 +	*/
   1.216 +	IMPORT_C TBool IsSupported();
   1.217 +	
   1.218 +	};
   1.219 +
   1.220 +
   1.221 +#endif // __MMF_DRM_CUSTOM_COMMANDS_H__