diff --git a/libglabels/Category.cpp b/libglabels/Category.cpp index ef9451f..e396021 100644 --- a/libglabels/Category.cpp +++ b/libglabels/Category.cpp @@ -29,6 +29,18 @@ namespace glabels { } + + QString Category::id() const + { + return mId; + } + + + QString Category::name() const + { + return mName; + } + } diff --git a/libglabels/Category.h b/libglabels/Category.h index a4054ff..a80d91f 100644 --- a/libglabels/Category.h +++ b/libglabels/Category.h @@ -34,8 +34,8 @@ namespace glabels public: Category( const QString& id, const QString& name ); - const QString& id() const; - const QString& name() const; + QString id() const; + QString name() const; private: @@ -47,7 +47,4 @@ namespace glabels } -#include "Category.inl" - - #endif // glabels_Category_h diff --git a/libglabels/Category.inl b/libglabels/Category.inl deleted file mode 100644 index 7838e8a..0000000 --- a/libglabels/Category.inl +++ /dev/null @@ -1,37 +0,0 @@ -/* Category.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline const QString& Category::id() const - { - return mId; - } - - - inline const QString& Category::name() const - { - return mName; - } - -} - diff --git a/libglabels/Db.cpp b/libglabels/Db.cpp index 7a472ff..3d166a6 100644 --- a/libglabels/Db.cpp +++ b/libglabels/Db.cpp @@ -81,6 +81,60 @@ namespace glabels } + const QList& Db::papers() + { + return mPapers; + } + + + const QStringList& Db::paperIds() + { + return mPaperIds; + } + + + const QStringList& Db::paperNames() + { + return mPaperNames; + } + + + const QList& Db::categories() + { + return mCategories; + } + + + const QStringList& Db::categoryIds() + { + return mCategoryIds; + } + + + const QStringList& Db::categoryNames() + { + return mCategoryNames; + } + + + const QList& Db::vendors() + { + return mVendors; + } + + + const QStringList& Db::vendorNames() + { + return mVendorNames; + } + + + const QList& Db::templates() + { + return mTemplates; + } + + void Db::registerPaper( Paper *paper ) { if ( !isPaperIdKnown( paper->id() ) ) @@ -96,7 +150,7 @@ namespace glabels } - const Paper *Db::lookupPaperFromName( const QString &name ) + const Paper *Db::lookupPaperFromName( const QString& name ) { if ( name.isNull() || name.isEmpty() ) { @@ -117,7 +171,7 @@ namespace glabels } - const Paper *Db::lookupPaperFromId( const QString &id ) + const Paper *Db::lookupPaperFromId( const QString& id ) { if ( id.isNull() || id.isEmpty() ) { @@ -138,7 +192,7 @@ namespace glabels } - const QString &Db::lookupPaperIdFromName( const QString &name ) + QString Db::lookupPaperIdFromName( const QString& name ) { if ( !name.isNull() && !name.isEmpty() ) { @@ -154,7 +208,7 @@ namespace glabels } - const QString &Db::lookupPaperNameFromId( const QString &id ) + QString Db::lookupPaperNameFromId( const QString& id ) { if ( !id.isNull() && !id.isEmpty() ) { @@ -175,7 +229,7 @@ namespace glabels } - bool Db::isPaperIdKnown( const QString &id ) + bool Db::isPaperIdKnown( const QString& id ) { foreach ( Paper *paper, mPapers ) { @@ -189,7 +243,7 @@ namespace glabels } - bool Db::isPaperIdOther( const QString &id ) + bool Db::isPaperIdOther( const QString& id ) { return ( id == "Other" ); } @@ -210,7 +264,7 @@ namespace glabels } - const Category *Db::lookupCategoryFromName( const QString &name ) + const Category *Db::lookupCategoryFromName( const QString& name ) { if ( name.isNull() || name.isEmpty() ) { @@ -231,7 +285,7 @@ namespace glabels } - const Category *Db::lookupCategoryFromId( const QString &id ) + const Category *Db::lookupCategoryFromId( const QString& id ) { if ( id.isNull() || id.isEmpty() ) { @@ -252,7 +306,7 @@ namespace glabels } - const QString &Db::lookupCategoryIdFromName( const QString &name ) + QString Db::lookupCategoryIdFromName( const QString& name ) { if ( !name.isNull() && !name.isEmpty() ) { @@ -268,7 +322,7 @@ namespace glabels } - const QString &Db::lookupCategoryNameFromId( const QString &id ) + QString Db::lookupCategoryNameFromId( const QString& id ) { if ( !id.isNull() && !id.isEmpty() ) { @@ -284,7 +338,7 @@ namespace glabels } - bool Db::isCategoryIdKnown( const QString &id ) + bool Db::isCategoryIdKnown( const QString& id ) { foreach ( Category *category, mCategories ) { @@ -312,7 +366,7 @@ namespace glabels } - const Vendor *Db::lookupVendorFromName( const QString &name ) + const Vendor *Db::lookupVendorFromName( const QString& name ) { if ( name.isNull() || name.isEmpty() ) { @@ -333,7 +387,7 @@ namespace glabels } - const QString &Db::lookupVendorUrlFromName( const QString &name ) + QString Db::lookupVendorUrlFromName( const QString& name ) { if ( !name.isNull() && !name.isEmpty() ) { @@ -349,7 +403,7 @@ namespace glabels } - bool Db::isVendorNameKnown( const QString &name ) + bool Db::isVendorNameKnown( const QString& name ) { foreach ( Vendor *vendor, mVendors ) { @@ -377,7 +431,7 @@ namespace glabels } - const Template *Db::lookupTemplateFromName( const QString &name ) + const Template *Db::lookupTemplateFromName( const QString& name ) { if ( name.isNull() || name.isEmpty() ) { @@ -398,7 +452,7 @@ namespace glabels } - const Template *Db::lookupTemplateFromBrandPart( const QString &brand, const QString &part ) + const Template *Db::lookupTemplateFromBrandPart( const QString& brand, const QString& part ) { if ( brand.isNull() || brand.isEmpty() || part.isNull() || part.isEmpty() ) { @@ -419,7 +473,7 @@ namespace glabels } - bool Db::isTemplateKnown( const QString &brand, const QString &part ) + bool Db::isTemplateKnown( const QString& brand, const QString& part ) { foreach ( Template *tmplate, mTemplates ) { @@ -433,7 +487,7 @@ namespace glabels } - QStringList Db::getNameListOfSimilarTemplates( const QString &name ) + QStringList Db::getNameListOfSimilarTemplates( const QString& name ) { QStringList list; @@ -465,13 +519,13 @@ namespace glabels } - void Db::deleteUserTemplateByName( const QString &name ) + void Db::deleteUserTemplateByName( const QString& name ) { // TODO } - void Db::deleteUserTemplateByBrandPart( const QString &brand, const QString &part ) + void Db::deleteUserTemplateByBrandPart( const QString& brand, const QString& part ) { // TODO } @@ -568,7 +622,7 @@ namespace glabels } - void Db::readPapersFromDir( const QDir &dir ) + void Db::readPapersFromDir( const QDir& dir ) { XmlPaperParser parser; @@ -588,7 +642,7 @@ namespace glabels } - void Db::readCategoriesFromDir( const QDir &dir ) + void Db::readCategoriesFromDir( const QDir& dir ) { XmlCategoryParser parser; @@ -608,7 +662,7 @@ namespace glabels } - void Db::readVendorsFromDir( const QDir &dir ) + void Db::readVendorsFromDir( const QDir& dir ) { XmlVendorParser parser; @@ -632,7 +686,7 @@ namespace glabels } - void Db::readTemplatesFromDir( const QDir &dir ) + void Db::readTemplatesFromDir( const QDir& dir ) { QStringList filters; filters << "*-templates.xml" << "*.template"; diff --git a/libglabels/Db.h b/libglabels/Db.h index 35e5d88..1c2947a 100644 --- a/libglabels/Db.h +++ b/libglabels/Db.h @@ -43,6 +43,7 @@ namespace glabels private: Db(); + public: static void init(); static Db* instance(); @@ -63,36 +64,36 @@ namespace glabels static void registerPaper( Paper *paper ); - static const Paper *lookupPaperFromName( const QString &name ); - static const Paper *lookupPaperFromId( const QString &id ); - static const QString &lookupPaperIdFromName( const QString &name ); - static const QString &lookupPaperNameFromId( const QString &id ); - static bool isPaperIdKnown( const QString &id ); - static bool isPaperIdOther( const QString &id ); + static const Paper *lookupPaperFromName( const QString& name ); + static const Paper *lookupPaperFromId( const QString& id ); + static QString lookupPaperIdFromName( const QString& name ); + static QString lookupPaperNameFromId( const QString& id ); + static bool isPaperIdKnown( const QString& id ); + static bool isPaperIdOther( const QString& id ); static void registerCategory( Category *category ); - static const Category *lookupCategoryFromName( const QString &name ); - static const Category *lookupCategoryFromId( const QString &id ); - static const QString &lookupCategoryIdFromName( const QString &name ); - static const QString &lookupCategoryNameFromId( const QString &id ); - static bool isCategoryIdKnown( const QString &id ); + static const Category *lookupCategoryFromName( const QString& name ); + static const Category *lookupCategoryFromId( const QString& id ); + static QString lookupCategoryIdFromName( const QString& name ); + static QString lookupCategoryNameFromId( const QString& id ); + static bool isCategoryIdKnown( const QString& id ); static void registerVendor( Vendor *vendor ); - static const Vendor *lookupVendorFromName( const QString &name ); - static const QString &lookupVendorUrlFromName( const QString &name ); - static bool isVendorNameKnown( const QString &id ); + static const Vendor *lookupVendorFromName( const QString& name ); + static QString lookupVendorUrlFromName( const QString& name ); + static bool isVendorNameKnown( const QString& id ); static void registerTemplate( Template *tmplate ); - static const Template *lookupTemplateFromName( const QString &name ); - static const Template *lookupTemplateFromBrandPart( const QString &brand, - const QString &part ); - static bool isTemplateKnown( const QString &brand, const QString &part ); - static QStringList getNameListOfSimilarTemplates( const QString &name ); + static const Template *lookupTemplateFromName( const QString& name ); + static const Template *lookupTemplateFromBrandPart( const QString& brand, + const QString& part ); + static bool isTemplateKnown( const QString& brand, const QString& part ); + static QStringList getNameListOfSimilarTemplates( const QString& name ); static void registerUserTemplate( Template *tmplate ); - static void deleteUserTemplateByName( const QString &name ); - static void deleteUserTemplateByBrandPart( const QString &brand, - const QString &part ); + static void deleteUserTemplateByName( const QString& name ); + static void deleteUserTemplateByBrandPart( const QString& brand, + const QString& part ); static void printKnownPapers(); static void printKnownCategories(); @@ -104,16 +105,16 @@ namespace glabels static QDir systemTemplatesDir(); static void readPapers(); - static void readPapersFromDir( const QDir &dir ); + static void readPapersFromDir( const QDir& dir ); static void readCategories(); - static void readCategoriesFromDir( const QDir &dir ); + static void readCategoriesFromDir( const QDir& dir ); static void readVendors(); - static void readVendorsFromDir( const QDir &dir ); + static void readVendorsFromDir( const QDir& dir ); static void readTemplates(); - static void readTemplatesFromDir( const QDir &dir ); + static void readTemplatesFromDir( const QDir& dir ); private: @@ -137,7 +138,4 @@ namespace glabels } -#include "Db.inl" - - #endif // glabels_Db_h diff --git a/libglabels/Db.inl b/libglabels/Db.inl deleted file mode 100644 index 9c2dfaf..0000000 --- a/libglabels/Db.inl +++ /dev/null @@ -1,77 +0,0 @@ -/* Db.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline const QList& Db::papers() - { - return mPapers; - } - - - inline const QStringList& Db::paperIds() - { - return mPaperIds; - } - - - inline const QStringList& Db::paperNames() - { - return mPaperNames; - } - - - inline const QList& Db::categories() - { - return mCategories; - } - - - inline const QStringList& Db::categoryIds() - { - return mCategoryIds; - } - - - inline const QStringList& Db::categoryNames() - { - return mCategoryNames; - } - - - inline const QList& Db::vendors() - { - return mVendors; - } - - - inline const QStringList& Db::vendorNames() - { - return mVendorNames; - } - - inline const QList& Db::templates() - { - return mTemplates; - } - -} diff --git a/libglabels/Frame.cpp b/libglabels/Frame.cpp index 387ba89..609e744 100644 --- a/libglabels/Frame.cpp +++ b/libglabels/Frame.cpp @@ -50,6 +50,36 @@ namespace glabels } + QString Frame::id() const + { + return mId; + } + + + int Frame::nLabels() const + { + return mNLabels; + } + + + QString Frame::layoutDescription() const + { + return mLayoutDescription; + } + + + const QList& Frame::layouts() const + { + return mLayouts; + } + + + const QList& Frame::markups() const + { + return mMarkups; + } + + QVector Frame::getOrigins() const { QVector origins( nLabels() ); diff --git a/libglabels/Frame.h b/libglabels/Frame.h index bc914b2..e7dbd71 100644 --- a/libglabels/Frame.h +++ b/libglabels/Frame.h @@ -51,9 +51,9 @@ namespace glabels public: virtual Frame* dup() const = 0; - const QString& id() const; + QString id() const; int nLabels() const; - const QString& layoutDescription() const; + QString layoutDescription() const; const QList& layouts() const; const QList& markups() const; @@ -65,7 +65,7 @@ namespace glabels virtual Distance w() const = 0; virtual Distance h() const = 0; - virtual const QString sizeDescription( const Units& units ) const = 0; + virtual QString sizeDescription( const Units& units ) const = 0; virtual bool isSimilarTo( Frame* other ) const = 0; virtual const QPainterPath& path() const = 0; @@ -85,7 +85,4 @@ namespace glabels } -#include "Frame.inl" - - #endif // glabels_Frame_h diff --git a/libglabels/Frame.inl b/libglabels/Frame.inl deleted file mode 100644 index e585d90..0000000 --- a/libglabels/Frame.inl +++ /dev/null @@ -1,54 +0,0 @@ -/* Frame.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline const QString& Frame::id() const - { - return mId; - } - - - inline int Frame::nLabels() const - { - return mNLabels; - } - - - inline const QString& Frame::layoutDescription() const - { - return mLayoutDescription; - } - - - inline const QList& Frame::layouts() const - { - return mLayouts; - } - - - inline const QList& Frame::markups() const - { - return mMarkups; - } - -} diff --git a/libglabels/FrameCd.cpp b/libglabels/FrameCd.cpp index 14b4fa8..0e1b915 100644 --- a/libglabels/FrameCd.cpp +++ b/libglabels/FrameCd.cpp @@ -117,7 +117,25 @@ namespace glabels } - const QString FrameCd::sizeDescription( const Units& units ) const + Distance FrameCd::r1() const + { + return mR1; + } + + + Distance FrameCd::r2() const + { + return mR2; + } + + + Distance FrameCd::waste() const + { + return mWaste; + } + + + QString FrameCd::sizeDescription( const Units& units ) const { if ( units.toEnum() == Units::IN ) { diff --git a/libglabels/FrameCd.h b/libglabels/FrameCd.h index ac9c400..366d046 100644 --- a/libglabels/FrameCd.h +++ b/libglabels/FrameCd.h @@ -49,7 +49,7 @@ namespace glabels Distance w() const; Distance h() const; - const QString sizeDescription( const Units& units ) const; + QString sizeDescription( const Units& units ) const; bool isSimilarTo( Frame* other ) const; const QPainterPath& path() const; @@ -72,7 +72,4 @@ namespace glabels } -#include "FrameCd.inl" - - #endif // glabels_FrameCd_h diff --git a/libglabels/FrameCd.inl b/libglabels/FrameCd.inl deleted file mode 100644 index e61d702..0000000 --- a/libglabels/FrameCd.inl +++ /dev/null @@ -1,42 +0,0 @@ -/* FrameCd.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline Distance FrameCd::r1() const - { - return mR1; - } - - - inline Distance FrameCd::r2() const - { - return mR2; - } - - - inline Distance FrameCd::waste() const - { - return mWaste; - } - -} diff --git a/libglabels/FrameEllipse.cpp b/libglabels/FrameEllipse.cpp index 4736e62..74c0113 100644 --- a/libglabels/FrameEllipse.cpp +++ b/libglabels/FrameEllipse.cpp @@ -62,7 +62,13 @@ namespace glabels } - const QString FrameEllipse::sizeDescription( const Units& units ) const + Distance FrameEllipse::waste() const + { + return mWaste; + } + + + QString FrameEllipse::sizeDescription( const Units& units ) const { if ( units.toEnum() == Units::IN ) { diff --git a/libglabels/FrameEllipse.h b/libglabels/FrameEllipse.h index b76f58c..ed6e12e 100644 --- a/libglabels/FrameEllipse.h +++ b/libglabels/FrameEllipse.h @@ -46,7 +46,7 @@ namespace glabels Distance w() const; Distance h() const; - const QString sizeDescription( const Units& units ) const; + QString sizeDescription( const Units& units ) const; bool isSimilarTo( Frame* other ) const; const QPainterPath& path() const; @@ -67,7 +67,4 @@ namespace glabels } -#include "FrameEllipse.inl" - - #endif // glabels_FrameEllipse_h diff --git a/libglabels/FrameEllipse.inl b/libglabels/FrameEllipse.inl deleted file mode 100644 index 0aee57a..0000000 --- a/libglabels/FrameEllipse.inl +++ /dev/null @@ -1,30 +0,0 @@ -/* FrameEllipse.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline Distance FrameEllipse::waste() const - { - return mWaste; - } - -} diff --git a/libglabels/FrameRect.cpp b/libglabels/FrameRect.cpp index 26b1a8a..da8bf0a 100644 --- a/libglabels/FrameRect.cpp +++ b/libglabels/FrameRect.cpp @@ -69,7 +69,25 @@ namespace glabels } - const QString FrameRect::sizeDescription( const Units& units ) const + Distance FrameRect::r() const + { + return mR; + } + + + Distance FrameRect::xWaste() const + { + return mXWaste; + } + + + Distance FrameRect::yWaste() const + { + return mYWaste; + } + + + QString FrameRect::sizeDescription( const Units& units ) const { if ( units.toEnum() == Units::IN ) { diff --git a/libglabels/FrameRect.h b/libglabels/FrameRect.h index 244cabf..9ed80ae 100644 --- a/libglabels/FrameRect.h +++ b/libglabels/FrameRect.h @@ -49,7 +49,7 @@ namespace glabels Distance w() const; Distance h() const; - const QString sizeDescription( const Units& units ) const; + QString sizeDescription( const Units& units ) const; bool isSimilarTo( Frame* other ) const; @@ -73,7 +73,4 @@ namespace glabels } -#include "FrameRect.inl" - - #endif // glabels_FrameRect_h diff --git a/libglabels/FrameRect.inl b/libglabels/FrameRect.inl deleted file mode 100644 index ab6abb8..0000000 --- a/libglabels/FrameRect.inl +++ /dev/null @@ -1,42 +0,0 @@ -/* FrameRect.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline Distance FrameRect::r() const - { - return mR; - } - - - inline Distance FrameRect::xWaste() const - { - return mXWaste; - } - - - inline Distance FrameRect::yWaste() const - { - return mYWaste; - } - -} diff --git a/libglabels/FrameRound.cpp b/libglabels/FrameRound.cpp index 8893399..6f8ac67 100644 --- a/libglabels/FrameRound.cpp +++ b/libglabels/FrameRound.cpp @@ -62,7 +62,19 @@ namespace glabels } - const QString FrameRound::sizeDescription( const Units& units ) const + Distance FrameRound::r() const + { + return mR; + } + + + Distance FrameRound::waste() const + { + return mWaste; + } + + + QString FrameRound::sizeDescription( const Units& units ) const { if ( units.toEnum() == Units::IN ) { diff --git a/libglabels/FrameRound.h b/libglabels/FrameRound.h index d6f6e38..6003f5d 100644 --- a/libglabels/FrameRound.h +++ b/libglabels/FrameRound.h @@ -46,7 +46,7 @@ namespace glabels Distance w() const; Distance h() const; - const QString sizeDescription( const Units& units ) const; + QString sizeDescription( const Units& units ) const; bool isSimilarTo( Frame* other ) const; const QPainterPath& path() const; @@ -66,7 +66,4 @@ namespace glabels } -#include "FrameRound.inl" - - #endif // glabels_FrameRound_h diff --git a/libglabels/FrameRound.inl b/libglabels/FrameRound.inl deleted file mode 100644 index bade556..0000000 --- a/libglabels/FrameRound.inl +++ /dev/null @@ -1,36 +0,0 @@ -/* FrameRound.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline Distance FrameRound::r() const - { - return mR; - } - - - inline Distance FrameRound::waste() const - { - return mWaste; - } - -} diff --git a/libglabels/Layout.cpp b/libglabels/Layout.cpp index aa9c190..dab24fe 100644 --- a/libglabels/Layout.cpp +++ b/libglabels/Layout.cpp @@ -47,6 +47,42 @@ namespace glabels } + int Layout::nx() const + { + return mNx; + } + + + int Layout::ny() const + { + return mNy; + } + + + Distance Layout::x0() const + { + return mX0; + } + + + Distance Layout::y0() const + { + return mY0; + } + + + Distance Layout::dx() const + { + return mDx; + } + + + Distance Layout::dy() const + { + return mDy; + } + + bool Layout::isSimilarTo( const Layout *other ) { return ( (mNx == other->mNx) && diff --git a/libglabels/Layout.h b/libglabels/Layout.h index 70ac0f1..aedcfee 100644 --- a/libglabels/Layout.h +++ b/libglabels/Layout.h @@ -68,7 +68,4 @@ namespace glabels } -#include "Layout.inl" - - #endif // glabels_Layout_h diff --git a/libglabels/Layout.inl b/libglabels/Layout.inl deleted file mode 100644 index a4b41e4..0000000 --- a/libglabels/Layout.inl +++ /dev/null @@ -1,60 +0,0 @@ -/* Layout.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline int Layout::nx() const - { - return mNx; - } - - - inline int Layout::ny() const - { - return mNy; - } - - - inline Distance Layout::x0() const - { - return mX0; - } - - - inline Distance Layout::y0() const - { - return mY0; - } - - - inline Distance Layout::dx() const - { - return mDx; - } - - - inline Distance Layout::dy() const - { - return mDy; - } - -} diff --git a/libglabels/Markup.cpp b/libglabels/Markup.cpp index b965457..e8220bc 100644 --- a/libglabels/Markup.cpp +++ b/libglabels/Markup.cpp @@ -44,6 +44,12 @@ namespace glabels } + Distance MarkupMargin::size() const + { + return mSize; + } + + MarkupLine::MarkupLine( const Distance& x1, const Distance& y1, const Distance& x2, @@ -61,6 +67,30 @@ namespace glabels } + Distance MarkupLine::x1() const + { + return mX1; + } + + + Distance MarkupLine::y1() const + { + return mY1; + } + + + Distance MarkupLine::x2() const + { + return mX2; + } + + + Distance MarkupLine::y2() const + { + return mY2; + } + + MarkupRect::MarkupRect( const Distance& x1, const Distance& y1, const Distance& w, @@ -78,6 +108,36 @@ namespace glabels } + Distance MarkupRect::x1() const + { + return mX1; + } + + + Distance MarkupRect::y1() const + { + return mY1; + } + + + Distance MarkupRect::w() const + { + return mW; + } + + + Distance MarkupRect::h() const + { + return mH; + } + + + Distance MarkupRect::r() const + { + return mR; + } + + MarkupEllipse::MarkupEllipse( const Distance& x1, const Distance& y1, const Distance& w, @@ -94,6 +154,30 @@ namespace glabels } + Distance MarkupEllipse::x1() const + { + return mX1; + } + + + Distance MarkupEllipse::y1() const + { + return mY1; + } + + + Distance MarkupEllipse::w() const + { + return mW; + } + + + Distance MarkupEllipse::h() const + { + return mH; + } + + MarkupCircle::MarkupCircle( const Distance& x0, const Distance& y0, const Distance& r ) @@ -107,4 +191,22 @@ namespace glabels return new MarkupCircle( mX0, mY0, mR ); } + + Distance MarkupCircle::x0() const + { + return mX0; + } + + + Distance MarkupCircle::y0() const + { + return mY0; + } + + + Distance MarkupCircle::r() const + { + return mR; + } + } diff --git a/libglabels/Markup.h b/libglabels/Markup.h index 88835a6..f8a2699 100644 --- a/libglabels/Markup.h +++ b/libglabels/Markup.h @@ -153,7 +153,4 @@ namespace glabels } -#include "Markup.inl" - - #endif // glabels_Markup_h diff --git a/libglabels/Markup.inl b/libglabels/Markup.inl deleted file mode 100644 index ff41ece..0000000 --- a/libglabels/Markup.inl +++ /dev/null @@ -1,47 +0,0 @@ -/* Markup.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline Distance MarkupMargin::size() const { return mSize; } - - inline Distance MarkupLine::x1() const { return mX1; } - inline Distance MarkupLine::y1() const { return mY1; } - inline Distance MarkupLine::x2() const { return mX2; } - inline Distance MarkupLine::y2() const { return mY2; } - - inline Distance MarkupRect::x1() const { return mX1; } - inline Distance MarkupRect::y1() const { return mY1; } - inline Distance MarkupRect::w() const { return mW; } - inline Distance MarkupRect::h() const { return mH; } - inline Distance MarkupRect::r() const { return mR; } - - inline Distance MarkupEllipse::x1() const { return mX1; } - inline Distance MarkupEllipse::y1() const { return mY1; } - inline Distance MarkupEllipse::w() const { return mW; } - inline Distance MarkupEllipse::h() const { return mH; } - - inline Distance MarkupCircle::x0() const { return mX0; } - inline Distance MarkupCircle::y0() const { return mY0; } - inline Distance MarkupCircle::r() const { return mR; } - -} diff --git a/libglabels/MiniPreviewPixmap.h b/libglabels/MiniPreviewPixmap.h index 688892c..a4061b7 100644 --- a/libglabels/MiniPreviewPixmap.h +++ b/libglabels/MiniPreviewPixmap.h @@ -55,4 +55,5 @@ namespace glabels } + #endif // glabels_MiniPreviewPixmap_h diff --git a/libglabels/Paper.cpp b/libglabels/Paper.cpp index 8b21fa6..e6f3fbe 100644 --- a/libglabels/Paper.cpp +++ b/libglabels/Paper.cpp @@ -33,4 +33,46 @@ namespace glabels { } + + QString Paper::id() const + { + return mId; + } + + + QString Paper::name() const + { + return mName; + } + + + Distance Paper::width() const + { + return mWidth; + } + + + Distance Paper::height() const + { + return mHeight; + } + + + QString Paper::pwgSize() const + { + return mPwgSize; + } + + + bool Paper::isSizeIso() const + { + return mPwgSize.startsWith( "iso_" ); + } + + + bool Paper::isSizeUs() const + { + return mPwgSize.startsWith( "na_" ); + } + } diff --git a/libglabels/Paper.h b/libglabels/Paper.h index f254a8c..2cde61d 100644 --- a/libglabels/Paper.h +++ b/libglabels/Paper.h @@ -39,20 +39,20 @@ namespace glabels const Distance& height, const QString& pwgSize ); - inline const QString& id() const; - inline const QString& name() const; + QString id() const; + QString name() const; /* Width */ - inline Distance width() const; + Distance width() const; /* Height */ - inline Distance height() const; + Distance height() const; /* PWG 5101.1-2002 size name */ - inline QString pwgSize() const; + QString pwgSize() const; - inline bool isSizeIso() const; - inline bool isSizeUs() const; + bool isSizeIso() const; + bool isSizeUs() const; private: QString mId; @@ -65,7 +65,4 @@ namespace glabels } -#include "Paper.inl" - - #endif // glabels_Paper_h diff --git a/libglabels/Paper.inl b/libglabels/Paper.inl deleted file mode 100644 index 65a03ea..0000000 --- a/libglabels/Paper.inl +++ /dev/null @@ -1,36 +0,0 @@ -/* Paper.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline const QString& Paper::id() const { return mId; } - inline const QString& Paper::name() const { return mName; } - - inline Distance Paper::width() const { return mWidth; } - inline Distance Paper::height() const { return mHeight; } - - inline QString Paper::pwgSize() const { return mPwgSize; } - - inline bool Paper::isSizeIso() const { return mPwgSize.startsWith( "iso_" ); } - inline bool Paper::isSizeUs() const { return mPwgSize.startsWith( "na_" ); } - -} diff --git a/libglabels/Point.cpp b/libglabels/Point.cpp index 0dac720..5ae0be2 100644 --- a/libglabels/Point.cpp +++ b/libglabels/Point.cpp @@ -34,6 +34,18 @@ namespace glabels } + Distance Point::x() const + { + return mX; + } + + + Distance Point::y() const + { + return mY; + } + + bool Point::operator<( const Point &other ) const { if ( mY < other.mY ) diff --git a/libglabels/Point.h b/libglabels/Point.h index 8fbfd04..ff23a6c 100644 --- a/libglabels/Point.h +++ b/libglabels/Point.h @@ -49,7 +49,4 @@ namespace glabels } -#include "Point.inl" - - #endif // glabels_Point_h diff --git a/libglabels/Point.inl b/libglabels/Point.inl deleted file mode 100644 index 5930528..0000000 --- a/libglabels/Point.inl +++ /dev/null @@ -1,36 +0,0 @@ -/* Point.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline Distance Point::x() const - { - return mX; - } - - - inline Distance Point::y() const - { - return mY; - } - -} diff --git a/libglabels/StrUtil.h b/libglabels/StrUtil.h index 0fd4f5c..dd6ce74 100644 --- a/libglabels/StrUtil.h +++ b/libglabels/StrUtil.h @@ -39,4 +39,5 @@ namespace glabels } + #endif // glabels_StrUtil_h diff --git a/libglabels/Template.cpp b/libglabels/Template.cpp index ed0ce42..d544be9 100644 --- a/libglabels/Template.cpp +++ b/libglabels/Template.cpp @@ -124,6 +124,102 @@ namespace glabels } + QString Template::brand() const + { + return mBrand; + } + + + QString Template::part() const + { + return mPart; + } + + + QString Template::description() const + { + return mDescription; + } + + + QString Template::paperId() const + { + return mPaperId; + } + + + Distance Template::pageWidth() const + { + return mPageWidth; + } + + + Distance Template::pageHeight() const + { + return mPageHeight; + } + + + bool Template::isSizeIso() const + { + return mIsSizeIso; + } + + + bool Template::isSizeUs() const + { + return mIsSizeUs; + } + + + bool Template::isSizeOther() const + { + return !mIsSizeIso && !mIsSizeUs; + } + + + QString Template::equivPart() const + { + return mEquivPart; + } + + + void Template::setEquivPart( const QString& value ) + { + mEquivPart = value; + } + + + QString Template::productUrl() const + { + return mProductUrl; + } + + + void Template::setProductUrl( const QString& value ) + { + mProductUrl = value; + } + + + QString Template::name() const + { + return mName; + } + + + const MiniPreviewPixmap& Template::preview() const + { + return mPreview; + } + + + const QList& Template::frames() const + { + return mFrames; + } + + void Template::addCategory( const QString& categoryId ) { mCategoryIds << categoryId; diff --git a/libglabels/Template.h b/libglabels/Template.h index 910d0f8..3d61aa3 100644 --- a/libglabels/Template.h +++ b/libglabels/Template.h @@ -65,24 +65,24 @@ namespace glabels const QString& equivPart ); - const QString& brand() const; - const QString& part() const; - const QString& description() const; + QString brand() const; + QString part() const; + QString description() const; - const QString& paperId() const; + QString paperId() const; Distance pageWidth() const; Distance pageHeight() const; bool isSizeIso() const; bool isSizeUs() const; bool isSizeOther() const; - const QString& equivPart() const; + QString equivPart() const; void setEquivPart( const QString& value ); - const QString& productUrl() const; + QString productUrl() const; void setProductUrl( const QString& value ); - const QString& name() const; + QString name() const; void addCategory( const QString& categoryId ); void addFrame( Frame* frame ); @@ -123,7 +123,4 @@ namespace glabels } -#include "Template.inl" - - #endif // glabels_Template_h diff --git a/libglabels/Template.inl b/libglabels/Template.inl deleted file mode 100644 index 56a0228..0000000 --- a/libglabels/Template.inl +++ /dev/null @@ -1,48 +0,0 @@ -/* Template.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline const QString& Template::brand() const { return mBrand; } - inline const QString& Template::part() const { return mPart; } - inline const QString& Template::description() const { return mDescription; } - - inline const QString& Template::paperId() const { return mPaperId; } - inline Distance Template::pageWidth() const { return mPageWidth; } - inline Distance Template::pageHeight() const { return mPageHeight; } - inline bool Template::isSizeIso() const { return mIsSizeIso; } - inline bool Template::isSizeUs() const { return mIsSizeUs; } - inline bool Template::isSizeOther() const { return !mIsSizeIso && !mIsSizeUs; } - - inline const QString& Template::equivPart() const { return mEquivPart; } - inline void Template::setEquivPart( const QString& value ) { mEquivPart = value; } - - inline const QString& Template::productUrl() const { return mProductUrl; } - inline void Template::setProductUrl( const QString& value ) { mProductUrl = value; } - - inline const QString& Template::name() const { return mName; } - - inline const MiniPreviewPixmap& Template::preview() const { return mPreview; } - - inline const QList& Template::frames() const { return mFrames; } - -} diff --git a/libglabels/Vendor.cpp b/libglabels/Vendor.cpp index e056264..2a663dd 100644 --- a/libglabels/Vendor.cpp +++ b/libglabels/Vendor.cpp @@ -28,4 +28,16 @@ namespace glabels { } + + QString Vendor::name() const + { + return mName; + } + + + QString Vendor::url() const + { + return mUrl; + } + } diff --git a/libglabels/Vendor.h b/libglabels/Vendor.h index a2140a9..8e4c776 100644 --- a/libglabels/Vendor.h +++ b/libglabels/Vendor.h @@ -33,8 +33,8 @@ namespace glabels public: Vendor( const QString &name, const QString &url ); - const QString& name() const; - const QString& url() const; + QString name() const; + QString url() const; private: QString mName; @@ -44,7 +44,4 @@ namespace glabels } -#include "Vendor.inl" - - #endif // glabels_Vendor_h diff --git a/libglabels/Vendor.inl b/libglabels/Vendor.inl deleted file mode 100644 index 614c4f2..0000000 --- a/libglabels/Vendor.inl +++ /dev/null @@ -1,28 +0,0 @@ -/* Vendor.inl - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - - -namespace glabels -{ - - inline const QString& Vendor::name() const { return mName; } - inline const QString& Vendor::url() const { return mUrl; } - -} diff --git a/libglabels/XmlCategoryParser.h b/libglabels/XmlCategoryParser.h index 9292008..5baa227 100644 --- a/libglabels/XmlCategoryParser.h +++ b/libglabels/XmlCategoryParser.h @@ -43,4 +43,5 @@ namespace glabels } + #endif // glabels_XmlCategoryParser_h diff --git a/libglabels/XmlPaperParser.h b/libglabels/XmlPaperParser.h index 1936472..4432d41 100644 --- a/libglabels/XmlPaperParser.h +++ b/libglabels/XmlPaperParser.h @@ -43,4 +43,5 @@ namespace glabels } + #endif // glabels_XmlPaperParser_h diff --git a/libglabels/XmlTemplateCreator.h b/libglabels/XmlTemplateCreator.h index 6c34141..63948d5 100644 --- a/libglabels/XmlTemplateCreator.h +++ b/libglabels/XmlTemplateCreator.h @@ -65,4 +65,5 @@ namespace glabels } + #endif // glabels_XmlTemplateCreator_h diff --git a/libglabels/XmlTemplateParser.h b/libglabels/XmlTemplateParser.h index 788f7c7..3a56c35 100644 --- a/libglabels/XmlTemplateParser.h +++ b/libglabels/XmlTemplateParser.h @@ -58,4 +58,5 @@ namespace glabels } + #endif // glabels_XmlTemplateParser_h diff --git a/libglabels/XmlUtil.h b/libglabels/XmlUtil.h index cfec5b8..2e7117c 100644 --- a/libglabels/XmlUtil.h +++ b/libglabels/XmlUtil.h @@ -104,4 +104,5 @@ namespace glabels } + #endif // glabels_XmlUtil_h diff --git a/libglabels/XmlVendorParser.h b/libglabels/XmlVendorParser.h index 8f45eab..3da96a9 100644 --- a/libglabels/XmlVendorParser.h +++ b/libglabels/XmlVendorParser.h @@ -43,4 +43,5 @@ namespace glabels } + #endif // glabels_XmlVendorParser_h