Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

barcode.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 #include "barcode.h"
00009 //#include "barcode.moc"
00010 #include "barcodegenerator.h"
00011 #include "scribusstructs.h"
00012 
00013 Barcode::Barcode() : ScActionPlugin()
00014 {
00015     languageChange();
00016 }
00017 
00018 Barcode::~Barcode() {};
00019 
00020 void Barcode::languageChange()
00021 {
00022     m_actionInfo.name = "Barcode Generator";
00023     m_actionInfo.text = tr("&Barcode...");
00024     m_actionInfo.menu = "Insert";
00025     m_actionInfo.enabledOnStartup = true;
00026     m_actionInfo.forAppMode.append(modeNormal);
00027     m_actionInfo.needsNumObjects = -1;
00028 }
00029 
00030 const QString Barcode::fullTrName() const
00031 {
00032     return QObject::tr("Barcode Generator");
00033 }
00034 
00035 const ScActionPlugin::AboutData* Barcode::getAboutData() const
00036 {
00037     AboutData* about = new AboutData;
00038     Q_CHECK_PTR(about);
00039     about->authors = QString::fromUtf8("Terry Burton - <tez@terryburton.co.uk>, Petr Van\xc4\x9bk <petr@scribus.info>");
00040     about->shortDescription = tr("Scribus frontend for Pure Postscript Barcode Writer");
00041     about->description = "Barcode Writer in Pure Postscript is an award-winning open source barcode maker, as used by NASA, that facilitates the printing of all major barcode symbologies entirely within level 2 PostScript, ideal for variable data printing. The complete process of generating printed barcodes is performed entirely within the printer (or print system) so that it is no longer the responsibility of your application or a library. There is no need for any barcode fonts and the flexibility offered by direct PostScript means you can avoid re-implementing barcode generator code, or migrating to new libraries, whenever your project language needs change.\nhttp://www.terryburton.co.uk/barcodewriter/";
00042     about->version = "Backend: 2006-01-17";
00043     // about->releaseDate
00044     about->copyright = QString::fromUtf8("Backend: Copyright (c) 2005 Terry Burton - tez@terryburton.co.uk\nFrontend: Copyright (c) 2005 Petr Van\xc4\x9bk - petr@scribus.info");
00045     about->license = "Backend: MIT/X-Consortium, Frontend: GPL";
00046     return about;
00047 }
00048 
00049 void Barcode::deleteAboutData(const AboutData* about) const
00050 {
00051     Q_ASSERT(about);
00052     delete about;
00053 }
00054 
00055 bool Barcode::run(ScribusDoc*, QString /*target*/ )
00056 {
00057     BarcodeGenerator *bg = new BarcodeGenerator();
00058     Q_CHECK_PTR(bg);
00059     bg->exec();
00060     delete bg;
00061     return true;
00062 }
00063 
00064 int barcodegenerator_getPluginAPIVersion()
00065 {
00066     return PLUGIN_API_VERSION;
00067 }
00068 
00069 ScPlugin* barcodegenerator_getPlugin()
00070 {
00071     Barcode* plug = new Barcode();
00072     Q_CHECK_PTR(plug);
00073     return plug;
00074 }
00075 
00076 void barcodegenerator_freePlugin(ScPlugin* plugin)
00077 {
00078     Barcode* plug = dynamic_cast<Barcode*>(plugin);
00079     Q_ASSERT(plug);
00080     delete plug;
00081 }
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.