Seamly2D
Code documentation
VLabelTemplateConverter Class Reference

#include <vlabeltemplateconverter.h>

Inheritance diagram for VLabelTemplateConverter:
Collaboration diagram for VLabelTemplateConverter:

Public Member Functions

 VLabelTemplateConverter (const QString &fileName)
 
virtual ~VLabelTemplateConverter () Q_DECL_EQ_DEFAULT
 
- Public Member Functions inherited from VAbstractConverter
 VAbstractConverter (const QString &fileName)
 
virtual ~VAbstractConverter () Q_DECL_EQ_DEFAULT
 
QString Convert ()
 
int GetCurrentFormatVarsion () const
 
QString GetVersionStr () const
 
- Public Member Functions inherited from VDomDocument
 VDomDocument ()
 
virtual ~VDomDocument () Q_DECL_EQ_DEFAULT
 
QDomElement elementById (quint32 id, const QString &tagName=QString())
 
template<typename T >
void SetAttribute (QDomElement &domElement, const QString &name, const T &value) const
 SetAttribute set attribute in pattern file. Replace "," by ".". More...
 
Unit MUnit () const
 
virtual void setXMLContent (const QString &fileName)
 
virtual bool SaveDocument (const QString &fileName, QString &error)
 
QString Major () const
 
QString Minor () const
 
QString Patch () const
 
QDomNode ParentNodeById (const quint32 &nodeId)
 
QDomElement CloneNodeById (const quint32 &nodeId)
 
QDomElement NodeById (const quint32 &nodeId)
 
QVector< VLabelTemplateLineGetLabelTemplate (const QDomElement &element) const
 
void SetLabelTemplate (QDomElement &element, const QVector< VLabelTemplateLine > &lines)
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const QString &value) const
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const bool &value) const
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const MeasurementsType &value) const
 

Static Public Attributes

static const QString LabelTemplateMaxVerStr = QStringLiteral("1.0.0")
 
static const QString CurrentSchema = QStringLiteral("://schema/label_template/v1.0.0.xsd")
 
static Q_DECL_CONSTEXPR const int LabelTemplateMinVer = (( 1 <<16)|( 0 <<8)|( 0 ))
 
static Q_DECL_CONSTEXPR const int LabelTemplateMaxVer = (( 1 <<16)|( 0 <<8)|( 0 ))
 
- Static Public Attributes inherited from VDomDocument
static const QString AttrId = QStringLiteral("id")
 
static const QString AttrText = QStringLiteral("text")
 
static const QString AttrBold = QStringLiteral("bold")
 
static const QString AttrItalic = QStringLiteral("italic")
 
static const QString AttrAlignment = QStringLiteral("alignment")
 
static const QString AttrFSIncrement = QStringLiteral("sfIncrement")
 
static const QString TagVersion = QStringLiteral("version")
 
static const QString TagUnit = QStringLiteral("unit")
 
static const QString TagLine = QStringLiteral("line")
 

Protected Member Functions

virtual int MinVer () const Q_DECL_OVERRIDE
 
virtual int MaxVer () const Q_DECL_OVERRIDE
 
virtual QString MinVerStr () const Q_DECL_OVERRIDE
 
virtual QString MaxVerStr () const Q_DECL_OVERRIDE
 
virtual QString XSDSchema (int ver) const Q_DECL_OVERRIDE
 
virtual void ApplyPatches () Q_DECL_OVERRIDE
 
virtual void DowngradeToCurrentMaxVersion () Q_DECL_OVERRIDE
 
virtual bool IsReadOnly () const Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from VAbstractConverter
void ValidateInputFile (const QString &currentSchema) const
 
Q_NORETURN void InvalidVersion (int ver) const
 
void Save ()
 
void SetVersion (const QString &version)
 
void Replace (QString &formula, const QString &newName, int position, const QString &token, int &bias) const
 
void CorrectionsPositions (int position, int bias, QMap< int, QString > &tokens) const
 
- Protected Member Functions inherited from VDomDocument
bool setTagText (const QString &tag, const QString &text)
 
bool setTagText (const QDomElement &domElement, const QString &text)
 
QString UniqueTagText (const QString &tagName, const QString &defVal=QString()) const
 
void TestUniqueId () const
 TestUniqueId test exist unique id in pattern file. Each id must be unique. More...
 
void CollectId (const QDomElement &node, QVector< quint32 > &vector) const
 

Static Private Attributes

static const QString LabelTemplateMinVerStr = QStringLiteral("1.0.0")
 

Additional Inherited Members

- Static Public Member Functions inherited from VAbstractConverter
static int GetVersion (const QString &version)
 
- Static Public Member Functions inherited from VDomDocument
static quint32 GetParametrUInt (const QDomElement &domElement, const QString &name, const QString &defValue)
 Returns the long long value of the given attribute. RENAME: GetParameterLongLong? More...
 
