00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CS_IUTIL_PLUGIN_H__
00021 #define __CS_IUTIL_PLUGIN_H__
00022
00031 #include "csutil/scf.h"
00032
00033 struct iComponent;
00034
00041 #define CS_QUERY_PLUGIN_CLASS(Object,ClassID,Interface) \
00042 csPtr<Interface> ((Interface *)((Object)->QueryPlugin \
00043 (ClassID, #Interface, Interface##_VERSION)))
00044
00051 #define CS_LOAD_PLUGIN(Object,ClassID,Interface) \
00052 csPtr<Interface> ((Interface *)((Object)->LoadPlugin \
00053 (ClassID, #Interface, Interface##_VERSION)))
00054
00055 SCF_VERSION (iPluginIterator, 0, 0, 1);
00056
00060 struct iPluginIterator : public iBase
00061 {
00063 virtual bool HasNext () = 0;
00065 virtual iBase* Next () = 0;
00066 };
00067
00072 #define CS_LOAD_PLUGIN_ALWAYS(Object,ClassID) \
00073 csPtr<iBase> ((Object)->LoadPlugin (ClassID, NULL, 0))
00074
00075 SCF_VERSION (iPluginManager, 0, 2, 0);
00076
00081 struct iPluginManager : public iBase
00082 {
00084 virtual iBase *LoadPlugin (const char *classID,
00085 const char *iInterface = NULL, int iVersion = 0, bool init = true) = 0;
00086
00094 virtual iBase *QueryPlugin (const char *iInterface, int iVersion) = 0;
00096 virtual iBase *QueryPlugin (const char* classID,
00097 const char *iInterface, int iVersion) = 0;
00099 virtual bool UnloadPlugin (iComponent *obj) = 0;
00101 virtual bool RegisterPlugin (const char *classID, iComponent *obj) = 0;
00102
00108 virtual csPtr<iPluginIterator> GetPlugins () = 0;
00110 virtual void Clear () = 0;
00111 };
00112
00115 #endif // __CS_IUTIL_PLUGIN_H__