Subversion Repositories Scribus

Rev

Rev 19179 | Rev 19688 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4460 subik 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
7
 
8
#include "barcode.h"
9
#include "barcodegenerator.h"
19179 craig 10
#include "scribuscore.h"
11027 fschmid 11
#include "scribusstructs.h"
18624 fschmid 12
#include "util_icon.h"
4460 subik 13
 
14
Barcode::Barcode() : ScActionPlugin()
15
{
16
        languageChange();
17
}
18
 
19
Barcode::~Barcode() {};
20
 
21
void Barcode::languageChange()
22
{
18571 craig 23
        m_actionInfo.name = "BarcodeGenerator";
19118 craig 24
        m_actionInfo.text = tr("Barcode");
19445 jghali 25
        m_actionInfo.helpText = tr("Insert a barcode");
19179 craig 26
        if (ScCore->haveGS())
27
        {
28
                m_actionInfo.menu = "Insert";
29
                m_actionInfo.menuAfterName = "toolsInsertRenderFrame";
30
                m_actionInfo.toolbar = "Tools";
31
        }
18624 fschmid 32
        m_actionInfo.icon1 = loadIcon("16/insert-barcode.png");
33
        m_actionInfo.icon2 = loadIcon("22/insert-barcode.png");
12566 cbradney 34
        m_actionInfo.enabledOnStartup = false;
19066 craig 35
//      m_actionInfo.forAppMode.append(modeNormal);
10956 fschmid 36
        m_actionInfo.needsNumObjects = -1;
4460 subik 37
}
38
 
39
const QString Barcode::fullTrName() const
40
{
41
        return QObject::tr("Barcode Generator");
42
}
43
 
44
const ScActionPlugin::AboutData* Barcode::getAboutData() const
45
{
46
        AboutData* about = new AboutData;
47
        Q_CHECK_PTR(about);
48
        about->authors = QString::fromUtf8("Terry Burton - <tez@terryburton.co.uk>, Petr Van\xc4\x9bk <petr@scribus.info>");
12804 cbradney 49
        about->shortDescription = tr("Scribus frontend for Pure PostScript Barcode Writer");
19179 craig 50
        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/ . Hence, this plugin requires Ghostscript to be installed on your system.";
18800 fschmid 51
        about->version = "Backend: 2014-01-30";
4460 subik 52
        // about->releaseDate
18800 fschmid 53
        about->copyright = QString::fromUtf8("Backend: Copyright (c) 2004-2014 Terry Burton - tez@terryburton.co.uk\nFrontend: Copyright (c) 2005 Petr Van\xc4\x9bk - petr@scribus.info");
4460 subik 54
        about->license = "Backend: MIT/X-Consortium, Frontend: GPL";
55
        return about;
56
}
57
 
58
void Barcode::deleteAboutData(const AboutData* about) const
59
{
60
        Q_ASSERT(about);
61
        delete about;
62
}
63
 
12565 cbradney 64
bool Barcode::run(ScribusDoc* doc, QString /*target*/ )
4460 subik 65
{
19179 craig 66
        if (!doc || !ScCore->haveGS())
12565 cbradney 67
                return false;
4460 subik 68
        BarcodeGenerator *bg = new BarcodeGenerator();
69
        Q_CHECK_PTR(bg);
70
        bg->exec();
71
        delete bg;
72
        return true;
73
}
74
 
75
int barcodegenerator_getPluginAPIVersion()
76
{
77
        return PLUGIN_API_VERSION;
78
}
79
 
80
ScPlugin* barcodegenerator_getPlugin()
81
{
82
        Barcode* plug = new Barcode();
83
        Q_CHECK_PTR(plug);
84
        return plug;
85
}
86
 
87
void barcodegenerator_freePlugin(ScPlugin* plugin)
88
{
89
        Barcode* plug = dynamic_cast<Barcode*>(plugin);
90
        Q_ASSERT(plug);
91
        delete plug;
92
}