Subversion Repositories Scribus

Rev

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