iutil/plugin.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2001 by Jorrit Tyberghein 00003 Copyright (C) 1999 by Andrew Zabolotny <bit@eltech.ru> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 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, scfInterface<Interface>::GetVersion()))) 00044 00051 #define CS_LOAD_PLUGIN(Object,ClassID,Interface) \ 00052 csPtr<Interface> ((Interface *)((Object)->LoadPlugin \ 00053 (ClassID, #Interface, scfInterface<Interface>::GetVersion()))) 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 00091 struct iPluginManager : public iBase 00092 { 00098 virtual iBase *LoadPlugin (const char *classID, 00099 const char *iInterface = 0, int iVersion = 0, bool init = true) = 0; 00100 00108 virtual iBase *QueryPlugin (const char *iInterface, int iVersion) = 0; 00110 virtual iBase *QueryPlugin (const char* classID, 00111 const char *iInterface, int iVersion) = 0; 00113 virtual bool UnloadPlugin (iComponent *obj) = 0; 00115 virtual bool RegisterPlugin (const char *classID, iComponent *obj) = 0; 00116 00122 virtual csPtr<iPluginIterator> GetPlugins () = 0; 00124 virtual void Clear () = 0; 00125 00132 virtual void QueryOptions (iComponent* object) = 0; 00133 }; 00134 00137 #endif // __CS_IUTIL_PLUGIN_H__
Generated for Crystal Space by doxygen 1.2.18