Subversion Repositories Scribus

Rev

Rev 19066 | Rev 19179 | 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"
11027 fschmid 10
#include "scribusstructs.h"
18624 fschmid 11
#include "util_icon.h"
4460 subik 12
 
13
Barcode::Barcode() : ScActionPlugin()
14
{
15
        languageChange();
16
}
17
 
18
Barcode::~Barcode() {};
19
 
20
void Barcode::languageChange()
21
{
18571 craig 22
        m_actionInfo.name = "BarcodeGenerator";
19118 craig 23
        m_actionInfo.text = tr("Barcode");
10956 fschmid 24
        m_actionInfo.menu = "Insert";
18615 fschmid 25
        m_actionInfo.menuAfterName = "toolsInsertRenderFrame";
18624 fschmid 26
        m_actionInfo.toolbar = "Tools";
27
        m_actionInfo.icon1 = loadIcon("16/insert-barcode.png");
28
        m_actionInfo.icon2 = loadIcon("22/insert-barcode.png");
12566 cbradney 29
        m_actionInfo.enabledOnStartup = false;
19066 craig 30
//      m_actionInfo.forAppMode.append(modeNormal);
10956 fschmid 31
        m_actionInfo.needsNumObjects = -1;
4460 subik 32
}
33
 
34
const QString Barcode::fullTrName() const
35
{
36
        return QObject::tr("Barcode Generator");
37
}
38
 
39
const ScActionPlugin::AboutData* Barcode::getAboutData() const
40
{
41
        AboutData* about = new AboutData;
42
        Q_CHECK_PTR(about);
43
        about->authors = QString::fromUtf8("Terry Burton - <tez@terryburton.co.uk>, Petr Van\xc4\x9bk <petr@scribus.info>");
12804 cbradney 44
        about->shortDescription = tr("Scribus frontend for Pure PostScript Barcode Writer");
45
        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/";
18800 fschmid 46
        about->version = "Backend: 2014-01-30";
4460 subik 47
        // about->releaseDate
18800 fschmid 48
        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 49
        about->license = "Backend: MIT/X-Consortium, Frontend: GPL";
50
        return about;
51
}
52
 
53
void Barcode::deleteAboutData(const AboutData* about) const
54
{
55
        Q_ASSERT(about);
56
        delete about;
57
}
58
 
12565 cbradney 59
bool Barcode::run(ScribusDoc* doc, QString /*target*/ )
4460 subik 60
{
12565 cbradney 61
        if (!doc)
62
                return false;
4460 subik 63
        BarcodeGenerator *bg = new BarcodeGenerator();
64
        Q_CHECK_PTR(bg);
65
        bg->exec();
66
        delete bg;
67
        return true;
68
}
69
 
70
int barcodegenerator_getPluginAPIVersion()
71
{
72
        return PLUGIN_API_VERSION;
73
}
74
 
75
ScPlugin* barcodegenerator_getPlugin()
76
{
77
        Barcode* plug = new Barcode();
78
        Q_CHECK_PTR(plug);
79
        return plug;
80
}
81
 
82
void barcodegenerator_freePlugin(ScPlugin* plugin)
83
{
84
        Barcode* plug = dynamic_cast<Barcode*>(plugin);
85
        Q_ASSERT(plug);
86
        delete plug;
87
}