1 /****************************************************************************
3 * $Id: rmaplugn.h 7 2003-05-30 02:18:02Z gabest $
5 * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
7 * http://www.real.com/devzone
9 * This program contains proprietary
10 * information of Progressive Networks, Inc, and is licensed
11 * subject to restrictions on use and distribution.
14 * Plugin init / inspector interfaces
22 * Forward declarations of some interfaces defined or used here-in.
24 typedef _INTERFACE IUnknown IUnknown
;
25 typedef _INTERFACE IRMAPlugin IRMAPlugin
;
26 typedef _INTERFACE IRMAPluginEnumerator IRMAPluginEnumerator
;
27 typedef _INTERFACE IRMAPluginChallenger IRMAPluginChallenger
;
28 typedef _INTERFACE IRMABuffer IRMABuffer
;
29 typedef _INTERFACE IRMAValues IRMAValues
;
31 /****************************************************************************
39 * Function implemented by all plugin DLL's to create an instance of
40 * any of the objects supported by the DLL. This method is similar to
41 * Window's CoCreateInstance() in its purpose, except that it only
42 * creates objects from this plugin DLL.
44 * NOTE: Aggregation is never used. Therefore an outer unknown is
45 * not passed to this function, and you do not need to code for this
53 STDAPI RMACreateInstance
55 IUnknown
** /*OUT*/ ppIUnknown
63 /****************************************************************************
71 * Function implemented by all plugin DLL's to free any *global*
72 * resources. This method is called just before the DLL is unloaded.
79 STDAPI
RMAShutdown(void);
86 /****************************************************************************
94 * Interface exposed by a plugin DLL to allow inspection of objects
95 * supported by the plugin DLL.
99 * {00000C00-0901-11d1-8B06-00A024406D59}
103 DEFINE_GUID(IID_IRMAPlugin
, 0x00000C00, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
104 0xa0, 0x24, 0x40, 0x6d, 0x59);
107 #define INTERFACE IRMAPlugin
109 DECLARE_INTERFACE_(IRMAPlugin
, IUnknown
)
114 STDMETHOD(QueryInterface
) (THIS_
118 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
120 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
126 /************************************************************************
128 * IRMAPlugin::GetPluginInfo
130 * Returns the basic information about this plugin. Including:
132 * bMultipleLoad Whether or not this plugin can be instantiated
133 * multiple times. All File Formats must set
134 * this value to TRUE. The only other type of
135 * plugin that can specify bMultipleLoad=TRUE is
136 * a filesystem plugin. Any plugin that sets
137 * this flag to TRUE must not use global variables
140 * Setting this flag to TRUE implies that you
141 * accept that your plugin may be instantiated
142 * multiple times (possibly in different
143 * address spaces). Plugins are instantiated
144 * multiple times only in the server (for
145 * performance reasons).
147 * An example of a plugin, that must set this
148 * flag to FALSE is a filesystem plugin that
149 * uses a single TCP connection to communicate
152 * pDescription which is used in about UIs (can be NULL)
153 * pCopyright which is used in about UIs (can be NULL)
154 * pMoreInfoURL which is used in about UIs (can be NULL)
155 * ulVersionNumber The version of this plugin.
157 STDMETHOD(GetPluginInfo
) (THIS_
158 REF(BOOL
) /*OUT*/ bMultipleLoad
,
159 REF(const char*) /*OUT*/ pDescription
,
160 REF(const char*) /*OUT*/ pCopyright
,
161 REF(const char*) /*OUT*/ pMoreInfoURL
,
162 REF(ULONG32
) /*OUT*/ ulVersionNumber
) PURE
;
164 /************************************************************************
166 * IRMAPlugin::InitPlugin
168 * Initializes the plugin for use. This interface must always be
169 * called before any other method is called. This is primarily needed
170 * so that the plugin can have access to the context for creation of
171 * IRMABuffers and IMalloc.
173 STDMETHOD(InitPlugin
) (THIS_
174 IUnknown
* /*IN*/ pContext
) PURE
;
179 /****************************************************************************
183 * IRMAPluginEnumerator
187 * provide methods to enumerate through all the plugins installed
189 * IID_IRMAPluginEnumerator:
191 * {00000C01-0901-11d1-8B06-00A024406D59}
195 DEFINE_GUID(IID_IRMAPluginEnumerator
, 0x00000C01, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
196 0xa0, 0x24, 0x40, 0x6d, 0x59);
199 #define INTERFACE IRMAPluginEnumerator
201 DECLARE_INTERFACE_(IRMAPluginEnumerator
, IUnknown
)
206 STDMETHOD(QueryInterface
) (THIS_
210 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
212 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
215 * IRMAPluginEnumerator methods
218 /************************************************************************
220 * IRMAPluginEnumerator::GetNumOfPlugins
223 * return the number of plugins available
226 STDMETHOD_(ULONG32
,GetNumOfPlugins
) (THIS
) PURE
;
228 /************************************************************************
230 * IRMAPluginEnumerator::GetPlugin
232 * Return an instance (IUnknown) of the plugin
235 STDMETHOD(GetPlugin
) (THIS_
236 ULONG32
/*IN*/ ulIndex
,
237 REF(IUnknown
*) /*OUT*/ pPlugin
) PURE
;
241 /****************************************************************************
245 * IRMAPluginGroupEnumerator
249 * Provide a way to enumerate through all of the plugins which
250 * implement a specific interface.
252 * IID_IRMAPluginGroupEnumerator:
254 * {00000C02-0901-11d1-8B06-00A024406D59}
258 DEFINE_GUID(IID_IRMAPluginGroupEnumerator
, 0x00000C02, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
259 0xa0, 0x24, 0x40, 0x6d, 0x59);
262 #define INTERFACE IRMAPluginGroupEnumerator
264 #define CLSID_IRMAPluginGroupEnumerator IID_IRMAPluginGroupEnumerator
266 DECLARE_INTERFACE_(IRMAPluginGroupEnumerator
, IUnknown
)
273 * IRMAPluginGroupEnumerator methods
275 STDMETHOD(QueryInterface
) (THIS_
279 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
281 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
283 /******************************************************************
285 * IRMAPluginGroupEnumerator::Init
288 * tell the group enumerator which interface to group the plugins
289 * into, this method must be called before the other methods can
293 STDMETHOD(Init
) (THIS_
297 /******************************************************************
299 * IRMAPluginGroupEnumerator::GetNumOfPlugins
302 * return the number of plugins available that support a
307 STDMETHOD_(ULONG32
,GetNumOfPlugins
) (THIS
) PURE
;
310 /******************************************************************
312 * IRMAPluginGroupEnumerator::GetPlugin
314 * Return an instance (IUnknown) of the plugin
317 STDMETHOD(GetPlugin
) (THIS_
318 UINT32
/*IN*/ ulIndex
,
319 REF(IUnknown
*) /*OUT*/ pPlugin
) PURE
;
324 /****************************************************************************
332 * Tells the client core to reload all plugins.
334 * IID_IRMAPluginReloader:
336 * {00000C03-0901-11d1-8B06-00A024406D59}
340 DEFINE_GUID(IID_IRMAPluginReloader
, 0x00000C03, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
341 0xa0, 0x24, 0x40, 0x6d, 0x59);
344 #define INTERFACE IRMAPluginReloader
346 DECLARE_INTERFACE_(IRMAPluginReloader
, IUnknown
)
351 STDMETHOD(QueryInterface
) (THIS_
355 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
357 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
360 * IRMAPluginReloader methods
363 /************************************************************************
365 * IRMAPluginReloader::ReloadPlugins
367 * Causes the client core to reload all plugins.
370 STDMETHOD(ReloadPlugins
) (THIS
) PURE
;
375 /****************************************************************************
383 * This interface is implemented by a plugin in order to have more then
384 * one "RMA plugin" in a single DLL. I.e., a plugin author could
385 * use this interface to have 3 different file format plugins in
388 * IID_IRMAPluginFactory:
390 * {00000C04-0901-11d1-8B06-00A024406D59}
394 DEFINE_GUID(IID_IRMAPluginFactory
, 0x00000C04, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
395 0xa0, 0x24, 0x40, 0x6d, 0x59);
398 #define INTERFACE IRMAPluginFactory
400 DECLARE_INTERFACE_(IRMAPluginFactory
, IUnknown
)
405 STDMETHOD(QueryInterface
) (THIS_
409 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
411 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
414 * IRMAPluginFactory methods
417 /*****************************************************************
419 * IRMAPluginFactory::GetNumPlugins
421 * Report the number of Plugins within the DLL.
425 STDMETHOD_(UINT16
, GetNumPlugins
) (THIS
) PURE
;
427 /*****************************************************************
429 * IRMAPluginFactory::GetPlugin
431 * Returns an IUnknown interface to the requested plugin.
436 STDMETHOD(GetPlugin
) (THIS_
438 IUnknown
** pPlugin
) PURE
;
443 /****************************************************************************
451 * Interface exposed by a plugin DLL to inform the client / server core
452 * that your plugin wishes to have InitPlugin called immediately.
454 * IID_IRMAGenericPlugin:
456 * {00000C09-0901-11d1-8B06-00A024406D59}
460 DEFINE_GUID(IID_IRMAGenericPlugin
, 0x00000C09, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
461 0xa0, 0x24, 0x40, 0x6d, 0x59);
464 #define INTERFACE IRMAGenericPlugin
466 DECLARE_INTERFACE_(IRMAGenericPlugin
, IUnknown
)
471 STDMETHOD(QueryInterface
) (THIS_
475 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
477 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
480 * IRMAGenericPlugin methods
483 STDMETHOD(IsGeneric
) (THIS_
484 REF(BOOL
) /*OUT*/ bIsGeneric
) PURE
;
488 DEFINE_GUID(IID_IRMAPluginHandler
, 0x00000200, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
490 DEFINE_GUID(IID_IRMAPlugin2Handler
, 0x00000201, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
493 #define INTERFACE IRMAPlugin2Handler
495 DECLARE_INTERFACE_(IRMAPlugin2Handler
, IUnknown
)
500 STDMETHOD(QueryInterface
) (THIS_
504 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
506 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
509 * IRMAPlugin2Handler Methods
512 /************************************************************************
514 * IRMAPlugin2Handler::Init
517 * Specifies the context and sets the pluginhandler in motion.
520 STDMETHOD(Init
) (THIS_ IUnknown
* pContext
) PURE
;
522 /************************************************************************
524 * IRMAPlugin2Handler::GetNumPlugins2
527 * Gets the info of a particular plugin.
530 STDMETHOD_(ULONG32
,GetNumOfPlugins2
) (THIS
) PURE
;
532 /************************************************************************
534 * IRMAPlugin2Handler::GetPluginInfo
537 * Gets the info of a particular plugin.
540 STDMETHOD(GetPluginInfo
) (THIS_
542 REF(IRMAValues
*) /*OUT*/ Values
) PURE
;
544 /************************************************************************
546 * IRMAPlugin2Handler::FlushCache()
549 * Flushes the LRU cache -- Unloads all DLLs from memory
550 * which currenltly have a refcount of 0.
553 STDMETHOD(FlushCache
) (THIS
) PURE
;
555 /************************************************************************
557 * IRMAPlugin2Handler::SetCacheSize
560 * This function sets the size of the Cache. The cache is
561 * initally set to 1000KB. To disable the cache simply set
562 * the size to 0.If the cache is disabled a DLL will be
563 * unloaded whenever it's refcount becomes zero. Which MAY
564 * cause performance problems.
567 STDMETHOD(SetCacheSize
) (THIS_ ULONG32 nSizeKB
) PURE
;
569 /************************************************************************
571 * IRMAPlugin2Handler::GetInstance
575 * This function will return a plugin instance given a plugin index.
579 STDMETHOD(GetInstance
) (THIS_ UINT32 index
, REF(IUnknown
*) pUnknown
) PURE
;
581 /************************************************************************
583 * IRMAPlugin2Handler::FindIndexUsingValues
586 * Finds a plugin which matches the set of values given. An index
587 * is returned which can be used to either get the values (using
588 * GetPluginInfo) or an instance can be created using GetPluing().
592 STDMETHOD(FindIndexUsingValues
) (THIS_ IRMAValues
*,
593 REF(UINT32
) unIndex
) PURE
;
595 /************************************************************************
597 * IRMAPlugin2Handler::FindPluginUsingValues
600 * Finds a plugin which matches the set of values given. A Plugin
601 * instance is returned.
605 STDMETHOD(FindPluginUsingValues
) (THIS_ IRMAValues
*,
606 REF(IUnknown
*) pUnk
) PURE
;
608 /************************************************************************
610 * IRMAPlugin2Handler::FindIndexUsingStrings
613 * Finds a plugin which matches the set of values given. An index
614 * is returned which can be used to either get the values (using
615 * GetPluginInfo) or an instance can be created using GetPluing().
616 * NOTE: that a max of two values may be given.
619 STDMETHOD(FindIndexUsingStrings
) (THIS_
char* PropName1
,
625 REF(UINT32
) unIndex
) PURE
;
627 /************************************************************************
629 * IRMAPlugin2Handler::FindPluginUsingStrings
632 * Finds a plugin which matches the set of values given. A Plugin
633 * instance is returned.
634 * NOTE: that a max of two values may be given.
637 STDMETHOD(FindPluginUsingStrings
) (THIS_
char* PropName1
,
643 REF(IUnknown
*) pUnk
) PURE
;
645 /************************************************************************
647 * IRMAPlugin2Handler::FindImplementationFromClassID
650 * Finds a CommonClassFactory plugin which supports the
651 * ClassID given. An instance of the Class is returned.
654 STDMETHOD(FindImplementationFromClassID
)
658 REF(IUnknown
*) pIUnknownInstance
661 /************************************************************************
663 * IRMAPlugin2Handler::Close
666 * A function which performs all of the functions of delete.
671 STDMETHOD(Close
) (THIS
) PURE
;
673 /************************************************************************
675 * IRMAPlugin2Handler::SetRequiredPlugins
678 * This function sets the required plugin list
683 STDMETHOD(SetRequiredPlugins
) (THIS_
const char** ppszRequiredPlugins
) PURE
;
696 #endif /* _RMAPLUGN_H_ */