Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

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 
00009 #include "deferredtask.h"
00010 #include "scribus.h"
00011 #include "scribusapp.h"
00012 #include "prefspanel.h"
00013 
00014 //=====================================================//
00015 //                        ScPlugin                     //
00016 //=====================================================//
00017 
00018 ScPlugin::ScPlugin()
00019     : QObject(0)
00020 {
00021 }
00022 
00023 ScPlugin::~ScPlugin()
00024 {
00025 }
00026 
00027 bool ScPlugin::newPrefsPanelWidget( QWidget* /* parent */,
00028                                     PrefsPanel*& /* panel */,
00029                                     QString& /* caption */,
00030                                     QPixmap& /* icon */)
00031 {
00032     return false;
00033 }
00034 
00035 const QString & ScPlugin::lastError() const
00036 {
00037     return m_lastError;
00038 }
00039 
00040 const QString ScPlugin::pluginTypeName() const
00041 {
00042     // These tests must be in reverse order of inheritance,
00043     // ie most specific to least specific.
00044     if (inherits("LoadSavePlugin"))
00045         return tr("Load/Save/Import/Export");
00046     else if (inherits("ScPersistentPlugin"))
00047         return tr("Persistent", "plugin manager plugin type");
00048     else if (inherits("ScActionPlugin"))
00049         return tr("Action", "plugin manager plugin type");
00050     else
00051     {
00052         qDebug("Unknown plugin type: %s", metaObject()->className());
00053         return tr("Unknown");
00054     }
00055 }
00056 
00057 //=====================================================//
00058 //                   ScActionPlugin              //
00059 //=====================================================//
00060 
00061 ScActionPlugin::ScActionPlugin() : ScPlugin()
00062 {
00063     m_actionInfo.name = "";
00064     m_actionInfo.text = "";
00065     m_actionInfo.keySequence = "";
00066     m_actionInfo.menu = "";
00067     m_actionInfo.menuAfterName = "";
00068     m_actionInfo.parentMenu = "";
00069     m_actionInfo.subMenuName = "";
00070     m_actionInfo.toolbar = "";
00071     m_actionInfo.toolBarName = "";
00072     m_actionInfo.icon1 = QPixmap();
00073     m_actionInfo.icon2 = QPixmap();
00074     m_actionInfo.notSuitableFor.clear();
00075     m_actionInfo.forAppMode.clear();
00076     m_actionInfo.needsNumObjects = -1;
00077     m_actionInfo.firstObjectType.clear();
00078     m_actionInfo.secondObjectType.clear();
00079     m_actionInfo.enabledOnStartup = true;
00080 }
00081 
00082 ScActionPlugin::~ScActionPlugin()
00083 {
00084 }
00085 
00086 // Stub for plugins that don't implement this method to inherit
00087 bool ScActionPlugin::run(ScribusDoc* /*doc*/, QIODevice* /* target */)
00088 {
00089     return false;
00090 }
00091 
00092 bool ScActionPlugin::run(QWidget *, ScribusDoc* /*doc*/, QString /* target */)
00093 {
00094     return false;
00095 }
00096 
00097 // Stub for plugins that don't implement this method to inherit
00098 DeferredTask* ScActionPlugin::runAsync(QString /* target */)
00099 {
00100     return 0;
00101 }
00102 
00103 
00104 // Stub for plugins that don't implement this method to inherit
00105 DeferredTask* ScActionPlugin::runAsync(QIODevice* /* target */)
00106 {
00107     return 0;
00108 }
00109 
00110 // Legacy code support; avoid relying on in new code.
00111 const QString & ScActionPlugin::runResult() const
00112 {
00113     return m_runResult;
00114 }
00115 
00116 const ScActionPlugin::ActionInfo & ScActionPlugin::actionInfo() const
00117 {
00118     Q_ASSERT(!m_actionInfo.text.isNull());
00119     return m_actionInfo;
00120 }
00121 
00122 //=====================================================//
00123 //                   ScActionPlugin              //
00124 //=====================================================//
00125 
00126 ScPersistentPlugin::ScPersistentPlugin()
00127     : ScPlugin()
00128 {
00129 }
00130 
00131 ScPersistentPlugin::~ScPersistentPlugin()
00132 {
00133 }
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.