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