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_FACTORY_REGISTRY_H_INCLUDED 19 #define PVMF_CPMPLUGIN_FACTORY_REGISTRY_H_INCLUDED 20 21 #ifndef OSCL_STRING_H_INCLUDED 22 #include "oscl_string.h" 23 #endif 24 #ifndef PVMF_RETURN_CODES_H_INCLUDED 25 #include "pvmf_return_codes.h" 26 #endif 27 28 class PVMFCPMPluginFactory; 29 class OsclRegistryClient; 30 31 /** 32 * MIME type for CPM-plugins. The complete mime-string must include 33 * this string, followed by "/", followed by the plugin mime-string, 34 * e.g. X-CPM-PLUGIN/SOMEVENDOR-OMA1 35 */ 36 #define PVMF_MIME_CPM_PLUGIN "X-CPM-PLUGIN" 37 38 /** 39 * Content Policy Manager Plugin Factory Registry . 40 */ 41 class PVMFCPMPluginFactoryRegistryClient 42 { 43 public: 44 OSCL_IMPORT_REF PVMFCPMPluginFactoryRegistryClient(); 45 OSCL_IMPORT_REF ~PVMFCPMPluginFactoryRegistryClient(); 46 47 /*! 48 * Connect 49 * 50 * The application code calls this to connect to the registry 51 * server. 52 * @param: flag to select per-thread registry as opposed to global 53 * registry. 54 * @return: PVMFSuccess, or one of the PVMF return codes for errors. 55 */ 56 OSCL_IMPORT_REF PVMFStatus Connect(bool aPerThreadRegistry = false); 57 58 /*! 59 * RegisterPlugin 60 * 61 * The application code calls this to register a plugin factory 62 * function. 63 * 64 * @param: Plugin mime type, of the form X-CPM-PLUGIN/... 65 * @param: Plugin factory implementation. 66 * @return: PVMFSuccess, or one of the PVMF return codes for errors. 67 */ 68 OSCL_IMPORT_REF PVMFStatus RegisterPlugin(OSCL_String& aMimeType, 69 PVMFCPMPluginFactory& aFactory) ; 70 /*! 71 * UnRegisterPlugin 72 * 73 * The application code can call this to un-register a CPM 74 * plugin factory. 75 * 76 * Note: This call is optional. The plugin registry will 77 * be automatically cleaned up when Close is called. 78 * 79 * @param: Plugin mime type 80 * @return: PVMFSuccess, or one of the PVMF return codes for errors. 81 */ 82 OSCL_IMPORT_REF PVMFStatus UnRegisterPlugin(OSCL_String& aMimeType) ; 83 84 /*! 85 * Close 86 * 87 * The application code calls this to close the registry client 88 * session and cleanup all registered plugins. 89 * 90 */ 91 OSCL_IMPORT_REF void Close(); 92 93 private: 94 OsclRegistryClient* iClient; 95 96 }; 97 98 99 100 #endif //PVMF_CPMPLUGIN_INTERFACE_H_INCLUDED 101 102