1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 #ifndef PVMF_CPMPLUGIN_AUTHORIZATION_INTERFACE_H_INCLUDED 19 #define PVMF_CPMPLUGIN_AUTHORIZATION_INTERFACE_H_INCLUDED 20 21 #ifndef OSCL_BASE_H_INCLUDED 22 #include "oscl_base.h" 23 #endif 24 #ifndef OSCL_TYPES_H_INCLUDED 25 #include "oscl_types.h" 26 #endif 27 #ifndef PV_UUID_H_INCLUDED 28 #include "pv_uuid.h" 29 #endif 30 #ifndef PV_INTERFACE_H_INCLUDED 31 #include "pv_interface.h" 32 #endif 33 #ifndef PVMI_KVP_INCLUDED 34 #include "pvmi_kvp.h" 35 #endif 36 37 #define PVMF_CPMPLUGIN_AUTHORIZATION_INTERFACE_MIMETYPE "pvxxx/pvmf/cpm/plugin/authorization_interface" 38 #define PVMFCPMPluginAuthorizationInterfaceUuid PVUuid(0xfd47907a,0xffde,0x463e,0xa3,0x35,0xd4,0x98,0xff,0xdf,0xd0,0xea) 39 40 /** 41 * Authorization interface for all Content Policy Manager Plugins 42 */ 43 class PVMFCPMPluginAuthorizationInterface : public PVInterface 44 { 45 public: 46 /** 47 * Asynchronous method to authorize usage with a plug-in. 48 * 49 * @param aSessionId The assigned plugin session ID to use for this request 50 * @param aRequestedUsage The kvp that contains the requested usage. 51 * @param aApprovedUsage The kvp that contains the approved intent. 52 * 53 * @returns A unique command id for asynchronous completion. 54 */ 55 virtual PVMFCommandId AuthorizeUsage(PVMFSessionId aSessionId, 56 PvmiKvp& aRequestedUsage, 57 PvmiKvp& aApprovedUsage, 58 PvmiKvp& aAuthorizationData, 59 uint32& aRequestTimeOutInMS, 60 OsclAny* aContext = NULL) = 0; 61 62 virtual PVMFCommandId UsageComplete(PVMFSessionId aSessionId, 63 const OsclAny* aContext = NULL) = 0; 64 65 }; 66 67 68 #endif //PVMF_CPMPLUGIN_AUTHORIZATION_INTERFACE_H_INCLUDED 69 70