umbrello API Documentation

plugin.h

00001 /***************************************************************************
00002                           plugin.h
00003                              -------------------
00004     begin                : Mon Jan 13 2003
00005     copyright            : (C) 2003 by Andrew Sutton
00006     email                : ansutton@kent.edu
00007   Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
00008 ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef UMBRELLO_PLUGIN_H
00020 #define UMBRELLO_PLUGIN_H
00021 
00022 // Qt includes
00023 #include <qobject.h>
00024 
00025 // KDE includes
00026 #include <kgenericfactory.h>
00027 
00028 // local includes
00029 #include "configurable.h"
00030 
00031 // forward declarations
00032 class QStringList;
00033 class KConfig;
00034 
00049 #define UMBRELLO_EXPORT_PLUGIN_FACTORY(libname, factory) \
00050         extern "C" { KDE_EXPORT void *init_##libname() { return new factory(#libname); } }
00051 
00052 namespace Umbrello
00053 {
00054 // forward declarations
00055 class PluginLoader;
00056 
00087 class Plugin :
00088             public QObject,
00089             public Configurable
00090 {
00091     Q_OBJECT
00092     friend class PluginLoader;
00093 public:
00095     virtual ~Plugin();
00096 
00098     QCString instanceName() const;
00099 
00101     KConfig *config();
00102 
00104     virtual QString category();
00105 
00111     void unload();
00112 
00113 protected:
00115     Plugin(QObject *parent, const char *name, const QStringList &args);
00116 
00118     virtual bool onInit();
00119 
00121     virtual bool onShutdown();
00122 
00123 private:
00132     bool init();
00133 
00141     bool shutdown();
00142 
00151     virtual bool configure();
00152 
00154     void ref();
00155 
00156 protected:
00157     uint        _ref;           
00158     QCString    _instanceName;  
00159     KConfig    *_config;        
00160 };
00161 }
00162 
00163 #endif
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:59 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003