Some name cleanup to QrEncode backend.
This commit is contained in:
@@ -22,9 +22,7 @@
|
|||||||
|
|
||||||
#include "glbarcode/Factory.h"
|
#include "glbarcode/Factory.h"
|
||||||
|
|
||||||
#if HAVE_QRENCODE
|
|
||||||
#include "BarcodeBackends/QrEncode.h"
|
#include "BarcodeBackends/QrEncode.h"
|
||||||
#endif // HAVE_QRENCODE
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
@@ -80,7 +78,7 @@ namespace glabels
|
|||||||
//
|
//
|
||||||
registerBackend( "qrencode", "QREncode" );
|
registerBackend( "qrencode", "QREncode" );
|
||||||
|
|
||||||
glbarcode::Factory::registerType( "qrencode::qrcode", barcode::QrEncode::createQrCode );
|
glbarcode::Factory::registerType( "qrencode::qrcode", QrEncode::QrCode::create );
|
||||||
|
|
||||||
registerStyle( "qrcode", "qrencode", tr("IEC18004 (QRCode)"),
|
registerStyle( "qrcode", "qrencode", tr("IEC18004 (QRCode)"),
|
||||||
false, false, true, false, "1234567890AB", false, 12 );
|
false, false, true, false, "1234567890AB", false, 12 );
|
||||||
|
|||||||
@@ -27,22 +27,22 @@
|
|||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
namespace barcode
|
namespace QrEncode
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Static QrCode barcode creation method
|
* Static QrCode barcode creation method
|
||||||
*/
|
*/
|
||||||
glbarcode::Barcode* QrEncode::createQrCode()
|
glbarcode::Barcode* QrCode::create()
|
||||||
{
|
{
|
||||||
return new QrEncode();
|
return new QrCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* QrEncode data validation, implements glbarcode::Barcode2dBase::validate()
|
* QrCode data validation, implements glbarcode::Barcode2dBase::validate()
|
||||||
*/
|
*/
|
||||||
bool QrEncode::validate( const std::string& rawData )
|
bool QrCode::validate( const std::string& rawData )
|
||||||
{
|
{
|
||||||
if ( rawData.size() == 0 )
|
if ( rawData.size() == 0 )
|
||||||
{
|
{
|
||||||
@@ -53,9 +53,9 @@ namespace glabels
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* QrEncode data encoding, implements glbarcode::Barcode2dBase::encode()
|
* QrCode data encoding, implements glbarcode::Barcode2dBase::encode()
|
||||||
*/
|
*/
|
||||||
bool QrEncode::encode( const std::string& cookedData, glbarcode::Matrix<bool>& encodedData )
|
bool QrCode::encode( const std::string& cookedData, glbarcode::Matrix<bool>& encodedData )
|
||||||
{
|
{
|
||||||
QRcode *qrcode = QRcode_encodeString( cookedData.c_str(), 0, QR_ECLEVEL_M, QR_MODE_8, 1 );
|
QRcode *qrcode = QRcode_encodeString( cookedData.c_str(), 0, QR_ECLEVEL_M, QR_MODE_8, 1 );
|
||||||
if ( qrcode == NULL )
|
if ( qrcode == NULL )
|
||||||
|
|||||||
@@ -21,35 +21,37 @@
|
|||||||
#ifndef barcode_QrEncode_h
|
#ifndef barcode_QrEncode_h
|
||||||
#define barcode_QrEncode_h
|
#define barcode_QrEncode_h
|
||||||
|
|
||||||
|
#if HAVE_QRENCODE
|
||||||
|
|
||||||
#include "glbarcode/Barcode2dBase.h"
|
#include "glbarcode/Barcode2dBase.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
namespace barcode
|
namespace QrEncode
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LibQREncode barcode backend
|
* QrEncode::QrCode QR Code Barcode
|
||||||
*
|
*
|
||||||
* Implements glbarcode::Barcode2dBase.
|
* Implements glbarcode::Barcode2dBase.
|
||||||
*/
|
*/
|
||||||
class QrEncode : public glbarcode::Barcode2dBase
|
class QrCode : public glbarcode::Barcode2dBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static Barcode* createQrCode();
|
static Barcode* create();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool validate( const std::string& rawData ) override;
|
bool validate( const std::string& rawData ) override;
|
||||||
|
|
||||||
bool encode( const std::string& cookedData,
|
bool encode( const std::string& cookedData,
|
||||||
glbarcode::Matrix<bool>& encodedData ) override;
|
glbarcode::Matrix<bool>& encodedData ) override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // HAVE_QRENCODE
|
||||||
|
|
||||||
#endif // barcode_QrEncode_h
|
#endif // barcode_QrEncode_h
|
||||||
|
|||||||
+12
-12
@@ -744,62 +744,62 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>glabels::BarcodeBackends</name>
|
<name>glabels::BarcodeBackends</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="56"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="54"/>
|
||||||
<source>POSTNET (any)</source>
|
<source>POSTNET (any)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="59"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="57"/>
|
||||||
<source>POSTNET-5 (ZIP only)</source>
|
<source>POSTNET-5 (ZIP only)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="62"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="60"/>
|
||||||
<source>POSTNET-9 (ZIP+4)</source>
|
<source>POSTNET-9 (ZIP+4)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="65"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="63"/>
|
||||||
<source>POSTNET-11 (DPBC)</source>
|
<source>POSTNET-11 (DPBC)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="68"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="66"/>
|
||||||
<source>CEPNET</source>
|
<source>CEPNET</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="71"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="69"/>
|
||||||
<source>USPS Intelligent Mail</source>
|
<source>USPS Intelligent Mail</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="74"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="72"/>
|
||||||
<source>IEC16022 (DataMatrix)</source>
|
<source>IEC16022 (DataMatrix)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="85"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="83"/>
|
||||||
<source>IEC18004 (QRCode)</source>
|
<source>IEC18004 (QRCode)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="44"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="42"/>
|
||||||
<source>Code 39</source>
|
<source>Code 39</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="47"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="45"/>
|
||||||
<source>Code 39 Extended</source>
|
<source>Code 39 Extended</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="50"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="48"/>
|
||||||
<source>UPC-A</source>
|
<source>UPC-A</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="53"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="51"/>
|
||||||
<source>EAN-13</source>
|
<source>EAN-13</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
Reference in New Issue
Block a user