CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

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, 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__

Generated for Crystal Space by doxygen 1.2.14