impositionplugin.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 /*************************************************************************** 00008 begin : Jun 2007 00009 copyright : (C) 2007 by Mateusz Haligowski 00010 email : halish@kofeina.org 00011 ***************************************************************************/ 00012 00013 /*************************************************************************** 00014 * * 00015 * This program is free software; you can redistribute it and/or modify * 00016 * it under the terms of the GNU General Public License as published by * 00017 * the Free Software Foundation; either version 2 of the License, or * 00018 * (at your option) any later version. * 00019 * * 00020 ***************************************************************************/ 00021 #include "impositionplugin.h" 00022 //#include "impositionplugin.moc" 00023 #include "imposition.h" 00024 #include "scribuscore.h" 00025 #include "scribusdoc.h" 00026 00027 ImpositionPlugin::ImpositionPlugin() : ScActionPlugin() 00028 { 00029 languageChange(); 00030 } 00031 00032 ImpositionPlugin::~ImpositionPlugin() {}; 00033 00034 void ImpositionPlugin::languageChange() 00035 { 00036 m_actionInfo.name = "Imposition"; 00037 m_actionInfo.text = tr("&Imposition..."); 00038 m_actionInfo.menu = "Extras"; 00039 m_actionInfo.enabledOnStartup = false; 00040 m_actionInfo.needsNumObjects = -1; 00041 } 00042 00043 bool ImpositionPlugin::run(QWidget* parent, ScribusDoc* doc, QString target) 00044 { 00045 if (doc==NULL) 00046 return false; 00047 Imposition *imp = new Imposition(parent,doc); 00048 imp->exec(); 00049 00050 return true; 00051 } 00052 00053 bool ImpositionPlugin::run(ScribusDoc* doc, QString target) 00054 { 00055 ScribusMainWindow* scmw=(doc==0)?ScCore->primaryMainWindow():doc->scMW(); 00056 return run(scmw, doc, target); 00057 } 00058 00059 const QString ImpositionPlugin::fullTrName() const 00060 { 00061 return QObject::tr("Imposition"); 00062 } 00063 00064 const ScActionPlugin::AboutData* ImpositionPlugin::getAboutData() const 00065 { 00066 AboutData* about = new AboutData; 00067 Q_CHECK_PTR(about); 00068 about->authors = QString::fromUtf8("Mateusz Haligowski <halish@kofeina.org>"); 00069 about->shortDescription = tr("Imposition dialog"); 00070 about->description = tr("Imposition on grids, booklets and folds"); 00071 // about->version 00072 // about->releaseDate 00073 // about->copyright 00074 about->license = "GPL"; 00075 return about; 00076 } 00077 00078 void ImpositionPlugin::deleteAboutData(const AboutData* about) const 00079 { 00080 Q_ASSERT(about); 00081 delete about; 00082 } 00083 00084 int imposition_getPluginAPIVersion() 00085 { 00086 return PLUGIN_API_VERSION; 00087 } 00088 00089 ScPlugin* imposition_getPlugin() 00090 { 00091 ImpositionPlugin* plug = new ImpositionPlugin(); 00092 Q_CHECK_PTR(plug); 00093 return plug; 00094 } 00095 00096 void imposition_freePlugin(ScPlugin* plugin) 00097 { 00098 ImpositionPlugin* plug = dynamic_cast<ImpositionPlugin*>(plugin); 00099 Q_ASSERT(plug); 00100 delete plug; 00101 }
