[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project

src/klfpluginiface.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   file klfpluginiface.h
00003  *   This file is part of the KLatexFormula Project.
00004  *   Copyright (C) 2009 by Philippe Faist
00005  *   philippe.faist at bluewin.ch
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 /* $Id: klfpluginiface.h 410 2010-07-09 22:38:27Z philippe $ */
00023 
00024 #ifndef KLFPLUGINIFACE_H
00025 #define KLFPLUGINIFACE_H
00026 
00027 #include <QObject>
00028 #include <QString>
00029 #include <QVariant>
00030 
00031 #include <qapplication.h>
00032 
00033 
00034 class KLFMainWin;
00035 class KLFPluginConfigAccess;
00036 
00037 
00040 class KLFPluginGenericInterface
00041 {
00042 public:
00043   virtual ~KLFPluginGenericInterface() { }
00044 
00045   enum PluginInfo {
00046     PluginName,
00047     PluginTitle,
00048     PluginAuthor,
00049     PluginDescription,
00050     PluginDefaultEnable,
00051   };
00052 
00053   virtual QVariant pluginInfo(PluginInfo which) const = 0;
00054 
00055   inline QString pluginName() const { return pluginInfo(PluginName).toString(); }
00056   inline QString pluginTitle() const { return pluginInfo(PluginTitle).toString(); }
00057   inline QString pluginAuthor() const { return pluginInfo(PluginAuthor).toString(); }
00058   inline QString pluginDescription() const { return pluginInfo(PluginDescription).toString(); }
00059   inline bool pluginDefaultLoadEnable() const { return pluginInfo(PluginDefaultEnable).toBool(); }
00060 
00061   virtual void initialize(QApplication *app, KLFMainWin *mainWin, KLFPluginConfigAccess *config) = 0;
00062 
00063   virtual QWidget * createConfigWidget(QWidget *parent) = 0;
00064 
00065   virtual void loadFromConfig(QWidget *configWidget, KLFPluginConfigAccess *config) = 0;
00066   virtual void saveToConfig(QWidget *configWidget, KLFPluginConfigAccess *config) = 0;
00067 
00068 };
00069 
00070 Q_DECLARE_INTERFACE(KLFPluginGenericInterface,
00071                     "org.klatexformula.KLatexFormula.Plugin.GenericInterface/1.1");
00072 
00073 #endif

Generated by doxygen 1.7.3