OpenH323 1.18.0
|
00001 /* 00002 * hid.h 00003 * 00004 * Virteos HID Implementation for the OpenH323 Project. 00005 * 00006 * Virteos is a Trade Mark of ISVO (Asia) Pte Ltd. 00007 * 00008 * Copyright (c) 2005 ISVO (Asia) Pte Ltd. All Rights Reserved. 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Initial Developer of the Original Code is ISVO (Asia) Pte Ltd. 00021 * 00022 * 00023 * Contributor(s): ______________________________________. 00024 * 00025 * $Log: hid.h,v $ 00026 * Revision 1.3 2005/07/13 18:01:01 shorne 00027 * Added HIDdevices::AddAllHIDs 00028 * 00029 * Revision 1.2 2005/07/06 11:15:25 shorne 00030 * Added HIDdevices::PrintOn 00031 * 00032 * Revision 1.1 2005/07/03 14:38:42 shorne 00033 * *** empty log message *** 00034 * 00035 * 00036 */ 00037 00038 #include <ptlib.h> 00039 #include <lid.h> 00040 00041 #if _MSC_VER > 1000 00042 #pragma once 00043 #endif // _MSC_VER > 1000 00044 00045 #ifdef _MSC_VER 00046 #pragma warning(disable:4100) 00047 #endif 00048 00049 00050 PDECLARE_LIST(HIDDevices, OpalLineInterfaceDevice) 00051 #ifdef DOC_PLUS_PLUS 00052 { 00053 #endif 00054 public: 00055 BOOL HasAvailDevice(); 00056 OpalLineInterfaceDevice * AvailDevice(); 00057 BOOL AddAllHIDs(const PString & name); 00058 00059 void PrintOn(ostream & strm) const; 00060 }; 00061 00062 class HIDPluginDeviceManager : public PPluginModuleManager 00063 { 00064 PCLASSINFO(HIDPluginDeviceManager, PPluginModuleManager); 00065 public: 00066 HIDPluginDeviceManager(PPluginManager * pluginMgr = NULL); 00067 ~HIDPluginDeviceManager(); 00068 00069 void OnLoadPlugin(PDynaLink & dll, INT code); 00070 00071 virtual void OnShutdown(); 00072 00073 static void Bootstrap(); 00074 00075 virtual BOOL RegisterHID(unsigned int count, void * _HIDList); 00076 virtual BOOL UnregisterHID(unsigned int count, void * _HIDList); 00077 00078 void CreateHIDDevice(PluginHID_Definition * HIDDevice); 00079 00080 00081 }; 00082 00083 static PFactory<PPluginModuleManager>::Worker<HIDPluginDeviceManager> h323PluginCodecManagerFactory("HIDPluginDeviceManager", true); 00084 00086 00087 typedef PFactory<OpalLineInterfaceDevice> HIDFactory; 00088 00089 #define HID_REGISTER_DEVICE(cls, HIDName) static HIDFactory::Worker<cls> cls##Factory(HIDName, true); \ 00090 00091 #define HID_DEFINE_DEVICE(cls, HIDName, fmtName) \ 00092 class cls : public OpalLineInterfaceDevice { \ 00093 public: \ 00094 cls() : OpalLineInterfaceDevice() { } \ 00095 PString GetName() const \ 00096 { return fmtName; } \ 00097 }; \ 00098 HID_REGISTER_DEVICE(cls, capName) \ 00099 00100