sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // \n sl@0: // There are some operations performed on agents that do not relate directly to a particular content file. The ContentAccess::CManager sl@0: // interface includes some functions that allow an application to work with a particular agent. sl@0: //
sl@0: // Before working with one particular agent, the client will need to find out which agents are installed on the device. sl@0: // The ContentAccess::CManager::ListAgentsL() function provides this list of agents. The \c F32Agent is not included in sl@0: // the list, since it does not support any management functions. sl@0: // The ContentAccess::CAgent objects in the list can be used to refer to the particular agent in subsequent sl@0: // function calls. sl@0: // // Create a CManager object sl@0: // CManager* manager = CManager::NewL(); sl@0: // RPointerArray theAgents; sl@0: // // Get the list of agents sl@0: // manager->ListAgents(theAgents); sl@0: // // Check there is at least one agent sl@0: // if(theAgents.Count() > 0) sl@0: // // Find the first agent sl@0: // CAgent& agent = theAgents[0]; sl@0: //
sl@0: // The management API allows applications to request that an agent display management sl@0: // information on the screen. sl@0: // The agent could present configuration settings, status or DRM rights information. sl@0: // Each agent will have unique settings so it is not possible to display one dialog to configure all agents. sl@0: // // Create a CManager object sl@0: // CManager* manager = CManager::NewL(); sl@0: // RPointerArray theAgents; sl@0: // // Get the list of agents sl@0: // manager->ListAgents(theAgents); sl@0: // // Check there is at least one agent sl@0: // if(theAgents.Count() > 0) sl@0: // CAgent& agent = (*theAgents)[0]; sl@0: // // Display the management information for the first agent sl@0: // manager->DisplayManagementInfoL(agent); sl@0: // It is possible that some agents will not support this capability and will leave with KErrCANotSupported. sl@0: // Displaying DRM rights information is only relevant for agents implementing a DRM scheme. It is expected that an Agent sl@0: // implementing DRM will provide some or all of the following functionality in the dialog: sl@0: // - Display all rights objects including state (pending, valid, expired, orphaned, etc.) sl@0: // - Display detailed information on a particular rights object (play count, validity period, the related Content object(s)) sl@0: // - Allow unwanted, expired or orphaned rights to be deleted. sl@0: //
sl@0: // The rights management object is only relevant for agents implementing a DRM scheme. Other agents will sl@0: // leave with KErrCANotSupported. sl@0: // An application can ask a particular DRM agent to create a ContentAccess::CRightsManager object that can be used sl@0: // to provide generic access to DRM rights within that agent. Since it is a generic interface sl@0: // used by all agents, it will not be able to present all the detailed information available. sl@0: // CRightsManager* rightsmanager; sl@0: // // Create a CManager object sl@0: // CManager* manager = CManager::NewL(); sl@0: // // create the rights manager object for a particular agent sl@0: // rightsManager = manager->CreateRightsManagerL(agent); sl@0: // To manage the rights in a more comprehensive manner the application should use the sl@0: // ContentAccess::CManager::DisplayManagementInfoL() function, where the agent can present sl@0: // its own comprehensive information. sl@0: //
sl@0: // This is an extension mechanism to allow a client to perform an agent-specific function. The application will need to sl@0: // know the extended commands that the agent supports and the format of the input and output buffers used in the command. All sl@0: // of this is specified by the CAF agent, not the Content Access Framework. sl@0: // The buffers allow agent specific objects to be externalized by an application, passed through CAF and internalized by the sl@0: // agent. The same principle applies for data returned from the agent to the application. sl@0: // TInt FancyApplicationFunctionL(CManager& aManager, CAgent& aAgent, CFancyAgentInputObject& aInputObject, CFancyAgentOutputObject& aOutputObject); sl@0: // // Dynamic buffer to serialize aInputObject sl@0: // CBufFlat* inputBuffer = CBufFlat::NewL(50); sl@0: // CleanupStack::PushL(inputBuffer); sl@0: // // write aInputObject to the dynamic buffer sl@0: // RBufWriteStream streamIn(*inputBuffer); sl@0: // CleanupClosePushL(streamIn); sl@0: // aInputObject.ExternalizeL(streamIn); sl@0: // CleanupStack::PopAndDestroy(&streamIn); sl@0: // // Call the agent specific function #42 sl@0: // TBuf <1000> outputBuffer; sl@0: // User::LeaveIfError(aManager.AgentSpecificCommand(aAgent, 42 ,inputBuffer->Ptr(0), outputBuffer)); sl@0: // // Don't need the input buffer any longer sl@0: // CleanupStack::PopAndDestroy(inputBuffer); sl@0: // // Create a stream object to read the output buffer sl@0: // RDesReadStream streamOut(outputBuffer); sl@0: // CleanupClosePushL(streamOut); sl@0: // aOutputObject.InternalizeL(streamOut); sl@0: // CleanupStack::PopAndDestroy(&streamOut); sl@0: //
sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @page CAFManageAgents Managing CAF Agents sl@0: - @ref ListingAgents sl@0: - @ref CAFManagementDialog sl@0: - @ref CreatingRightsManager sl@0: - @ref AgentSpecificCommand sl@0: @section ListingAgents Listing the CAF Agents sl@0: @code sl@0: @endcode sl@0: @section CAFManagementDialog Displaying the Agent Management Information sl@0: @code sl@0: @endcode sl@0: @section CreatingRightsManager Create a DRM rights management object sl@0: @code sl@0: @endcode sl@0: @section AgentSpecificCommand Agent Specific Commands sl@0: @code sl@0: @endcode sl@0: */