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 PV_2WAY_ENGINE_FACTORY_H_INCLUDED 19 #define PV_2WAY_ENGINE_FACTORY_H_INCLUDED 20 21 #ifndef PV_2WAY_BASIC_TYPES_H_INCLUDED 22 #include "pv_2way_basic_types.h" 23 #endif 24 25 class PVCommandStatusObserver; 26 class PVInformationalEventObserver; 27 class PVErrorEventObserver; 28 class CPV2WayInterface; 29 30 class CPV2WayEngineFactory 31 { 32 public: 33 OSCL_IMPORT_REF static void Init(); 34 35 OSCL_IMPORT_REF static void Cleanup(); 36 37 /** 38 * Creates an instance of a terminal of a particular type. Initially, this 39 * will support 324m type terminals. 40 * 41 * @param aTerminalType the type of terminal to be created. 42 * @param aCmdStatusObserver the observer for command status 43 * @param aInfoEventObserver the observer for unsolicited informational events 44 * @param aErrorEventObserver the observer for unsolicited error events 45 * 46 * @returns A pointer to a terminal or leaves if the type is invalid or the system is out of resources 47 **/ 48 OSCL_IMPORT_REF static CPV2WayInterface *CreateTerminal(PV2WayTerminalType aTerminalType, 49 PVCommandStatusObserver* aCmdStatusObserver, 50 PVInformationalEventObserver *aInfoEventObserver, 51 PVErrorEventObserver *aErrorEventObserver); 52 53 /** 54 * This function allows the application to delete an instance of a terminal 55 * and reclaim all allocated resources. A terminal should be deleted only in 56 * the EIdle state. An attempt to delete a terminal in any other state will 57 * result in unpredictable behavior. 58 * 59 * @param terminal the terminal to be deleted. 60 * 61 **/ 62 OSCL_IMPORT_REF static void DeleteTerminal(CPV2WayInterface* terminal); 63 }; 64 65 #endif // PV_2WAY_ENGINE_FACTORY_H_INCLUDED 66