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, 0, 0))
00074
00075 SCF_VERSION (iPluginManager, 0, 2, 0);
00076
00081 struct iPluginManager : public iBase
00082 {
00088 virtual iBase *LoadPlugin (const char *classID,
00089 const char *iInterface = 0, int iVersion = 0, bool init = true) = 0;
00090
00098 virtual iBase *QueryPlugin (const char *iInterface, int iVersion) = 0;
00100 virtual iBase *QueryPlugin (const char* classID,
00101 const char *iInterface, int iVersion) = 0;
00103 virtual bool UnloadPlugin (iComponent *obj) = 0;
00105 virtual bool RegisterPlugin (const char *classID, iComponent *obj) = 0;
00106
00112 virtual csPtr<iPluginIterator> GetPlugins () = 0;
00114 virtual void Clear () = 0;
00115
00122 virtual void QueryOptions (iComponent* object) = 0;
00123 };
00124
00127 #endif // __CS_IUTIL_PLUGIN_H__