hxplugn.h

来自「Amarok是一款在LINUX或其他类UNIX操作系统中运行的音频播放器软件。 」· C头文件 代码 · 共 1,425 行 · 第 1/3 页

H
1,425
字号
/* * * This software is released under the provisions of the GPL version 2. * see file "COPYING".  If that file is not available, the full statement  * of the license can be found at * * http://www.fsf.org/licensing/licenses/gpl.txt * * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved. * */#ifndef _HXPLUGN_H_#define _HXPLUGN_H_#include "hxcom.h"#include "hxplugncompat.h"/* * Forward declarations of some interfaces defined or used here-in. */typedef _INTERFACE  IUnknown			    IUnknown;typedef _INTERFACE  IHXPlugin			    IHXPlugin;typedef _INTERFACE  IHXPluginEnumerator	    IHXPluginEnumerator;// $Private:typedef _INTERFACE  IHXPluginSearchEnumerator	    IHXPluginSearchEnumerator;typedef _INTERFACE  IHXPluginChallenger	    IHXPluginChallenger;// $EndPrivate.typedef _INTERFACE  IHXBuffer			    IHXBuffer;typedef _INTERFACE  IHXValues			    IHXValues;typedef _INTERFACE  IHXPreferences		    IHXPreferences;// Plugin Types.#define	PLUGIN_FILESYSTEM_TYPE	    "PLUGIN_FILE_SYSTEM"#define	PLUGIN_FILEFORMAT_TYPE	    "PLUGIN_FILE_FORMAT"#define	PLUGIN_FILEWRITER_TYPE	    "PLUGIN_FILE_WRITER"#define	PLUGIN_METAFILEFORMAT_TYPE  "PLUGIN_METAFILE_FORMAT"#define	PLUGIN_RENDERER_TYPE	    "PLUGIN_RENDERER"#define PLUGIN_DEPACKER_TYPE        "PLUGIN_DEPACKER"#define PLUGIN_REVERTER_TYPE	    "PLUGIN_REVERTER"#define PLUGIN_BROADCAST_TYPE	    "PLUGIN_BROADCAST"#define PLUGIN_STREAM_DESC_TYPE	    "PLUGIN_STREAM_DESC"#define PLUGIN_ALLOWANCE_TYPE	    "PLUGIN_ALLOWANCE"#define PLUGIN_PAC_TYPE		    "PLUGIN_PAC"#define PLUGIN_CLASS_FACTORY_TYPE   "PLUGIN_CLASS_FACT"#define	PLUGIN_CLASS		    "PluginType"#define PLUGIN_FILENAME		    "PluginFilename"#define PLUGIN_REGKEY_ROOT	    "PluginHandlerData"#define PLUGIN_PLUGININFO	    "PluginInfo"#define PLUGIN_GUIDINFO		    "GUIDInfo"#define PLUGIN_NONHXINFO	    "NonHXDLLs"#define PLUGIN_IDENTIFIER	    "Plugin#"// This may no longer be needed...#define PLUGINDIRECTORYHASH	    "DirHash"	    // XXXAH WHO is defining this ... I think I know..#define PLUGIN_DESCRIPTION2	    "Description"	// XXXAH WHO is defining this ... I think I know..#define PLUGIN_FILE_HASH	    "FileHash"#define PLUGIN_INDEX		    "IndexNumber"#define PLUGIN_FILENAMES	    "FileInfo"#define PLUGIN_COPYRIGHT2	    "Copyright"#define PLUGIN_LOADMULTIPLE	    "LoadMultiple"#define PLUGIN_VERSION		    "Version"#define PLUGIN_FILESYSTEMSHORT	    "FileShort"#define PLUGIN_FILESYSTEMPROTOCOL   "FileProtocol"#define PLUGIN_FILEMIMETYPES	    "FileMime"#define PLUGIN_FILEEXTENSIONS	    "FileExtensions"#define PLUGIN_FILEOPENNAMES	    "FileOpenNames"#define PLUGIN_RENDERER_MIME	    "RendererMime"#define PLUGIN_RENDERER_GRANULARITY "Renderer_Granularity"#define PLUGIN_DEPACKER_MIME        "DepackerMime"#define PLUGIN_REVERTER_MIME	    "ReverterMime"#define PLUGIN_BROADCASTTYPE	    "BroadcastType"#define PLUGIN_STREAMDESCRIPTION    "StreamDescription"// #define PLUGIN_GUID_RESPONSE	    "MainGuid"#define PLUGIN_FACTORY_GUIDS	    "" // These are comma delimited.//#define PLUGIN_NUM_PLUGINS	    "NumPlugins"#define PLUGIN_FILE_CHECKSUM	    "DLLCheckSum"#define PLUGIN_DLL_SIZE		    "DLLSize"#define PLUGIN_HAS_FACTORY	    "DLLHasFactory"/**************************************************************************** *  *  Function: *  *	HXCreateInstance() *  *  Purpose: *  *	Function implemented by all plugin DLL's to create an instance of  *	any of the objects supported by the DLL. This method is similar to  *	Window's CoCreateInstance() in its purpose, except that it only  *	creates objects from this plugin DLL. * *	NOTE: Aggregation is never used. Therefore an outer unknown is *	not passed to this function, and you do not need to code for this *	situation. *  */#ifdef _MAC_CFM#pragma export on#endifSTDAPI HXCreateInstance		(		    IUnknown**  /*OUT*/	ppIUnknown		);		#ifdef _MAC_CFM#pragma export off#endif/**************************************************************************** *  *  Function: *  *	HXShutdown() *  *  Purpose: *  *	Function implemented by all plugin DLL's to free any *global*  *	resources. This method is called just before the DLL is unloaded. * */#ifdef _MAC_CFM#pragma export on#endifSTDAPI HXShutdown(void);		#ifdef _MAC_CFM#pragma export off#endif/**************************************************************************** *  *  Interface: *  *	IHXPlugin *  *  Purpose: *  *	Interface exposed by a plugin DLL to allow inspection of objects *	supported by the plugin DLL. *  *  IID_IHXPlugin: *  *	{00000C00-0901-11d1-8B06-00A024406D59} *  */DEFINE_GUID(IID_IHXPlugin, 0x00000C00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 			0xa0, 0x24, 0x40, 0x6d, 0x59);#undef  INTERFACE#define INTERFACE   IHXPluginDECLARE_INTERFACE_(IHXPlugin, IUnknown){    /*     *	IUnknown methods     */    STDMETHOD(QueryInterface)		(THIS_					REFIID riid,					void** ppvObj) PURE;    STDMETHOD_(ULONG32,AddRef)		(THIS) PURE;    STDMETHOD_(ULONG32,Release)		(THIS) PURE;    /*     *	IHXPlugin methods     */    /************************************************************************     *	Method:     *	    IHXPlugin::GetPluginInfo     *	Purpose:     *	    Returns the basic information about this plugin. Including:     *     *	    bMultipleLoad	Whether or not this plugin can be instantiated     *				multiple times. All File Formats must set     *				this value to TRUE.  The only other type of     *				plugin that can specify bMultipleLoad=TRUE is     *				a filesystem plugin.  Any plugin that sets     *				this flag to TRUE must not use global variables     *				of any type.     *     *				Setting this flag to TRUE implies that you     *				accept that your plugin may be instantiated     *				multiple times (possibly in different     *				address spaces).  Plugins are instantiated     *				multiple times only in the server (for     *				performance reasons).     *     *				An example of a plugin, that must set this     *				flag to FALSE is a filesystem plugin that      *				uses a single TCP connection to communicate     *				with a database.     *				     *	    pDescription	which is used in about UIs (can be NULL)     *	    pCopyright		which is used in about UIs (can be NULL)     *	    pMoreInfoURL	which is used in about UIs (can be NULL)     *	    ulVersionNumber	The version of this plugin.     */    STDMETHOD(GetPluginInfo)	(THIS_				REF(HXBOOL)	 /*OUT*/ bMultipleLoad,				REF(const char*) /*OUT*/ pDescription,				REF(const char*) /*OUT*/ pCopyright,				REF(const char*) /*OUT*/ pMoreInfoURL,				REF(ULONG32)	 /*OUT*/ ulVersionNumber) PURE;    /************************************************************************     *	Method:     *	    IHXPlugin::InitPlugin     *	Purpose:     *	    Initializes the plugin for use. This interface must always be     *	    called before any other method is called. This is primarily needed      *	    so that the plugin can have access to the context for creation of     *	    IHXBuffers and IMalloc.     */    STDMETHOD(InitPlugin)   (THIS_			    IUnknown*   /*IN*/  pContext) PURE;};/**************************************************************************** *  *  Interface: *  *	IHXPluginEnumerator *  *  Purpose: *  *	provide methods to enumerate through all the plugins installed *  *  IID_IHXPluginEnumerator: *  *	{00000C01-0901-11d1-8B06-00A024406D59} *  */DEFINE_GUID(IID_IHXPluginEnumerator, 0x00000C01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 		0xa0, 0x24, 0x40, 0x6d, 0x59);#undef  INTERFACE#define INTERFACE   IHXPluginEnumeratorDECLARE_INTERFACE_(IHXPluginEnumerator, IUnknown){    /*     *	IUnknown methods     */    STDMETHOD(QueryInterface)		(THIS_					REFIID riid,					void** ppvObj) PURE;    STDMETHOD_(ULONG32,AddRef)		(THIS) PURE;    STDMETHOD_(ULONG32,Release)		(THIS) PURE;    /*     *	IHXPluginEnumerator methods     */    /************************************************************************     *	Method:     *	    IHXPluginEnumerator::GetNumOfPlugins     *     *	Purpose:         *	    return the number of plugins available     *     */    STDMETHOD_(ULONG32,GetNumOfPlugins)	(THIS) PURE;    /************************************************************************     *	Method:     *	    IHXPluginEnumerator::GetPlugin     *	Purpose:     *	    Return an instance (IUnknown) of the plugin     *     */    STDMETHOD(GetPlugin)   (THIS_			   ULONG32	   /*IN*/  ulIndex,			   REF(IUnknown*)  /*OUT*/ pPlugin) PURE;};/**************************************************************************** *  *  Interface: *  *	IHXPluginGroupEnumerator *  *  Purpose: *  *	Provide a way to enumerate through all of the plugins which *	implement a specific interface. *  *  IID_IHXPluginGroupEnumerator: *  *	{00000C02-0901-11d1-8B06-00A024406D59} *  */DEFINE_GUID(IID_IHXPluginGroupEnumerator, 0x00000C02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 		0xa0, 0x24, 0x40, 0x6d, 0x59);#undef  INTERFACE#define INTERFACE   IHXPluginGroupEnumerator#define CLSID_IHXPluginGroupEnumerator IID_IHXPluginGroupEnumeratorDECLARE_INTERFACE_(IHXPluginGroupEnumerator, IUnknown){    /*     * IUnknown methods     */    /*     * IHXPluginGroupEnumerator methods     */    STDMETHOD(QueryInterface)		(THIS_					REFIID riid,					void** ppvObj) PURE;    STDMETHOD_(ULONG32,AddRef)		(THIS) PURE;    STDMETHOD_(ULONG32,Release)		(THIS) PURE;    /******************************************************************     * Method:     *	    IHXPluginGroupEnumerator::Init     *     * Purpose:     *	    tell the group enumerator which interface to group the plugins     *     into, this method must be called before the other methods can     *     be called.     *     */    STDMETHOD(Init)         (THIS_                            REFIID    iid) PURE;    /******************************************************************     * Method:     *     IHXPluginGroupEnumerator::GetNumOfPlugins     *     * Purpose:     *     return the number of plugins available that support a     *	   particular interface.     *     */    STDMETHOD_(ULONG32,GetNumOfPlugins) (THIS) PURE;    /******************************************************************     * Method:     *     IHXPluginGroupEnumerator::GetPlugin     * Purpose:     *     Return an instance (IUnknown) of the plugin     *     */    STDMETHOD(GetPlugin)   (THIS_      UINT32    /*IN*/  ulIndex,      REF(IUnknown*)  /*OUT*/ pPlugin) PURE;};// $Private:/**************************************************************************** *  *  Interface: *  *	IHXPluginSearchEnumerator *  *  Purpose: *	Walk through the result set of a plugin search  * * {3244B391-42D4-11d4-9503-00902790299C} *  */DEFINE_GUID( IID_IHXPluginSearchEnumerator,     0x3244b391, 0x42d4, 0x11d4, 0x95, 0x3, 0x0, 0x90, 0x27, 0x90, 0x29, 0x9c);#undef  INTERFACE#define INTERFACE   IHXPluginSearchEnumeratorDECLARE_INTERFACE_( IHXPluginSearchEnumerator, IUnknown ){    /*     *	IUnknown methods     */    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE;    STDMETHOD_(ULONG32,AddRef)(THIS) PURE;    STDMETHOD_(ULONG32,Release)(THIS) PURE;    /*     *	IHXPluginSearchEnumerator methods     */    /************************************************************************     *	Method:     *	    IHXPluginSearchEnumerator::GetNumPlugins     *     *	Purpose:         *	    Returns numbers of plugins found during search     *     */    STDMETHOD_( UINT32, GetNumPlugins)(THIS) PURE;    /************************************************************************     *	Method:     *	    IHXPluginSearchEnumerator::GoHead     *     *	Purpose:         *	    Moves the iterator to the beginning of the collection     *     */    STDMETHOD_(void, GoHead)(THIS) PURE;        /************************************************************************     *	Method:     *	    IHXPluginSearchEnumerator::GetNextPlugin     *     *	Purpose:         *	    Returns an instance of the next plugin in the collection     *     */    STDMETHOD(GetNextPlugin)( THIS_ REF(IUnknown*) pIUnkResult, 				    IUnknown* pIUnkOuter ) PURE;    /************************************************************************     *	Method:     *	    IHXPluginSearchEnumerator::GetNextPluginInfo     *     *	Purpose:         *	    Gets information about the next plugin in the list     *     */    STDMETHOD(GetNextPluginInfo)( THIS_ REF(IHXValues*) pRetValues ) PURE;        /************************************************************************     *	Method:     *	    IHXPluginSearchEnumerator::GetPluginAt     *     *	Purpose:         *	    Returns an instance of a plugin at a specific index in the list     *     */    STDMETHOD(GetPluginAt)( THIS_ UINT32 index, 				    REF(IUnknown*) pIUnkResult, 				    IUnknown* pIUnkOuter ) PURE;    /************************************************************************     *	Method:     *	    IHXPluginSearchEnumerator::     *     *	Purpose:         *	    Returns information about a plugin at a specific index in the list

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?