static bool getParameterBool (const QDomElement &domElement, const QString &name, const QString &defValue)
 
static NodeUsage GetParametrUsage (const QDomElement &domElement, const QString &name)
 
static void SetParametrUsage (QDomElement &domElement, const QString &name, const NodeUsage &value)
 
static QString GetParametrString (const QDomElement &domElement, const QString &name, const QString &defValue=QString())
 Returns the string value of the given attribute. RENAME: see above. More...
 
static QString GetParametrEmptyString (const QDomElement &domElement, const QString &name)
 
static qreal GetParametrDouble (const QDomElement &domElement, const QString &name, const QString &defValue)
 Returns the double value of the given attribute. More...
 
static quint32 getParameterId (const QDomElement &domElement)
 getParameterId return value id attribute. More...
 
static void ValidateXML (const QString &schema, const QString &fileName)
 ValidateXML validate xml file by xsd schema. More...
 
static QString UnitsHelpString ()
 
static void RemoveAllChildren (QDomElement &domElement)
 RemoveAllChildren remove all children from file. More...
 
static bool SafeCopy (const QString &source, const QString &destination, QString &error)
 
- Static Protected Member Functions inherited from VAbstractConverter
static void BiasTokens (int position, int bias, QMap< int, QString > &tokens)
 
- Protected Attributes inherited from VAbstractConverter
int m_ver
 
QString m_convertedFileName
 

Detailed Description

Definition at line 57 of file vlabeltemplateconverter.h.

Constructor & Destructor Documentation

◆ VLabelTemplateConverter()

VLabelTemplateConverter::VLabelTemplateConverter ( const QString &  fileName)
explicit

◆ ~VLabelTemplateConverter()

virtual VLabelTemplateConverter::~VLabelTemplateConverter ( )
virtual

Member Function Documentation

◆ ApplyPatches()

void VLabelTemplateConverter::ApplyPatches ( )
protectedvirtual

◆ DowngradeToCurrentMaxVersion()

void VLabelTemplateConverter::DowngradeToCurrentMaxVersion ( )
protectedvirtual

◆ IsReadOnly()

virtual bool VLabelTemplateConverter::IsReadOnly ( ) const
inlineprotectedvirtual

Implements VAbstractConverter.

Definition at line 79 of file vlabeltemplateconverter.h.

◆ MaxVer()

int VLabelTemplateConverter::MaxVer ( ) const
protectedvirtual

Implements VAbstractConverter.

Definition at line 83 of file vlabeltemplateconverter.cpp.

References LabelTemplateMaxVer.

◆ MaxVerStr()

QString VLabelTemplateConverter::MaxVerStr ( ) const
protectedvirtual

Implements VAbstractConverter.

Definition at line 95 of file vlabeltemplateconverter.cpp.

References LabelTemplateMaxVerStr.

◆ MinVer()

int VLabelTemplateConverter::MinVer ( ) const
protectedvirtual

Implements VAbstractConverter.

Definition at line 77 of file vlabeltemplateconverter.cpp.

References LabelTemplateMinVer.

◆ MinVerStr()

QString VLabelTemplateConverter::MinVerStr ( ) const
protectedvirtual

Implements VAbstractConverter.

Definition at line 89 of file vlabeltemplateconverter.cpp.

References LabelTemplateMinVerStr.

◆ XSDSchema()

QString VLabelTemplateConverter::XSDSchema ( int  ver) const
protectedvirtual

Member Data Documentation

◆ CurrentSchema

const QString VLabelTemplateConverter::CurrentSchema = QStringLiteral("://schema/label_template/v1.0.0.xsd")
static

Definition at line 64 of file vlabeltemplateconverter.h.

Referenced by VLabelTemplateConverter(), and XSDSchema().

◆ LabelTemplateMaxVer

Q_DECL_CONSTEXPR const int VLabelTemplateConverter::LabelTemplateMaxVer = (( 1 <<16)|( 0 <<8)|( 0 ))
static

Definition at line 66 of file vlabeltemplateconverter.h.

Referenced by MaxVer().

◆ LabelTemplateMaxVerStr

const QString VLabelTemplateConverter::LabelTemplateMaxVerStr = QStringLiteral("1.0.0")
static

◆ LabelTemplateMinVer

Q_DECL_CONSTEXPR const int VLabelTemplateConverter::LabelTemplateMinVer = (( 1 <<16)|( 0 <<8)|( 0 ))
static

Definition at line 65 of file vlabeltemplateconverter.h.

Referenced by MinVer().

◆ LabelTemplateMinVerStr

const QString VLabelTemplateConverter::LabelTemplateMinVerStr = QStringLiteral("1.0.0")
staticprivate

Definition at line 83 of file vlabeltemplateconverter.h.

Referenced by MinVerStr().


The documentation for this class was generated from the following files: