| 1 |
/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ |
| 2 |
|
| 3 |
/* AbiSource Application Framework |
| 4 |
* Copyright (C) 2005 Robert Staudinger <[email protected]> |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or |
| 7 |
* modify it under the terms of the GNU General Public License |
| 8 |
* as published by the Free Software Foundation; either version 2 |
| 9 |
* of the License, or (at your option) any later version. |
| 10 |
* |
| 11 |
* This program is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with this program; if not, write to the Free Software |
| 18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 19 |
* 02110-1301 USA. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef XAP_MODULE_FACTORY_H |
| 23 |
#define XAP_MODULE_FACTORY_H |
| 24 |
|
| 25 |
#include "xap_Module.h" |
| 26 |
|
| 27 |
class ABI_EXPORT XAP_ModuleFactory |
| 28 |
{ |
| 29 |
friend class XAP_Module; |
| 30 |
|
| 31 |
public: |
| 32 |
|
| 33 |
/*! |
| 34 |
* Returns the name of the factory for logging and debugging purposes. |
| 35 |
*/ |
| 36 |
virtual const char * getName (void) = NULL; |
| 37 |
|
| 38 |
/*! |
| 39 |
* Load a module. |
| 40 |
* \param szFilename Plugin file to load. |
| 41 |
* \return Ptr to module instance if success, otherwise NULL; |
| 42 |
*/ |
| 43 |
virtual XAP_Module * loadModule (const char * szFilename) = NULL; |
| 44 |
/*! |
| 45 |
* Unload a module. |
| 46 |
* Plugin factories can implement this method if they want to handle unloading of |
| 47 |
* plugins themselves. |
| 48 |
* \param module Ptr to module instance. |
| 49 |
* \return TRUE on success, FALSE on failure. |
| 50 |
*/ |
| 51 |
virtual bool unloadModule (XAP_Module * module) { return false; } |
| 52 |
}; |
| 53 |
|
| 54 |
#endif /* XAP_MODULE_FACTORY_H */ |