Back to index

scribus-ng  1.3.4.dfsg+svn20071115
scplugin.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #include "scplugin.h"
00008 #include "qwidget.h"
00009 #include "deferredtask.h"
00010 #include "scribus.h"
00011 #include "scribusapp.h"
00012 #include "prefspanel.h"
00013 
00014 #include "scplugin.moc"
00015 
00016 //=====================================================//
00017 //                        ScPlugin                     //
00018 //=====================================================//
00019 
00020 ScPlugin::ScPlugin()
00021        : QObject(0)
00022 {
00023 }
00024 
00025 ScPlugin::~ScPlugin()
00026 {
00027 }
00028 
00029 bool ScPlugin::newPrefsPanelWidget( QWidget* /* parent */,
00030                                                                PrefsPanel*& /* panel */,
00031                                                                QString& /* caption */,
00032                                                                QPixmap& /* icon */)
00033 {
00034        return false;
00035 }
00036 
00037 const QString & ScPlugin::lastError() const
00038 {
00039        return m_lastError;
00040 }
00041 
00042 const QString ScPlugin::pluginTypeName() const
00043 {
00044        // These tests must be in reverse order of inheritance,
00045        // ie most specific to least specific.
00046        if (inherits("LoadSavePlugin"))
00047               return tr("Load/Save/Import/Export");
00048        else if (inherits("ScPersistentPlugin"))
00049               return tr("Persistent", "plugin manager plugin type");
00050        else if (inherits("ScActionPlugin"))
00051               return tr("Action", "plugin manager plugin type");
00052        else
00053        {
00054               qDebug("Unknown plugin type: %s", className());
00055               return tr("Unknown");
00056        }
00057 }
00058 
00059 //=====================================================//
00060 //                   ScActionPlugin              //
00061 //=====================================================//
00062 
00063 ScActionPlugin::ScActionPlugin() : ScPlugin()
00064 {
00065 }
00066 
00067 ScActionPlugin::~ScActionPlugin()
00068 {
00069 }
00070 
00071 // Stub for plugins that don't implement this method to inherit
00072 bool ScActionPlugin::run(ScribusDoc* /*doc*/, QIODevice* /* target */)
00073 {
00074        return false;
00075 }
00076 
00077 bool ScActionPlugin::run(QWidget *, ScribusDoc* /*doc*/, QString /* target */)
00078 {
00079        return false;
00080 }
00081 
00082 // Stub for plugins that don't implement this method to inherit
00083 DeferredTask* ScActionPlugin::runAsync(QString /* target */)
00084 {
00085        return 0;
00086 }
00087 
00088 
00089 // Stub for plugins that don't implement this method to inherit
00090 DeferredTask* ScActionPlugin::runAsync(QIODevice* /* target */)
00091 {
00092        return 0;
00093 }
00094 
00095 // Legacy code support; avoid relying on in new code.
00096 const QString & ScActionPlugin::runResult() const
00097 {
00098        return m_runResult;
00099 }
00100 
00101 const ScActionPlugin::ActionInfo & ScActionPlugin::actionInfo() const
00102 {
00103        Q_ASSERT(!m_actionInfo.text.isNull());
00104        return m_actionInfo;
00105 }
00106 
00107 //=====================================================//
00108 //                   ScActionPlugin              //
00109 //=====================================================//
00110 
00111 ScPersistentPlugin::ScPersistentPlugin()
00112        : ScPlugin()
00113 {
00114 }
00115 
00116 ScPersistentPlugin::~ScPersistentPlugin()
00117 {
00118 }