Big-Ugly Style Update (#278)
* Bulk replaced tabs with spaces * Bulk removed trailing whitespace from lines * Replaced c-style comments with c++-style comments in file banners * Replace nested namespace definitions with single concise definitions (C++17), this keeps the indentation more manageable * Cleanup ordering and spacing of include directives * Bulk renaming of header file extensions from '.h' to '.hpp'. * Update CODING-STYLE.md * Update target_compile_features from cxx_std_11 to cxx_std_20. * Refresh .clang-format file. Still needs a lot of tweaking.
This commit is contained in:
+178
-20
@@ -1,28 +1,72 @@
|
|||||||
---
|
---
|
||||||
Language: Cpp
|
Language: Cpp
|
||||||
# BasedOnStyle: Google
|
|
||||||
AccessModifierOffset: -8
|
AccessModifierOffset: -8
|
||||||
AlignAfterOpenBracket: Align
|
AlignAfterOpenBracket: Align
|
||||||
AlignConsecutiveAssignments: true
|
AlignArrayOfStructures: None
|
||||||
AlignConsecutiveDeclarations: true
|
AlignConsecutiveAssignments:
|
||||||
AlignEscapedNewlinesLeft: true
|
Enabled: true
|
||||||
AlignOperands: true
|
AcrossEmptyLines: false
|
||||||
AlignTrailingComments: true
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
AlignFunctionPointers: false
|
||||||
|
PadOperators: true
|
||||||
|
AlignConsecutiveBitFields:
|
||||||
|
Enabled: false
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
AlignFunctionPointers: false
|
||||||
|
PadOperators: false
|
||||||
|
AlignConsecutiveDeclarations:
|
||||||
|
Enabled: true
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
AlignFunctionPointers: false
|
||||||
|
PadOperators: true
|
||||||
|
AlignConsecutiveMacros:
|
||||||
|
Enabled: false
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
AlignFunctionPointers: false
|
||||||
|
PadOperators: false
|
||||||
|
AlignConsecutiveShortCaseStatements:
|
||||||
|
Enabled: false
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCaseColons: false
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
AlignOperands: Align
|
||||||
|
AlignTrailingComments:
|
||||||
|
Kind: Always
|
||||||
|
OverEmptyLines: 0
|
||||||
|
AllowAllArgumentsOnNextLine: true
|
||||||
AllowAllParametersOfDeclarationOnNextLine: true
|
AllowAllParametersOfDeclarationOnNextLine: true
|
||||||
AllowShortBlocksOnASingleLine: false
|
AllowBreakBeforeNoexceptSpecifier: Never
|
||||||
|
AllowShortBlocksOnASingleLine: Never
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortCompoundRequirementOnASingleLine: true
|
||||||
|
AllowShortEnumsOnASingleLine: true
|
||||||
AllowShortFunctionsOnASingleLine: Inline
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
AllowShortIfStatementsOnASingleLine: false
|
AllowShortIfStatementsOnASingleLine: Never
|
||||||
|
AllowShortLambdasOnASingleLine: All
|
||||||
AllowShortLoopsOnASingleLine: false
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AlwaysBreakAfterDefinitionReturnType: None
|
||||||
AlwaysBreakAfterReturnType: None
|
AlwaysBreakAfterReturnType: None
|
||||||
AlwaysBreakBeforeMultilineStrings: false
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
AlwaysBreakTemplateDeclarations: true
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
AttributeMacros:
|
||||||
|
- __capability
|
||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
|
BitFieldColonSpacing: Both
|
||||||
BraceWrapping:
|
BraceWrapping:
|
||||||
|
AfterCaseLabel: false
|
||||||
AfterClass: true
|
AfterClass: true
|
||||||
AfterControlStatement: true
|
AfterControlStatement: Always
|
||||||
AfterEnum: true
|
AfterEnum: true
|
||||||
|
AfterExternBlock: false
|
||||||
AfterFunction: true
|
AfterFunction: true
|
||||||
AfterNamespace: true
|
AfterNamespace: true
|
||||||
AfterObjCDeclaration: true
|
AfterObjCDeclaration: true
|
||||||
@@ -30,62 +74,176 @@ BraceWrapping:
|
|||||||
AfterUnion: true
|
AfterUnion: true
|
||||||
BeforeCatch: true
|
BeforeCatch: true
|
||||||
BeforeElse: true
|
BeforeElse: true
|
||||||
|
BeforeLambdaBody: false
|
||||||
|
BeforeWhile: false
|
||||||
IndentBraces: false
|
IndentBraces: false
|
||||||
|
SplitEmptyFunction: true
|
||||||
|
SplitEmptyRecord: true
|
||||||
|
SplitEmptyNamespace: true
|
||||||
|
BreakAdjacentStringLiterals: true
|
||||||
|
BreakAfterAttributes: Leave
|
||||||
|
BreakAfterJavaFieldAnnotations: false
|
||||||
|
BreakArrays: true
|
||||||
BreakBeforeBinaryOperators: None
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeConceptDeclarations: Always
|
||||||
BreakBeforeBraces: Custom
|
BreakBeforeBraces: Custom
|
||||||
|
BreakBeforeInlineASMColon: OnlyMultiline
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
BreakConstructorInitializersBeforeComma: false
|
BreakConstructorInitializers: BeforeColon
|
||||||
|
BreakInheritanceList: BeforeColon
|
||||||
|
BreakStringLiterals: true
|
||||||
ColumnLimit: 110
|
ColumnLimit: 110
|
||||||
CommentPragmas: '^ IWYU pragma:'
|
CommentPragmas: '^ IWYU pragma:'
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
CompactNamespaces: false
|
||||||
ConstructorInitializerIndentWidth: 8
|
ConstructorInitializerIndentWidth: 8
|
||||||
ContinuationIndentWidth: 8
|
ContinuationIndentWidth: 8
|
||||||
Cpp11BracedListStyle: true
|
Cpp11BracedListStyle: true
|
||||||
DerivePointerAlignment: true
|
DerivePointerAlignment: true
|
||||||
DisableFormat: false
|
DisableFormat: false
|
||||||
|
EmptyLineAfterAccessModifier: Never
|
||||||
|
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||||
ExperimentalAutoDetectBinPacking: false
|
ExperimentalAutoDetectBinPacking: false
|
||||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
FixNamespaceComments: false
|
||||||
|
ForEachMacros:
|
||||||
|
- foreach
|
||||||
|
- Q_FOREACH
|
||||||
|
- BOOST_FOREACH
|
||||||
|
IfMacros:
|
||||||
|
- KJ_IF_MAYBE
|
||||||
|
IncludeBlocks: Preserve
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '^"[A-Z].*\.h'
|
- Regex: '^"[A-Z].*\.h'
|
||||||
Priority: 1
|
Priority: 1
|
||||||
|
SortPriority: 0
|
||||||
|
CaseSensitive: false
|
||||||
- Regex: '^<Q[A-Za-z]*\>'
|
- Regex: '^<Q[A-Za-z]*\>'
|
||||||
Priority: 2
|
Priority: 2
|
||||||
|
SortPriority: 0
|
||||||
|
CaseSensitive: false
|
||||||
- Regex: '^<[a-z]*>'
|
- Regex: '^<[a-z]*>'
|
||||||
Priority: 3
|
Priority: 3
|
||||||
|
SortPriority: 0
|
||||||
|
CaseSensitive: false
|
||||||
- Regex: '.*'
|
- Regex: '.*'
|
||||||
Priority: 4
|
Priority: 4
|
||||||
|
SortPriority: 0
|
||||||
|
CaseSensitive: false
|
||||||
|
IncludeIsMainRegex: '(Test)?$'
|
||||||
|
IncludeIsMainSourceRegex: ''
|
||||||
|
IndentAccessModifiers: false
|
||||||
|
IndentCaseBlocks: false
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: false
|
||||||
|
IndentExternBlock: AfterExternBlock
|
||||||
|
IndentGotoLabels: true
|
||||||
|
IndentPPDirectives: None
|
||||||
|
IndentRequiresClause: true
|
||||||
IndentWidth: 8
|
IndentWidth: 8
|
||||||
IndentWrappedFunctionNames: false
|
IndentWrappedFunctionNames: false
|
||||||
|
InsertBraces: false
|
||||||
|
InsertNewlineAtEOF: false
|
||||||
|
InsertTrailingCommas: None
|
||||||
|
IntegerLiteralSeparator:
|
||||||
|
Binary: 0
|
||||||
|
BinaryMinDigits: 0
|
||||||
|
Decimal: 0
|
||||||
|
DecimalMinDigits: 0
|
||||||
|
Hex: 0
|
||||||
|
HexMinDigits: 0
|
||||||
|
JavaScriptQuotes: Leave
|
||||||
|
JavaScriptWrapImports: true
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||||
|
KeepEmptyLinesAtEOF: false
|
||||||
|
LambdaBodyIndentation: Signature
|
||||||
|
LineEnding: DeriveLF
|
||||||
MacroBlockBegin: ''
|
MacroBlockBegin: ''
|
||||||
MacroBlockEnd: ''
|
MacroBlockEnd: ''
|
||||||
MaxEmptyLinesToKeep: 2
|
MaxEmptyLinesToKeep: 2
|
||||||
NamespaceIndentation: All
|
NamespaceIndentation: All
|
||||||
|
ObjCBinPackProtocolList: Auto
|
||||||
ObjCBlockIndentWidth: 2
|
ObjCBlockIndentWidth: 2
|
||||||
|
ObjCBreakBeforeNestedBlockParam: true
|
||||||
ObjCSpaceAfterProperty: false
|
ObjCSpaceAfterProperty: false
|
||||||
ObjCSpaceBeforeProtocolList: false
|
ObjCSpaceBeforeProtocolList: false
|
||||||
|
PackConstructorInitializers: NextLine
|
||||||
|
PenaltyBreakAssignment: 2
|
||||||
PenaltyBreakBeforeFirstCallParameter: 1
|
PenaltyBreakBeforeFirstCallParameter: 1
|
||||||
PenaltyBreakComment: 300
|
PenaltyBreakComment: 300
|
||||||
PenaltyBreakFirstLessLess: 120
|
PenaltyBreakFirstLessLess: 120
|
||||||
|
PenaltyBreakOpenParenthesis: 0
|
||||||
|
PenaltyBreakScopeResolution: 500
|
||||||
PenaltyBreakString: 1000
|
PenaltyBreakString: 1000
|
||||||
|
PenaltyBreakTemplateDeclaration: 10
|
||||||
PenaltyExcessCharacter: 1000000
|
PenaltyExcessCharacter: 1000000
|
||||||
|
PenaltyIndentedWhitespace: 0
|
||||||
PenaltyReturnTypeOnItsOwnLine: 200
|
PenaltyReturnTypeOnItsOwnLine: 200
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
|
PPIndentWidth: -1
|
||||||
|
QualifierAlignment: Leave
|
||||||
|
ReferenceAlignment: Pointer
|
||||||
ReflowComments: true
|
ReflowComments: true
|
||||||
SortIncludes: true
|
RemoveBracesLLVM: false
|
||||||
|
RemoveParentheses: Leave
|
||||||
|
RemoveSemicolon: false
|
||||||
|
RequiresClausePosition: OwnLine
|
||||||
|
RequiresExpressionIndentation: OuterScope
|
||||||
|
SeparateDefinitionBlocks: Leave
|
||||||
|
ShortNamespaceLines: 1
|
||||||
|
SkipMacroDefinitionBody: false
|
||||||
|
SortIncludes: CaseSensitive
|
||||||
|
SortJavaStaticImport: Before
|
||||||
|
SortUsingDeclarations: LexicographicNumeric
|
||||||
SpaceAfterCStyleCast: false
|
SpaceAfterCStyleCast: false
|
||||||
|
SpaceAfterLogicalNot: false
|
||||||
|
SpaceAfterTemplateKeyword: true
|
||||||
|
SpaceAroundPointerQualifiers: Default
|
||||||
SpaceBeforeAssignmentOperators: true
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCaseColon: false
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
|
SpaceBeforeCtorInitializerColon: true
|
||||||
|
SpaceBeforeInheritanceColon: true
|
||||||
|
SpaceBeforeJsonColon: false
|
||||||
SpaceBeforeParens: ControlStatements
|
SpaceBeforeParens: ControlStatements
|
||||||
SpaceInEmptyParentheses: false
|
SpaceBeforeParensOptions:
|
||||||
|
AfterControlStatements: true
|
||||||
|
AfterForeachMacros: true
|
||||||
|
AfterFunctionDefinitionName: false
|
||||||
|
AfterFunctionDeclarationName: false
|
||||||
|
AfterIfMacros: true
|
||||||
|
AfterOverloadedOperator: false
|
||||||
|
AfterPlacementOperator: true
|
||||||
|
AfterRequiresInClause: false
|
||||||
|
AfterRequiresInExpression: false
|
||||||
|
BeforeNonEmptyParentheses: false
|
||||||
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceBeforeSquareBrackets: false
|
||||||
|
SpaceInEmptyBlock: false
|
||||||
SpacesBeforeTrailingComments: 1
|
SpacesBeforeTrailingComments: 1
|
||||||
SpacesInAngles: false
|
SpacesInAngles: Never
|
||||||
SpacesInContainerLiterals: true
|
SpacesInContainerLiterals: true
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInLineCommentPrefix:
|
||||||
SpacesInParentheses: true
|
Minimum: 1
|
||||||
|
Maximum: -1
|
||||||
|
SpacesInParens: Custom
|
||||||
|
SpacesInParensOptions:
|
||||||
|
InCStyleCasts: false
|
||||||
|
InConditionalStatements: true
|
||||||
|
InEmptyParentheses: false
|
||||||
|
Other: true
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Cpp11
|
Standard: c++20
|
||||||
|
StatementAttributeLikeMacros:
|
||||||
|
- Q_EMIT
|
||||||
|
StatementMacros:
|
||||||
|
- Q_UNUSED
|
||||||
|
- QT_REQUIRE_VERSION
|
||||||
TabWidth: 8
|
TabWidth: 8
|
||||||
UseTab: ForIndentation
|
UseTab: Never
|
||||||
|
VerilogBreakBetweenInstancePorts: true
|
||||||
|
WhitespaceSensitiveMacros:
|
||||||
|
- BOOST_PP_STRINGIZE
|
||||||
|
- CF_SWIFT_NAME
|
||||||
|
- NS_SWIFT_NAME
|
||||||
|
- PP_STRINGIZE
|
||||||
|
- STRINGIZE
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ if (Qt6Test_FOUND)
|
|||||||
enable_testing ()
|
enable_testing ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
#=======================================
|
#=======================================
|
||||||
# Subdirectories
|
# Subdirectories
|
||||||
#=======================================
|
#=======================================
|
||||||
|
|||||||
@@ -1,35 +1,34 @@
|
|||||||
/* Backends.cpp
|
// Backends.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "Backends.h"
|
|
||||||
|
|
||||||
#include "GnuBarcode.h"
|
|
||||||
#include "QrEncode.h"
|
|
||||||
#include "Zint.h"
|
|
||||||
|
|
||||||
#include "glbarcode/Factory.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "Backends.hpp"
|
||||||
{
|
|
||||||
namespace barcode
|
#include "GnuBarcode.hpp"
|
||||||
|
#include "QrEncode.hpp"
|
||||||
|
#include "Zint.hpp"
|
||||||
|
|
||||||
|
#include "glbarcode/Factory.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::barcode
|
||||||
{
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -595,5 +594,4 @@ namespace glabels
|
|||||||
mStyleList.append( style );
|
mStyleList.append( style );
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace barcode
|
}
|
||||||
} //namespace glabels
|
|
||||||
|
|||||||
@@ -1,98 +0,0 @@
|
|||||||
/* Backends.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef barcode_Backends_h
|
|
||||||
#define barcode_Backends_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Style.h"
|
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QMap>
|
|
||||||
#include <QObject>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace barcode
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Backends Database
|
|
||||||
///
|
|
||||||
class Backends : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
Backends();
|
|
||||||
|
|
||||||
public:
|
|
||||||
static void init();
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Public Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static const QStringList& backendList();
|
|
||||||
static QString backendName( const QString& backendId );
|
|
||||||
static const QList<Style>& styleList();
|
|
||||||
static const Style& defaultStyle();
|
|
||||||
static const Style& style( const QString& backendId, const QString& StyleId );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
static void registerBackend( const QString &backendId, const QString &backendName );
|
|
||||||
|
|
||||||
static void registerStyle( const QString& id,
|
|
||||||
const QString& backendId,
|
|
||||||
const QString& name,
|
|
||||||
bool canText,
|
|
||||||
bool textOptional,
|
|
||||||
bool canChecksum,
|
|
||||||
bool checksumOptional,
|
|
||||||
const QString& defaultDigits,
|
|
||||||
bool canFreeForm,
|
|
||||||
int preferedN );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Members
|
|
||||||
/////////////////////////////////
|
|
||||||
static QStringList mBackendIdList;
|
|
||||||
static QMap<QString,QString> mBackendNameMap;
|
|
||||||
|
|
||||||
static QList<Style> mStyleList;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // barcode_Backends_h
|
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
// Backends.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef barcode_Backends_hpp
|
||||||
|
#define barcode_Backends_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Style.hpp"
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
|
#include <QMap>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::barcode
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Backends Database
|
||||||
|
///
|
||||||
|
class Backends : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
Backends();
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void init();
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Public Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static const QStringList& backendList();
|
||||||
|
static QString backendName( const QString& backendId );
|
||||||
|
static const QList<Style>& styleList();
|
||||||
|
static const Style& defaultStyle();
|
||||||
|
static const Style& style( const QString& backendId, const QString& StyleId );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
static void registerBackend( const QString &backendId, const QString &backendName );
|
||||||
|
|
||||||
|
static void registerStyle( const QString& id,
|
||||||
|
const QString& backendId,
|
||||||
|
const QString& name,
|
||||||
|
bool canText,
|
||||||
|
bool textOptional,
|
||||||
|
bool canChecksum,
|
||||||
|
bool checksumOptional,
|
||||||
|
const QString& defaultDigits,
|
||||||
|
bool canFreeForm,
|
||||||
|
int preferedN );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Members
|
||||||
|
/////////////////////////////////
|
||||||
|
static QStringList mBackendIdList;
|
||||||
|
static QMap<QString,QString> mBackendNameMap;
|
||||||
|
|
||||||
|
static QList<Style> mStyleList;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // barcode_Backends_hpp
|
||||||
@@ -37,7 +37,7 @@ set (barcode_sources
|
|||||||
)
|
)
|
||||||
|
|
||||||
set (barcode_qobject_headers
|
set (barcode_qobject_headers
|
||||||
Backends.h
|
Backends.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
qt6_wrap_cpp (barcode_moc_sources ${barcode_qobject_headers})
|
qt6_wrap_cpp (barcode_moc_sources ${barcode_qobject_headers})
|
||||||
@@ -50,10 +50,9 @@ add_library (Barcode STATIC
|
|||||||
${barcode_moc_sources}
|
${barcode_moc_sources}
|
||||||
)
|
)
|
||||||
|
|
||||||
#target_compile_features (Barcode
|
target_compile_features (Barcode
|
||||||
# PUBLIC cxx_std_11
|
PUBLIC cxx_std_20
|
||||||
#)
|
)
|
||||||
set_property (TARGET Barcode PROPERTY CXX_STANDARD 11)
|
|
||||||
|
|
||||||
target_include_directories (Barcode
|
target_include_directories (Barcode
|
||||||
PUBLIC ..
|
PUBLIC ..
|
||||||
|
|||||||
@@ -1,31 +1,34 @@
|
|||||||
/* GnuBarcode.cpp
|
// GnuBarcode.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#if HAVE_GNU_BARCODE
|
#if HAVE_GNU_BARCODE
|
||||||
|
|
||||||
#include "GnuBarcode.h"
|
|
||||||
|
|
||||||
#include <QtDebug>
|
#include "GnuBarcode.hpp"
|
||||||
#include <barcode.h>
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
||||||
|
#include <barcode.h>
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -34,11 +37,7 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels::barcode::GnuBarcode
|
||||||
{
|
|
||||||
namespace barcode
|
|
||||||
{
|
|
||||||
namespace GnuBarcode
|
|
||||||
{
|
{
|
||||||
|
|
||||||
bool Base::isAscii( const std::string& data ) const
|
bool Base::isAscii( const std::string& data ) const
|
||||||
@@ -903,7 +902,6 @@ namespace glabels
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // HAVE_GNU_BARCODE
|
#endif // HAVE_GNU_BARCODE
|
||||||
|
|||||||
@@ -1,424 +0,0 @@
|
|||||||
/* GnuBarcode.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef barcode_GnuBarcode_h
|
|
||||||
#define barcode_GnuBarcode_h
|
|
||||||
|
|
||||||
#if HAVE_GNU_BARCODE
|
|
||||||
|
|
||||||
#include "glbarcode/Barcode1dBase.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace barcode
|
|
||||||
{
|
|
||||||
namespace GnuBarcode
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GnuBarcode::Base base class for all GNU Barcodes
|
|
||||||
*
|
|
||||||
* Implements glbarcode::Barcode1dBase.
|
|
||||||
*/
|
|
||||||
class Base : public glbarcode::Barcode1dBase
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
int flags;
|
|
||||||
|
|
||||||
bool isAscii( const std::string& data ) const;
|
|
||||||
|
|
||||||
bool isNumericLengthValid( const std::string& data,
|
|
||||||
unsigned int nMin,
|
|
||||||
unsigned int nMax ) const;
|
|
||||||
|
|
||||||
bool isNumericLength1Valid( const std::string& data,
|
|
||||||
unsigned int nMin,
|
|
||||||
unsigned int nMax ) const;
|
|
||||||
|
|
||||||
bool isNumericLength2Valid( const std::string& data,
|
|
||||||
unsigned int nMin,
|
|
||||||
unsigned int nMax ) const;
|
|
||||||
|
|
||||||
void vectorize( const std::string& encodedData,
|
|
||||||
const std::string& displayText,
|
|
||||||
const std::string& cookedData,
|
|
||||||
double& w,
|
|
||||||
double& h ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAN Barcode (Any)
|
|
||||||
*/
|
|
||||||
class Ean : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAN-8 Barcode
|
|
||||||
*/
|
|
||||||
class Ean8 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAN-8+2 Barcode
|
|
||||||
*/
|
|
||||||
class Ean8_2 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAN-8+5 Barcode
|
|
||||||
*/
|
|
||||||
class Ean8_5 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAN-13 Barcode
|
|
||||||
*/
|
|
||||||
class Ean13 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAN-13+2 Barcode
|
|
||||||
*/
|
|
||||||
class Ean13_2 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAN-13+5 Barcode
|
|
||||||
*/
|
|
||||||
class Ean13_5 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UPC Barcode (Any)
|
|
||||||
*/
|
|
||||||
class Upc : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UPC-A Barcode
|
|
||||||
*/
|
|
||||||
class UpcA : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UPC-A+2 Barcode
|
|
||||||
*/
|
|
||||||
class UpcA_2 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UPC-A+5 Barcode
|
|
||||||
*/
|
|
||||||
class UpcA_5 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UPC-E Barcode
|
|
||||||
*/
|
|
||||||
class UpcE : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UPC-E+2 Barcode
|
|
||||||
*/
|
|
||||||
class UpcE_2 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UPC-E+5 Barcode
|
|
||||||
*/
|
|
||||||
class UpcE_5 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ISBN Barcode
|
|
||||||
*/
|
|
||||||
class Isbn : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ISBN+5 Barcode
|
|
||||||
*/
|
|
||||||
class Isbn_5 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Code39 Barcode
|
|
||||||
*/
|
|
||||||
class Code39 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Code128 Barcode
|
|
||||||
*/
|
|
||||||
class Code128 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Code128C Barcode
|
|
||||||
*/
|
|
||||||
class Code128C : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Code128B Barcode
|
|
||||||
*/
|
|
||||||
class Code128B : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* I25 Barcode
|
|
||||||
*/
|
|
||||||
class I25 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CBR Barcode
|
|
||||||
*/
|
|
||||||
class Cbr : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MSI Barcode
|
|
||||||
*/
|
|
||||||
class Msi : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PLS Barcode
|
|
||||||
*/
|
|
||||||
class Pls : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Code93 Barcode
|
|
||||||
*/
|
|
||||||
class Code93 : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
std::string encode( const std::string& cookedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // HAVE_GNU_BARCODE
|
|
||||||
|
|
||||||
#endif // barcode_GnuBarcode_h
|
|
||||||
@@ -0,0 +1,419 @@
|
|||||||
|
// GnuBarcode.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef barcode_GnuBarcode_hpp
|
||||||
|
#define barcode_GnuBarcode_hpp
|
||||||
|
|
||||||
|
#if HAVE_GNU_BARCODE
|
||||||
|
|
||||||
|
|
||||||
|
#include "glbarcode/Barcode1dBase.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::barcode::GnuBarcode
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GnuBarcode::Base base class for all GNU Barcodes
|
||||||
|
*
|
||||||
|
* Implements glbarcode::Barcode1dBase.
|
||||||
|
*/
|
||||||
|
class Base : public glbarcode::Barcode1dBase
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
int flags;
|
||||||
|
|
||||||
|
bool isAscii( const std::string& data ) const;
|
||||||
|
|
||||||
|
bool isNumericLengthValid( const std::string& data,
|
||||||
|
unsigned int nMin,
|
||||||
|
unsigned int nMax ) const;
|
||||||
|
|
||||||
|
bool isNumericLength1Valid( const std::string& data,
|
||||||
|
unsigned int nMin,
|
||||||
|
unsigned int nMax ) const;
|
||||||
|
|
||||||
|
bool isNumericLength2Valid( const std::string& data,
|
||||||
|
unsigned int nMin,
|
||||||
|
unsigned int nMax ) const;
|
||||||
|
|
||||||
|
void vectorize( const std::string& encodedData,
|
||||||
|
const std::string& displayText,
|
||||||
|
const std::string& cookedData,
|
||||||
|
double& w,
|
||||||
|
double& h ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAN Barcode (Any)
|
||||||
|
*/
|
||||||
|
class Ean : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAN-8 Barcode
|
||||||
|
*/
|
||||||
|
class Ean8 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAN-8+2 Barcode
|
||||||
|
*/
|
||||||
|
class Ean8_2 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAN-8+5 Barcode
|
||||||
|
*/
|
||||||
|
class Ean8_5 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAN-13 Barcode
|
||||||
|
*/
|
||||||
|
class Ean13 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAN-13+2 Barcode
|
||||||
|
*/
|
||||||
|
class Ean13_2 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAN-13+5 Barcode
|
||||||
|
*/
|
||||||
|
class Ean13_5 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPC Barcode (Any)
|
||||||
|
*/
|
||||||
|
class Upc : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPC-A Barcode
|
||||||
|
*/
|
||||||
|
class UpcA : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPC-A+2 Barcode
|
||||||
|
*/
|
||||||
|
class UpcA_2 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPC-A+5 Barcode
|
||||||
|
*/
|
||||||
|
class UpcA_5 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPC-E Barcode
|
||||||
|
*/
|
||||||
|
class UpcE : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPC-E+2 Barcode
|
||||||
|
*/
|
||||||
|
class UpcE_2 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPC-E+5 Barcode
|
||||||
|
*/
|
||||||
|
class UpcE_5 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ISBN Barcode
|
||||||
|
*/
|
||||||
|
class Isbn : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ISBN+5 Barcode
|
||||||
|
*/
|
||||||
|
class Isbn_5 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code39 Barcode
|
||||||
|
*/
|
||||||
|
class Code39 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code128 Barcode
|
||||||
|
*/
|
||||||
|
class Code128 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code128C Barcode
|
||||||
|
*/
|
||||||
|
class Code128C : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code128B Barcode
|
||||||
|
*/
|
||||||
|
class Code128B : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* I25 Barcode
|
||||||
|
*/
|
||||||
|
class I25 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CBR Barcode
|
||||||
|
*/
|
||||||
|
class Cbr : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MSI Barcode
|
||||||
|
*/
|
||||||
|
class Msi : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PLS Barcode
|
||||||
|
*/
|
||||||
|
class Pls : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code93 Barcode
|
||||||
|
*/
|
||||||
|
class Code93 : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
std::string encode( const std::string& cookedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // HAVE_GNU_BARCODE
|
||||||
|
|
||||||
|
#endif // barcode_GnuBarcode_hpp
|
||||||
@@ -1,35 +1,32 @@
|
|||||||
/* QrEncode.cpp
|
// QrEncode.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#if HAVE_QRENCODE
|
#if HAVE_QRENCODE
|
||||||
|
|
||||||
#include "QrEncode.h"
|
|
||||||
|
#include "QrEncode.hpp"
|
||||||
|
|
||||||
#include <qrencode.h>
|
#include <qrencode.h>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels::barcode::QrEncode
|
||||||
{
|
|
||||||
namespace barcode
|
|
||||||
{
|
|
||||||
namespace QrEncode
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -85,8 +82,6 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // HAVE_QRENCODE
|
#endif // HAVE_QRENCODE
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
/* QrEncode.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef barcode_QrEncode_h
|
|
||||||
#define barcode_QrEncode_h
|
|
||||||
|
|
||||||
#if HAVE_QRENCODE
|
|
||||||
|
|
||||||
#include "glbarcode/Barcode2dBase.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace barcode
|
|
||||||
{
|
|
||||||
namespace QrEncode
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* QrEncode::QrCode QR Code Barcode
|
|
||||||
*
|
|
||||||
* Implements glbarcode::Barcode2dBase.
|
|
||||||
*/
|
|
||||||
class QrCode : public glbarcode::Barcode2dBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Barcode* create();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool validate( const std::string& rawData ) override;
|
|
||||||
|
|
||||||
bool encode( const std::string& cookedData,
|
|
||||||
glbarcode::Matrix<bool>& encodedData ) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // HAVE_QRENCODE
|
|
||||||
|
|
||||||
#endif // barcode_QrEncode_h
|
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
// QrEncode.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef barcode_QrEncode_hpp
|
||||||
|
#define barcode_QrEncode_hpp
|
||||||
|
|
||||||
|
#if HAVE_QRENCODE
|
||||||
|
|
||||||
|
|
||||||
|
#include "glbarcode/Barcode2dBase.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::barcode::QrEncode
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// QrEncode::QrCode QR Code Barcode
|
||||||
|
///
|
||||||
|
/// Implements glbarcode::Barcode2dBase.
|
||||||
|
///
|
||||||
|
class QrCode : public glbarcode::Barcode2dBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* create();
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
|
||||||
|
bool encode( const std::string& cookedData,
|
||||||
|
glbarcode::Matrix<bool>& encodedData ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // HAVE_QRENCODE
|
||||||
|
|
||||||
|
#endif // barcode_QrEncode_hpp
|
||||||
+26
-28
@@ -1,31 +1,30 @@
|
|||||||
/* Style.cpp
|
// Style.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2013 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2013 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "Style.h"
|
|
||||||
|
|
||||||
#include "Backends.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "Style.hpp"
|
||||||
{
|
|
||||||
namespace barcode
|
#include "Backends.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::barcode
|
||||||
{
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -221,5 +220,4 @@ namespace glabels
|
|||||||
return (mBackendId != other.mBackendId) || (mId != other.mId);
|
return (mBackendId != other.mBackendId) || (mId != other.mId);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace barcode
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,120 +0,0 @@
|
|||||||
/* Style.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2013 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef barcode_Style_h
|
|
||||||
#define barcode_Style_h
|
|
||||||
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace barcode
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Style Type
|
|
||||||
///
|
|
||||||
class Style
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
Style ();
|
|
||||||
|
|
||||||
Style ( const QString& id,
|
|
||||||
const QString& backendId,
|
|
||||||
const QString& name,
|
|
||||||
bool canText,
|
|
||||||
bool textOptional,
|
|
||||||
bool canChecksum,
|
|
||||||
bool checksumOptional,
|
|
||||||
const QString& defaultDigits,
|
|
||||||
bool canFreeform,
|
|
||||||
int preferedN );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Properties
|
|
||||||
/////////////////////////////////
|
|
||||||
const QString& id() const;
|
|
||||||
|
|
||||||
QString fullId() const;
|
|
||||||
|
|
||||||
const QString& backendId() const;
|
|
||||||
|
|
||||||
const QString& name() const;
|
|
||||||
|
|
||||||
QString fullName() const;
|
|
||||||
|
|
||||||
bool canText() const;
|
|
||||||
|
|
||||||
bool textOptional() const;
|
|
||||||
|
|
||||||
bool canChecksum() const;
|
|
||||||
|
|
||||||
bool checksumOptional() const;
|
|
||||||
|
|
||||||
const QString& defaultDigits() const;
|
|
||||||
|
|
||||||
bool canFreeform() const;
|
|
||||||
|
|
||||||
int preferedN() const;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
QString exampleDigits( int n ) const;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Operators
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
bool operator!=( const Style& other ) const;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Data
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
QString mId;
|
|
||||||
QString mBackendId;
|
|
||||||
QString mName;
|
|
||||||
bool mCanText;
|
|
||||||
bool mTextOptional;
|
|
||||||
bool mCanChecksum;
|
|
||||||
bool mChecksumOptional;
|
|
||||||
QString mDefaultDigits;
|
|
||||||
bool mCanFreeform;
|
|
||||||
int mPreferedN;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // barcode_Style_h
|
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
// Style.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2013 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef barcode_Style_hpp
|
||||||
|
#define barcode_Style_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::barcode
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Style Type
|
||||||
|
///
|
||||||
|
class Style
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
Style ();
|
||||||
|
|
||||||
|
Style ( const QString& id,
|
||||||
|
const QString& backendId,
|
||||||
|
const QString& name,
|
||||||
|
bool canText,
|
||||||
|
bool textOptional,
|
||||||
|
bool canChecksum,
|
||||||
|
bool checksumOptional,
|
||||||
|
const QString& defaultDigits,
|
||||||
|
bool canFreeform,
|
||||||
|
int preferedN );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
const QString& id() const;
|
||||||
|
|
||||||
|
QString fullId() const;
|
||||||
|
|
||||||
|
const QString& backendId() const;
|
||||||
|
|
||||||
|
const QString& name() const;
|
||||||
|
|
||||||
|
QString fullName() const;
|
||||||
|
|
||||||
|
bool canText() const;
|
||||||
|
|
||||||
|
bool textOptional() const;
|
||||||
|
|
||||||
|
bool canChecksum() const;
|
||||||
|
|
||||||
|
bool checksumOptional() const;
|
||||||
|
|
||||||
|
const QString& defaultDigits() const;
|
||||||
|
|
||||||
|
bool canFreeform() const;
|
||||||
|
|
||||||
|
int preferedN() const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
QString exampleDigits( int n ) const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Operators
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
bool operator!=( const Style& other ) const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
QString mId;
|
||||||
|
QString mBackendId;
|
||||||
|
QString mName;
|
||||||
|
bool mCanText;
|
||||||
|
bool mTextOptional;
|
||||||
|
bool mCanChecksum;
|
||||||
|
bool mChecksumOptional;
|
||||||
|
QString mDefaultDigits;
|
||||||
|
bool mCanFreeform;
|
||||||
|
int mPreferedN;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // barcode_Style_hpp
|
||||||
+24
-29
@@ -1,28 +1,30 @@
|
|||||||
/* Zint.cpp
|
// Zint.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#if HAVE_ZINT
|
#if HAVE_ZINT
|
||||||
|
|
||||||
#include "Zint.h"
|
|
||||||
|
|
||||||
#include <QtDebug>
|
#include "Zint.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
#include <zint.h>
|
#include <zint.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -32,13 +34,8 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels::barcode::Zint
|
||||||
{
|
{
|
||||||
namespace barcode
|
|
||||||
{
|
|
||||||
namespace Zint
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Base constructor
|
// Base constructor
|
||||||
@@ -1558,8 +1555,6 @@ namespace glabels
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // HAVE_ZINT
|
#endif // HAVE_ZINT
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@ set (merge_sources
|
|||||||
)
|
)
|
||||||
|
|
||||||
set (merge_qobject_headers
|
set (merge_qobject_headers
|
||||||
Merge.h
|
Merge.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
qt6_wrap_cpp (merge_moc_sources ${merge_qobject_headers})
|
qt6_wrap_cpp (merge_moc_sources ${merge_qobject_headers})
|
||||||
@@ -33,10 +33,9 @@ add_library (Merge STATIC
|
|||||||
${merge_moc_sources}
|
${merge_moc_sources}
|
||||||
)
|
)
|
||||||
|
|
||||||
#target_compile_features (Merge
|
target_compile_features (Merge
|
||||||
# PUBLIC cxx_std_11
|
PUBLIC cxx_std_20
|
||||||
#)
|
)
|
||||||
set_property (TARGET Merge PROPERTY CXX_STANDARD 11)
|
|
||||||
|
|
||||||
target_include_directories (Merge
|
target_include_directories (Merge
|
||||||
PUBLIC ..
|
PUBLIC ..
|
||||||
|
|||||||
+34
-36
@@ -1,39 +1,38 @@
|
|||||||
/* Merge/Factory.cpp
|
// Merge/Factory.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "Factory.h"
|
|
||||||
|
|
||||||
#include "None.h"
|
|
||||||
#include "TextCsv.h"
|
|
||||||
#include "TextCsvKeys.h"
|
|
||||||
#include "TextTsv.h"
|
|
||||||
#include "TextTsvKeys.h"
|
|
||||||
#include "TextColon.h"
|
|
||||||
#include "TextColonKeys.h"
|
|
||||||
#include "TextSemicolon.h"
|
|
||||||
#include "TextSemicolonKeys.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "Factory.hpp"
|
||||||
{
|
|
||||||
namespace merge
|
#include "None.hpp"
|
||||||
|
#include "TextCsv.hpp"
|
||||||
|
#include "TextCsvKeys.hpp"
|
||||||
|
#include "TextTsv.hpp"
|
||||||
|
#include "TextTsvKeys.hpp"
|
||||||
|
#include "TextColon.hpp"
|
||||||
|
#include "TextColonKeys.hpp"
|
||||||
|
#include "TextSemicolon.hpp"
|
||||||
|
#include "TextSemicolonKeys.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
{
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -218,5 +217,4 @@ namespace glabels
|
|||||||
mNameList << name;
|
mNameList << name;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,110 +0,0 @@
|
|||||||
/* Merge/Factory.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_Factory_h
|
|
||||||
#define merge_Factory_h
|
|
||||||
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QMap>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward references
|
|
||||||
class Merge;
|
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Factory
|
|
||||||
///
|
|
||||||
class Factory
|
|
||||||
{
|
|
||||||
Q_DECLARE_TR_FUNCTIONS(Factory)
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Source Type
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
enum SourceType { NONE, FIXED, FILE };
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
protected:
|
|
||||||
Factory();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static void init();
|
|
||||||
|
|
||||||
static Merge* createMerge( const QString& id );
|
|
||||||
|
|
||||||
static QStringList nameList();
|
|
||||||
static QString idToName( const QString& id );
|
|
||||||
static QString nameToId( const QString& name );
|
|
||||||
static SourceType idToType( const QString& id );
|
|
||||||
static QString indexToId( int index );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// private methods
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
using CreateFct = Merge* (*)();
|
|
||||||
|
|
||||||
static void registerBackend( const QString& id,
|
|
||||||
const QString& name,
|
|
||||||
SourceType type,
|
|
||||||
CreateFct create );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// private data
|
|
||||||
/////////////////////////////////
|
|
||||||
class BackendEntry
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QString id;
|
|
||||||
QString name;
|
|
||||||
SourceType type;
|
|
||||||
CreateFct create;
|
|
||||||
};
|
|
||||||
|
|
||||||
static QMap<QString,BackendEntry> mBackendIdMap;
|
|
||||||
static QMap<QString,BackendEntry> mBackendNameMap;
|
|
||||||
|
|
||||||
static QStringList mNameList;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_Factory_h
|
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
// Merge/Factory.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_Factory_hpp
|
||||||
|
#define merge_Factory_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QMap>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward references
|
||||||
|
class Merge;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Factory
|
||||||
|
///
|
||||||
|
class Factory
|
||||||
|
{
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(Factory)
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Source Type
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
enum SourceType { NONE, FIXED, FILE };
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
protected:
|
||||||
|
Factory();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static void init();
|
||||||
|
|
||||||
|
static Merge* createMerge( const QString& id );
|
||||||
|
|
||||||
|
static QStringList nameList();
|
||||||
|
static QString idToName( const QString& id );
|
||||||
|
static QString nameToId( const QString& name );
|
||||||
|
static SourceType idToType( const QString& id );
|
||||||
|
static QString indexToId( int index );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// private methods
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
using CreateFct = Merge* (*)();
|
||||||
|
|
||||||
|
static void registerBackend( const QString& id,
|
||||||
|
const QString& name,
|
||||||
|
SourceType type,
|
||||||
|
CreateFct create );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// private data
|
||||||
|
/////////////////////////////////
|
||||||
|
class BackendEntry
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString id;
|
||||||
|
QString name;
|
||||||
|
SourceType type;
|
||||||
|
CreateFct create;
|
||||||
|
};
|
||||||
|
|
||||||
|
static QMap<QString,BackendEntry> mBackendIdMap;
|
||||||
|
static QMap<QString,BackendEntry> mBackendNameMap;
|
||||||
|
|
||||||
|
static QStringList mNameList;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_Factory_hpp
|
||||||
+22
-25
@@ -1,30 +1,28 @@
|
|||||||
/* Merge/Merge.cpp
|
// Merge/Merge.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2015-2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2015-2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "Merge.h"
|
#include "Merge.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels::merge
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -197,5 +195,4 @@ namespace glabels
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,124 +0,0 @@
|
|||||||
/* Merge/Merge.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2015-2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_Merge_h
|
|
||||||
#define merge_Merge_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Record.h"
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QString>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QList>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward references
|
|
||||||
class Record;
|
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Merge Object
|
|
||||||
///
|
|
||||||
class Merge : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
protected:
|
|
||||||
Merge() = default;
|
|
||||||
Merge( const Merge* merge );
|
|
||||||
public:
|
|
||||||
virtual ~Merge() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
virtual Merge* clone() const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Properties
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
QString id() const;
|
|
||||||
QString source() const;
|
|
||||||
void setSource( const QString& source );
|
|
||||||
void reloadSource();
|
|
||||||
|
|
||||||
const QList<Record>& recordList( ) const;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Selection methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
void setSelected( int i, bool state = true );
|
|
||||||
void selectAll();
|
|
||||||
void unselectAll();
|
|
||||||
|
|
||||||
int nSelectedRecords() const;
|
|
||||||
const QList<Record> selectedRecords() const;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Virtual methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
virtual QStringList keys() const = 0;
|
|
||||||
virtual QString primaryKey() const = 0;
|
|
||||||
protected:
|
|
||||||
virtual void open() = 0;
|
|
||||||
virtual void close() = 0;
|
|
||||||
virtual Record readNextRecord() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void sourceChanged();
|
|
||||||
void selectionChanged();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private data
|
|
||||||
/////////////////////////////////
|
|
||||||
protected:
|
|
||||||
QString mId;
|
|
||||||
private:
|
|
||||||
QString mSource;
|
|
||||||
QList<Record> mRecordList;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_Merge_h
|
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
// Merge/Merge.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2015-2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_Merge_hpp
|
||||||
|
#define merge_Merge_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Record.hpp"
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward references
|
||||||
|
class Record;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Merge Object
|
||||||
|
///
|
||||||
|
class Merge : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
protected:
|
||||||
|
Merge() = default;
|
||||||
|
Merge( const Merge* merge );
|
||||||
|
public:
|
||||||
|
virtual ~Merge() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
virtual Merge* clone() const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
QString id() const;
|
||||||
|
QString source() const;
|
||||||
|
void setSource( const QString& source );
|
||||||
|
void reloadSource();
|
||||||
|
|
||||||
|
const QList<Record>& recordList( ) const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Selection methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
void setSelected( int i, bool state = true );
|
||||||
|
void selectAll();
|
||||||
|
void unselectAll();
|
||||||
|
|
||||||
|
int nSelectedRecords() const;
|
||||||
|
const QList<Record> selectedRecords() const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Virtual methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
virtual QStringList keys() const = 0;
|
||||||
|
virtual QString primaryKey() const = 0;
|
||||||
|
protected:
|
||||||
|
virtual void open() = 0;
|
||||||
|
virtual void close() = 0;
|
||||||
|
virtual Record readNextRecord() = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void sourceChanged();
|
||||||
|
void selectionChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private data
|
||||||
|
/////////////////////////////////
|
||||||
|
protected:
|
||||||
|
QString mId;
|
||||||
|
private:
|
||||||
|
QString mSource;
|
||||||
|
QList<Record> mRecordList;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_Merge_hpp
|
||||||
+24
-26
@@ -1,29 +1,28 @@
|
|||||||
/* Merge/None.cpp
|
// Merge/None.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2015-2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2015-2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "None.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "None.hpp"
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
|
namespace glabels::merge
|
||||||
{
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -113,5 +112,4 @@ namespace glabels
|
|||||||
return NullRecord();
|
return NullRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
/* Merge/None.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2015-2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_None_h
|
|
||||||
#define merge_None_h
|
|
||||||
|
|
||||||
#include "Merge.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// None Merge Backend
|
|
||||||
///
|
|
||||||
struct None : public Merge
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
None();
|
|
||||||
None( const None* merge );
|
|
||||||
virtual ~None() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
None* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Implementation of virtual methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
QStringList keys() const override;
|
|
||||||
QString primaryKey() const override;
|
|
||||||
protected:
|
|
||||||
void open() override;
|
|
||||||
void close() override;
|
|
||||||
Record readNextRecord() override;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_None_h
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
// Merge/None.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2015-2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_None_hpp
|
||||||
|
#define merge_None_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Merge.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// None Merge Backend
|
||||||
|
///
|
||||||
|
struct None : public Merge
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
None();
|
||||||
|
None( const None* merge );
|
||||||
|
virtual ~None() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
None* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Implementation of virtual methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
QStringList keys() const override;
|
||||||
|
QString primaryKey() const override;
|
||||||
|
protected:
|
||||||
|
void open() override;
|
||||||
|
void close() override;
|
||||||
|
Record readNextRecord() override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_None_hpp
|
||||||
+24
-26
@@ -1,29 +1,28 @@
|
|||||||
/* Merge/Record.cpp
|
// Merge/Record.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2013-2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2013-2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "Record.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "Record.hpp"
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
|
namespace glabels::merge
|
||||||
{
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -43,5 +42,4 @@ namespace glabels
|
|||||||
mSelected = value;
|
mSelected = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
/* Merge/Record.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2013-2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_Record_h
|
|
||||||
#define merge_Record_h
|
|
||||||
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include <QMap>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Merge Record
|
|
||||||
///
|
|
||||||
class Record : public QMap<QString,QString>
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Properties
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
bool isSelected() const;
|
|
||||||
void setSelected( bool value );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private data
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
bool mSelected{ true };
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
using NullRecord = const Record;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_Record_h
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
// Merge/Record.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2013-2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_Record_hpp
|
||||||
|
#define merge_Record_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QMap>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Merge Record
|
||||||
|
///
|
||||||
|
class Record : public QMap<QString,QString>
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
bool isSelected() const;
|
||||||
|
void setSelected( bool value );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
bool mSelected{ true };
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
using NullRecord = const Record;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_Record_hpp
|
||||||
+24
-27
@@ -1,34 +1,32 @@
|
|||||||
/* Merge/Text.cpp
|
// Merge/Text.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
#include "Text.hpp"
|
||||||
|
|
||||||
#include "Record.h"
|
#include "Record.hpp"
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels::merge
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -415,5 +413,4 @@ namespace glabels
|
|||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
/* Merge/Text.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_Text_h
|
|
||||||
#define merge_Text_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Merge.h"
|
|
||||||
|
|
||||||
#include <QFile>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Text Merge Backend
|
|
||||||
///
|
|
||||||
struct Text : public Merge
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
protected:
|
|
||||||
Text( QChar delimiter, bool line1HasKeys );
|
|
||||||
Text( const Text* merge );
|
|
||||||
virtual ~Text() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Implementation of virtual methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
QStringList keys() const override;
|
|
||||||
QString primaryKey() const override;
|
|
||||||
protected:
|
|
||||||
void open() override;
|
|
||||||
void close() override;
|
|
||||||
Record readNextRecord() override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
/////////////////////////////////
|
|
||||||
QString keyFromIndex( int iField ) const;
|
|
||||||
QStringList parseLine();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private data
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
QChar mDelimeter;
|
|
||||||
bool mLine1HasKeys;
|
|
||||||
|
|
||||||
QFile mFile;
|
|
||||||
QStringList mKeys;
|
|
||||||
int mNFieldsMax;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_Text_h
|
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
// Merge/Text.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_Text_hpp
|
||||||
|
#define merge_Text_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Merge.hpp"
|
||||||
|
|
||||||
|
#include <QFile>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Text Merge Backend
|
||||||
|
///
|
||||||
|
struct Text : public Merge
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
protected:
|
||||||
|
Text( QChar delimiter, bool line1HasKeys );
|
||||||
|
Text( const Text* merge );
|
||||||
|
virtual ~Text() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Implementation of virtual methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
QStringList keys() const override;
|
||||||
|
QString primaryKey() const override;
|
||||||
|
protected:
|
||||||
|
void open() override;
|
||||||
|
void close() override;
|
||||||
|
Record readNextRecord() override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private methods
|
||||||
|
/////////////////////////////////
|
||||||
|
QString keyFromIndex( int iField ) const;
|
||||||
|
QStringList parseLine();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
QChar mDelimeter;
|
||||||
|
bool mLine1HasKeys;
|
||||||
|
|
||||||
|
QFile mFile;
|
||||||
|
QStringList mKeys;
|
||||||
|
int mNFieldsMax;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_Text_hpp
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
/* Merge/TextColon.cpp
|
// Merge/TextColon.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "TextColon.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "TextColon.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
{
|
{
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
static const QString ID = "Text/Colon";
|
static const QString ID = "Text/Colon";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -72,5 +74,4 @@ namespace glabels
|
|||||||
return new TextColon();
|
return new TextColon();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Merge/TextColon.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_TextColon_h
|
|
||||||
#define merge_TextColon_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// TextColon Merge Backend
|
|
||||||
///
|
|
||||||
struct TextColon : public Text
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
TextColon();
|
|
||||||
TextColon( const TextColon* merge );
|
|
||||||
virtual ~TextColon() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
TextColon* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextColon_h
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
// Merge/TextColon.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_TextColon_hpp
|
||||||
|
#define merge_TextColon_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Text.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// TextColon Merge Backend
|
||||||
|
///
|
||||||
|
struct TextColon : public Text
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
TextColon();
|
||||||
|
TextColon( const TextColon* merge );
|
||||||
|
virtual ~TextColon() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
TextColon* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_TextColon_hpp
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
/* Merge/TextColonKeys.cpp
|
// Merge/TextColonKeys.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "TextColonKeys.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "TextColonKeys.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
{
|
{
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
static const QString ID = "Text/Colon/Line1Keys";
|
static const QString ID = "Text/Colon/Line1Keys";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -72,5 +74,4 @@ namespace glabels
|
|||||||
return new TextColonKeys();
|
return new TextColonKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Merge/TextColonKeys.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_TextColonKeys_h
|
|
||||||
#define merge_TextColonKeys_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// TextColonKeys Merge Backend
|
|
||||||
///
|
|
||||||
struct TextColonKeys : public Text
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
TextColonKeys();
|
|
||||||
TextColonKeys( const TextColonKeys* merge );
|
|
||||||
virtual ~TextColonKeys() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
TextColonKeys* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextColonKeys_h
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
// Merge/TextColonKeys.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_TextColonKeys_hpp
|
||||||
|
#define merge_TextColonKeys_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Text.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// TextColonKeys Merge Backend
|
||||||
|
///
|
||||||
|
struct TextColonKeys : public Text
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
TextColonKeys();
|
||||||
|
TextColonKeys( const TextColonKeys* merge );
|
||||||
|
virtual ~TextColonKeys() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
TextColonKeys* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_TextColonKeys_hpp
|
||||||
+28
-27
@@ -1,34 +1,36 @@
|
|||||||
/* Merge/TextCsv.cpp
|
// Merge/TextCsv.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "TextCsv.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "TextCsv.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
{
|
{
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
static const QString ID = "Text/Comma";
|
static const QString ID = "Text/Comma";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -72,5 +74,4 @@ namespace glabels
|
|||||||
return new TextCsv();
|
return new TextCsv();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Merge/TextCsv.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_TextCsv_h
|
|
||||||
#define merge_TextCsv_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// TextCsv Merge Backend
|
|
||||||
///
|
|
||||||
struct TextCsv : public Text
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
TextCsv();
|
|
||||||
TextCsv( const TextCsv* merge );
|
|
||||||
virtual ~TextCsv() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
TextCsv* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextCsv_h
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
// Merge/TextCsv.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_TextCsv_hpp
|
||||||
|
#define merge_TextCsv_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Text.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// TextCsv Merge Backend
|
||||||
|
///
|
||||||
|
struct TextCsv : public Text
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
TextCsv();
|
||||||
|
TextCsv( const TextCsv* merge );
|
||||||
|
virtual ~TextCsv() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
TextCsv* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_TextCsv_hpp
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
/* Merge/TextCsvKeys.cpp
|
// Merge/TextCsvKeys.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "TextCsvKeys.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "TextCsvKeys.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
{
|
{
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
static const QString ID = "Text/Comma/Line1Keys";
|
static const QString ID = "Text/Comma/Line1Keys";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -72,5 +74,4 @@ namespace glabels
|
|||||||
return new TextCsvKeys();
|
return new TextCsvKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Merge/TextCsvKeys.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_TextCsvKeys_h
|
|
||||||
#define merge_TextCsvKeys_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// TextCsvKeys Merge Backend
|
|
||||||
///
|
|
||||||
struct TextCsvKeys : public Text
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
TextCsvKeys();
|
|
||||||
TextCsvKeys( const TextCsvKeys* merge );
|
|
||||||
virtual ~TextCsvKeys() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
TextCsvKeys* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextCsvKeys_h
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
// Merge/TextCsvKeys.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_TextCsvKeys_hpp
|
||||||
|
#define merge_TextCsvKeys_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Text.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// TextCsvKeys Merge Backend
|
||||||
|
///
|
||||||
|
struct TextCsvKeys : public Text
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
TextCsvKeys();
|
||||||
|
TextCsvKeys( const TextCsvKeys* merge );
|
||||||
|
virtual ~TextCsvKeys() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
TextCsvKeys* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_TextCsvKeys_hpp
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
/* Merge/TextSemicolon.cpp
|
// Merge/TextSemicolon.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "TextSemicolon.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "TextSemicolon.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
{
|
{
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
static const QString ID = "Text/Semicolon";
|
static const QString ID = "Text/Semicolon";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -72,5 +74,4 @@ namespace glabels
|
|||||||
return new TextSemicolon();
|
return new TextSemicolon();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Merge/TextSemicolon.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_TextSemicolon_h
|
|
||||||
#define merge_TextSemicolon_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// TextSemicolon Merge Backend
|
|
||||||
///
|
|
||||||
struct TextSemicolon : public Text
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
TextSemicolon();
|
|
||||||
TextSemicolon( const TextSemicolon* merge );
|
|
||||||
virtual ~TextSemicolon() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
TextSemicolon* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextSemicolon_h
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
// Merge/TextSemicolon.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_TextSemicolon_hpp
|
||||||
|
#define merge_TextSemicolon_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Text.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// TextSemicolon Merge Backend
|
||||||
|
///
|
||||||
|
struct TextSemicolon : public Text
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
TextSemicolon();
|
||||||
|
TextSemicolon( const TextSemicolon* merge );
|
||||||
|
virtual ~TextSemicolon() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
TextSemicolon* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_TextSemicolon_hpp
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
/* Merge/TextSemicolonKeys.cpp
|
// Merge/TextSemicolonKeys.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "TextSemicolonKeys.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "TextSemicolonKeys.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
{
|
{
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
static const QString ID = "Text/Semicolon/Keys";
|
static const QString ID = "Text/Semicolon/Keys";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -72,5 +74,4 @@ namespace glabels
|
|||||||
return new TextSemicolonKeys();
|
return new TextSemicolonKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Merge/TextSemicolonKeys.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_TextSemicolonKeys_h
|
|
||||||
#define merge_TextSemicolonKeys_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// TextSemicolonKeys Merge Backend
|
|
||||||
///
|
|
||||||
struct TextSemicolonKeys : public Text
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
TextSemicolonKeys();
|
|
||||||
TextSemicolonKeys( const TextSemicolonKeys* merge );
|
|
||||||
virtual ~TextSemicolonKeys() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
TextSemicolonKeys* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextSemicolonKeys_h
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
// Merge/TextSemicolonKeys.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_TextSemicolonKeys_hpp
|
||||||
|
#define merge_TextSemicolonKeys_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Text.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// TextSemicolonKeys Merge Backend
|
||||||
|
///
|
||||||
|
struct TextSemicolonKeys : public Text
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
TextSemicolonKeys();
|
||||||
|
TextSemicolonKeys( const TextSemicolonKeys* merge );
|
||||||
|
virtual ~TextSemicolonKeys() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
TextSemicolonKeys* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_TextSemicolonKeys_hpp
|
||||||
+28
-27
@@ -1,34 +1,36 @@
|
|||||||
/* Merge/TextTsv.cpp
|
// Merge/TextTsv.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "TextTsv.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "TextTsv.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
{
|
{
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
static const QString ID = "Text/Tab";
|
static const QString ID = "Text/Tab";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -72,5 +74,4 @@ namespace glabels
|
|||||||
return new TextTsv();
|
return new TextTsv();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Merge/TextTsv.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_TextTsv_h
|
|
||||||
#define merge_TextTsv_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// TextTsv Merge Backend
|
|
||||||
///
|
|
||||||
struct TextTsv : public Text
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
TextTsv();
|
|
||||||
TextTsv( const TextTsv* merge );
|
|
||||||
virtual ~TextTsv() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
TextTsv* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextTsv_h
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
// Merge/TextTsv.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_TextTsv_hpp
|
||||||
|
#define merge_TextTsv_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Text.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// TextTsv Merge Backend
|
||||||
|
///
|
||||||
|
struct TextTsv : public Text
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
TextTsv();
|
||||||
|
TextTsv( const TextTsv* merge );
|
||||||
|
virtual ~TextTsv() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
TextTsv* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_TextTsv_hpp
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
/* Merge/TextTsvKeys.cpp
|
// Merge/TextTsvKeys.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "TextTsvKeys.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
#include "TextTsvKeys.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
{
|
{
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
static const QString ID = "Text/Tab/Line1Keys";
|
static const QString ID = "Text/Tab/Line1Keys";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -72,5 +74,5 @@ namespace glabels
|
|||||||
return new TextTsvKeys();
|
return new TextTsvKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace merge
|
}
|
||||||
} // namespace glabels
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Merge/TextTsvKeys.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef merge_TextTsvKeys_h
|
|
||||||
#define merge_TextTsvKeys_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
namespace merge
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// TextTsvKeys Merge Backend
|
|
||||||
///
|
|
||||||
struct TextTsvKeys : public Text
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
TextTsvKeys();
|
|
||||||
TextTsvKeys( const TextTsvKeys* merge );
|
|
||||||
virtual ~TextTsvKeys() = default;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Object duplication
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
TextTsvKeys* clone() const override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Static methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
static QString id();
|
|
||||||
static Merge* create();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextTsvKeys_h
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
// Merge/TextTsvKeys.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef merge_TextTsvKeys_hpp
|
||||||
|
#define merge_TextTsvKeys_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "Text.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels::merge
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// TextTsvKeys Merge Backend
|
||||||
|
///
|
||||||
|
struct TextTsvKeys : public Text
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
TextTsvKeys();
|
||||||
|
TextTsvKeys( const TextTsvKeys* merge );
|
||||||
|
virtual ~TextTsvKeys() = default;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Object duplication
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
TextTsvKeys* clone() const override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Static methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
static QString id();
|
||||||
|
static Merge* create();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // merge_TextTsvKeys_hpp
|
||||||
+39
-20
@@ -4,29 +4,20 @@ Glabels Coding Style
|
|||||||
This file describes the coding style used in all glabels source code. Any
|
This file describes the coding style used in all glabels source code. Any
|
||||||
patches or pull requests should adhere to this style.
|
patches or pull requests should adhere to this style.
|
||||||
|
|
||||||
:bulb: **Note:** The top-level glabels source directory includes a *.clang-format* file.
|
|
||||||
This file can be used with `clang-format` to reformat code to a reasonable approximation
|
|
||||||
of the style described here.
|
|
||||||
|
|
||||||
|
|
||||||
Formatting
|
Formatting
|
||||||
----------
|
----------
|
||||||
|
|
||||||
### Tabs vs. Spaces
|
### Tabs vs. Spaces
|
||||||
|
|
||||||
Tabs are only used at the beginning of a line, and only used to express
|
Use spaces for all code indentation and line-to-line alignment of code elements.
|
||||||
indentation level. Spaces are used for any other type of vertical alignment,
|
(e.g. aligning function arguments). This ensures that the code displays
|
||||||
e.g. aligning function arguments. This ensures that the code displays
|
correctly everywhere.
|
||||||
correctly everywhere, regardless of the viewer's tab size, and does not inflict
|
|
||||||
the viewer with my choice of tab size (8 spaces).
|
|
||||||
|
|
||||||
I use the emacs smart-tabs-mode to automatically enforce this. See
|
|
||||||
https://www.emacswiki.org/emacs/SmartTabs for more information.
|
|
||||||
|
|
||||||
|
|
||||||
### Indentation Style
|
### Indentation Style
|
||||||
|
|
||||||
Glabels code uses the Allman style (a.k.a "BSD Style") of code indentation.
|
Glabels code uses the Allman[^1] style (a.k.a "BSD Style") of code indentation.
|
||||||
I.e. the brace associated with a control statement is placed on the next line,
|
I.e. the brace associated with a control statement is placed on the next line,
|
||||||
indented to the same level as the control statement. Statements within the
|
indented to the same level as the control statement. Statements within the
|
||||||
braces are indented to the next level.
|
braces are indented to the next level.
|
||||||
@@ -50,8 +41,6 @@ else
|
|||||||
|
|
||||||
Also applies to function, class and namespace declaration statements.
|
Also applies to function, class and namespace declaration statements.
|
||||||
|
|
||||||
See https://en.wikipedia.org/wiki/Indent_style#Allman_style for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
|
|
||||||
### Parenthesis
|
### Parenthesis
|
||||||
@@ -98,8 +87,8 @@ Code Organization
|
|||||||
Generally code is organized into modules. Usually a module defines a single
|
Generally code is organized into modules. Usually a module defines a single
|
||||||
class or a small namespace of functions/constants/etc. A module is defined by
|
class or a small namespace of functions/constants/etc. A module is defined by
|
||||||
two files: a header file (its specification) and an implementation file.
|
two files: a header file (its specification) and an implementation file.
|
||||||
Header filenames have a ".h" extension and implementation filenames have a
|
Header filenames have a `.hpp` extension[^2] and implementation filenames have a
|
||||||
".cpp" extension.
|
`.cpp` extension.
|
||||||
|
|
||||||
|
|
||||||
### Self-contained Headers
|
### Self-contained Headers
|
||||||
@@ -114,8 +103,8 @@ shall include its header file before any other includes.
|
|||||||
All header files should have an ifndef guard to prevent multiple inclusion.
|
All header files should have an ifndef guard to prevent multiple inclusion.
|
||||||
|
|
||||||
```
|
```
|
||||||
#ifndef ns_Module_h
|
#ifndef ns_Module_hpp
|
||||||
#define ns_Module_h
|
#define ns_Module_hpp
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
@@ -127,7 +116,7 @@ All header files should have an ifndef guard to prevent multiple inclusion.
|
|||||||
|
|
||||||
Header files should be included in the following order.
|
Header files should be included in the following order.
|
||||||
|
|
||||||
1. header file for this module (e.g. this would be "Foo.h" in "Foo.cpp").
|
1. header file for this module (e.g. this would be `Foo.hpp` in `Foo.cpp`).
|
||||||
2. Glabels header files.
|
2. Glabels header files.
|
||||||
3. Qt header files
|
3. Qt header files
|
||||||
3. C++ system header files (e.g. STL files)
|
3. C++ system header files (e.g. STL files)
|
||||||
@@ -152,3 +141,33 @@ include directives instead.
|
|||||||
|
|
||||||
- Private definitions are placed in unnamed namespaces to limit scope to the current translation unit.
|
- Private definitions are placed in unnamed namespaces to limit scope to the current translation unit.
|
||||||
- All other glabels code is placed in the top-level "glabels" namespace.
|
- All other glabels code is placed in the top-level "glabels" namespace.
|
||||||
|
- Nested namespace declarations should follow the more concise C++17 syntax
|
||||||
|
```
|
||||||
|
namespace glabels::model
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Notes
|
||||||
|
-----
|
||||||
|
|
||||||
|
### Emacs
|
||||||
|
|
||||||
|
The following is an excerpt from my emacs configuration supporting the style
|
||||||
|
```
|
||||||
|
(defun my-c++-hook ()
|
||||||
|
(setq c-default-style "bsd"
|
||||||
|
c-basic-offset 8
|
||||||
|
indent-tabs-mode nil
|
||||||
|
show-trailing-whitespace t))
|
||||||
|
|
||||||
|
(add-hook 'c++-mode-hook 'my-c++-hook)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
References
|
||||||
|
----------
|
||||||
|
[^1]: https://en.wikipedia.org/wiki/Indent_style#Allman_style
|
||||||
|
[^2]: [C++ Weekly - Ep 442 - Stop Using .h For C++ Header Files!](https://www.youtube.com/watch?v=mr3sOT-Delg)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ add_executable (glabels-batch-qt
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_compile_features (glabels-batch-qt
|
target_compile_features (glabels-batch-qt
|
||||||
PUBLIC cxx_std_11
|
PUBLIC cxx_std_20
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries (glabels-batch-qt
|
target_link_libraries (glabels-batch-qt
|
||||||
|
|||||||
+28
-27
@@ -1,32 +1,33 @@
|
|||||||
/* main.cpp
|
// main.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2013-2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2013-2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "model/FileUtil.h"
|
|
||||||
#include "model/Db.h"
|
|
||||||
#include "model/Model.h"
|
|
||||||
#include "model/PageRenderer.h"
|
|
||||||
#include "model/Version.h"
|
|
||||||
#include "model/XmlLabelParser.h"
|
|
||||||
|
|
||||||
#include "barcode/Backends.h"
|
#include "model/FileUtil.hpp"
|
||||||
#include "merge/Factory.h"
|
#include "model/Db.hpp"
|
||||||
|
#include "model/Model.hpp"
|
||||||
|
#include "model/PageRenderer.hpp"
|
||||||
|
#include "model/Version.hpp"
|
||||||
|
#include "model/XmlLabelParser.hpp"
|
||||||
|
|
||||||
|
#include "barcode/Backends.hpp"
|
||||||
|
#include "merge/Factory.hpp"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|||||||
+23
-22
@@ -1,30 +1,31 @@
|
|||||||
/* AboutDialog.cpp
|
// AboutDialog.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "AboutDialog.h"
|
|
||||||
|
|
||||||
#include "model/Version.h"
|
#include "AboutDialog.hpp"
|
||||||
|
|
||||||
|
#include "model/Version.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QtDebug>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
/* AboutDialog.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef AboutDialog_h
|
|
||||||
#define AboutDialog_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "ui_AboutDialog.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// About Dialog Widget
|
|
||||||
///
|
|
||||||
class AboutDialog : public QDialog, public Ui_AboutDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
AboutDialog( QWidget *parent = nullptr );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Slots
|
|
||||||
/////////////////////////////////
|
|
||||||
private slots:
|
|
||||||
void onLicenseButtonClicked();
|
|
||||||
void onWebsiteButtonClicked();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // AboutDialog_h
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
// AboutDialog.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef AboutDialog_hpp
|
||||||
|
#define AboutDialog_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "ui_AboutDialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// About Dialog Widget
|
||||||
|
///
|
||||||
|
class AboutDialog : public QDialog, public Ui_AboutDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
AboutDialog( QWidget *parent = nullptr );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
void onLicenseButtonClicked();
|
||||||
|
void onWebsiteButtonClicked();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // AboutDialog_hpp
|
||||||
+24
-23
@@ -1,30 +1,31 @@
|
|||||||
/* BarcodeMenu.cpp
|
// BarcodeMenu.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "BarcodeMenu.h"
|
|
||||||
|
|
||||||
#include "BarcodeMenuItem.h"
|
#include "BarcodeMenu.hpp"
|
||||||
|
|
||||||
#include "barcode/Backends.h"
|
#include "BarcodeMenuItem.hpp"
|
||||||
|
|
||||||
#include <QtDebug>
|
#include "barcode/Backends.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
/* BarcodeMenu.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BarcodeMenu_h
|
|
||||||
#define BarcodeMenu_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "barcode/Style.h"
|
|
||||||
|
|
||||||
#include <QMenu>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Barcode Menu
|
|
||||||
///
|
|
||||||
class BarcodeMenu : public QMenu
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
BarcodeMenu();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void selectionChanged();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Properties
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
barcode::Style bcStyle() const;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Slots
|
|
||||||
/////////////////////////////////
|
|
||||||
private slots:
|
|
||||||
void onMenuItemActivated( const barcode::Style& bcStyle );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Data
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
barcode::Style mBcStyle;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // BarcodeMenu_h
|
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
// BarcodeMenu.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef BarcodeMenu_hpp
|
||||||
|
#define BarcodeMenu_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "barcode/Style.hpp"
|
||||||
|
|
||||||
|
#include <QMenu>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Barcode Menu
|
||||||
|
///
|
||||||
|
class BarcodeMenu : public QMenu
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
BarcodeMenu();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void selectionChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
barcode::Style bcStyle() const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
void onMenuItemActivated( const barcode::Style& bcStyle );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
barcode::Style mBcStyle;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // BarcodeMenu_hpp
|
||||||
@@ -1,30 +1,31 @@
|
|||||||
/* BarcodeMenuButton.cpp
|
// BarcodeMenuButton.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "BarcodeMenuButton.h"
|
|
||||||
|
|
||||||
#include "BarcodeMenuItem.h"
|
#include "BarcodeMenuButton.hpp"
|
||||||
|
|
||||||
#include "barcode/Backends.h"
|
#include "BarcodeMenuItem.hpp"
|
||||||
|
|
||||||
#include <QtDebug>
|
#include "barcode/Backends.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
/* BarcodeMenuButton.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BarcodeMenuButton_h
|
|
||||||
#define BarcodeMenuButton_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "BarcodeMenu.h"
|
|
||||||
|
|
||||||
#include "barcode/Style.h"
|
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Barcode Menu Button
|
|
||||||
///
|
|
||||||
class BarcodeMenuButton : public QPushButton
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
BarcodeMenuButton( QWidget* parent = nullptr );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void selectionChanged();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Properties
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
barcode::Style bcStyle() const;
|
|
||||||
void setBcStyle( const barcode::Style& bcStyle );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Slots
|
|
||||||
/////////////////////////////////
|
|
||||||
private slots:
|
|
||||||
void onMenuSelectionChanged();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Data
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
BarcodeMenu* mMenu;
|
|
||||||
barcode::Style mBcStyle;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // BarcodeMenuButton_h
|
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
// BarcodeMenuButton.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef BarcodeMenuButton_hpp
|
||||||
|
#define BarcodeMenuButton_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "BarcodeMenu.hpp"
|
||||||
|
|
||||||
|
#include "barcode/Style.hpp"
|
||||||
|
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Barcode Menu Button
|
||||||
|
///
|
||||||
|
class BarcodeMenuButton : public QPushButton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
BarcodeMenuButton( QWidget* parent = nullptr );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void selectionChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
barcode::Style bcStyle() const;
|
||||||
|
void setBcStyle( const barcode::Style& bcStyle );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
void onMenuSelectionChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
BarcodeMenu* mMenu;
|
||||||
|
barcode::Style mBcStyle;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // BarcodeMenuButton_hpp
|
||||||
+22
-21
@@ -1,26 +1,27 @@
|
|||||||
/* BarcodeMenuItem.cpp
|
// BarcodeMenuItem.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "BarcodeMenuItem.h"
|
|
||||||
|
|
||||||
#include <QtDebug>
|
#include "BarcodeMenuItem.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
/* BarcodeMenuItem.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BarcodeMenuItem_h
|
|
||||||
#define BarcodeMenuItem_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "barcode/Style.h"
|
|
||||||
|
|
||||||
#include <QAction>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Barcode Menu Item
|
|
||||||
///
|
|
||||||
class BarcodeMenuItem : public QAction
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
BarcodeMenuItem( const barcode::Style& bcStyle, QObject* parent = nullptr );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void activated( const barcode::Style& bcStyle );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Properties
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
barcode::Style bcStyle() const;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Slots
|
|
||||||
/////////////////////////////////
|
|
||||||
private slots:
|
|
||||||
void onTriggered();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Data
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
barcode::Style mBcStyle;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // BarcodeMenuItem_h
|
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
// BarcodeMenuItem.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef BarcodeMenuItem_hpp
|
||||||
|
#define BarcodeMenuItem_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "barcode/Style.hpp"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Barcode Menu Item
|
||||||
|
///
|
||||||
|
class BarcodeMenuItem : public QAction
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
BarcodeMenuItem( const barcode::Style& bcStyle, QObject* parent = nullptr );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void activated( const barcode::Style& bcStyle );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
barcode::Style bcStyle() const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
void onTriggered();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
barcode::Style mBcStyle;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // BarcodeMenuItem_hpp
|
||||||
+30
-30
@@ -45,35 +45,35 @@ set (glabels_sources
|
|||||||
)
|
)
|
||||||
|
|
||||||
set (glabels_qobject_headers
|
set (glabels_qobject_headers
|
||||||
AboutDialog.h
|
AboutDialog.hpp
|
||||||
BarcodeMenu.h
|
BarcodeMenu.hpp
|
||||||
BarcodeMenuButton.h
|
BarcodeMenuButton.hpp
|
||||||
BarcodeMenuItem.h
|
BarcodeMenuItem.hpp
|
||||||
ColorButton.h
|
ColorButton.hpp
|
||||||
ColorHistory.h
|
ColorHistory.hpp
|
||||||
ColorPaletteDialog.h
|
ColorPaletteDialog.hpp
|
||||||
ColorPaletteItem.h
|
ColorPaletteItem.hpp
|
||||||
EditVariableDialog.h
|
EditVariableDialog.hpp
|
||||||
FieldButton.h
|
FieldButton.hpp
|
||||||
File.h
|
File.hpp
|
||||||
LabelEditor.h
|
LabelEditor.hpp
|
||||||
MainWindow.h
|
MainWindow.hpp
|
||||||
MergeTableModel.h
|
MergeTableModel.hpp
|
||||||
MergeView.h
|
MergeView.hpp
|
||||||
ObjectEditor.h
|
ObjectEditor.hpp
|
||||||
PreferencesDialog.h
|
PreferencesDialog.hpp
|
||||||
PrinterMonitor.h
|
PrinterMonitor.hpp
|
||||||
PrintView.h
|
PrintView.hpp
|
||||||
PropertiesView.h
|
PropertiesView.hpp
|
||||||
Preview.h
|
Preview.hpp
|
||||||
ReportBugDialog.h
|
ReportBugDialog.hpp
|
||||||
SelectProductDialog.h
|
SelectProductDialog.hpp
|
||||||
SimplePreview.h
|
SimplePreview.hpp
|
||||||
StartupView.h
|
StartupView.hpp
|
||||||
TemplateDesigner.h
|
TemplateDesigner.hpp
|
||||||
TemplatePicker.h
|
TemplatePicker.hpp
|
||||||
UndoRedoModel.h
|
UndoRedoModel.hpp
|
||||||
VariablesView.h
|
VariablesView.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set (glabels_forms
|
set (glabels_forms
|
||||||
@@ -131,7 +131,7 @@ add_executable (glabels-qt WIN32
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_compile_features (glabels-qt
|
target_compile_features (glabels-qt
|
||||||
PUBLIC cxx_std_11
|
PUBLIC cxx_std_20
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories (glabels-qt
|
target_include_directories (glabels-qt
|
||||||
|
|||||||
+26
-25
@@ -1,35 +1,33 @@
|
|||||||
/* ColorButton.cpp
|
// ColorButton.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "ColorButton.h"
|
|
||||||
|
|
||||||
#include "ColorSwatch.h"
|
#include "ColorButton.hpp"
|
||||||
|
|
||||||
|
#include "ColorSwatch.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QtDebug>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private
|
// Private
|
||||||
//
|
//
|
||||||
@@ -40,6 +38,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
ColorButton::ColorButton( QWidget* parent )
|
ColorButton::ColorButton( QWidget* parent )
|
||||||
: QPushButton( parent ), mIsDefault(0), mDialog(nullptr)
|
: QPushButton( parent ), mIsDefault(0), mDialog(nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,105 +0,0 @@
|
|||||||
/* ColorButton.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ColorButton_h
|
|
||||||
#define ColorButton_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "ColorPaletteDialog.h"
|
|
||||||
|
|
||||||
#include "model/ColorNode.h"
|
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Color Button
|
|
||||||
///
|
|
||||||
class ColorButton : public QPushButton
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
ColorButton( QWidget* parent = nullptr );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void colorChanged();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Public Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
void init( const QString& defaultLabel,
|
|
||||||
const QColor& defaultColor,
|
|
||||||
const QColor& color,
|
|
||||||
bool showUseFieldButton = true );
|
|
||||||
|
|
||||||
void setColorNode( model::ColorNode colorNode );
|
|
||||||
void setColor( QColor color );
|
|
||||||
void setToDefault();
|
|
||||||
model::ColorNode colorNode();
|
|
||||||
|
|
||||||
void setKeys( const merge::Merge* merge,
|
|
||||||
const model::Variables& variables );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Slots
|
|
||||||
/////////////////////////////////
|
|
||||||
private slots:
|
|
||||||
void onButtonToggled( bool checked );
|
|
||||||
void onPaletteDialogAccepted();
|
|
||||||
void onPaletteDialogRejected();
|
|
||||||
void onPaletteDialogChanged( model::ColorNode colorNode, bool isDefault );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Members
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
QColor mDefaultColor;
|
|
||||||
bool mIsDefault;
|
|
||||||
model::ColorNode mColorNode;
|
|
||||||
|
|
||||||
ColorPaletteDialog* mDialog;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorButton_h
|
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
// ColorButton.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef ColorButton_hpp
|
||||||
|
#define ColorButton_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "ColorPaletteDialog.hpp"
|
||||||
|
|
||||||
|
#include "model/ColorNode.hpp"
|
||||||
|
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Color Button
|
||||||
|
///
|
||||||
|
class ColorButton : public QPushButton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
ColorButton( QWidget* parent = nullptr );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void colorChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Public Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
void init( const QString& defaultLabel,
|
||||||
|
const QColor& defaultColor,
|
||||||
|
const QColor& color,
|
||||||
|
bool showUseFieldButton = true );
|
||||||
|
|
||||||
|
void setColorNode( model::ColorNode colorNode );
|
||||||
|
void setColor( QColor color );
|
||||||
|
void setToDefault();
|
||||||
|
model::ColorNode colorNode();
|
||||||
|
|
||||||
|
void setKeys( const merge::Merge* merge,
|
||||||
|
const model::Variables& variables );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
void onButtonToggled( bool checked );
|
||||||
|
void onPaletteDialogAccepted();
|
||||||
|
void onPaletteDialogRejected();
|
||||||
|
void onPaletteDialogChanged( model::ColorNode colorNode, bool isDefault );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Members
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
QColor mDefaultColor;
|
||||||
|
bool mIsDefault;
|
||||||
|
model::ColorNode mColorNode;
|
||||||
|
|
||||||
|
ColorPaletteDialog* mDialog;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // ColorButton_hpp
|
||||||
+22
-27
@@ -1,38 +1,33 @@
|
|||||||
/* ColorHistory.cpp
|
// ColorHistory.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "ColorHistory.h"
|
|
||||||
|
|
||||||
|
#include "ColorHistory.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QtDebug>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
ColorHistory::ColorHistory()
|
|
||||||
{
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ColorHistory* ColorHistory::instance()
|
ColorHistory* ColorHistory::instance()
|
||||||
{
|
{
|
||||||
static ColorHistory* singletonInstance = nullptr;
|
static ColorHistory* singletonInstance = nullptr;
|
||||||
|
|||||||
@@ -1,86 +0,0 @@
|
|||||||
/* ColorHistory.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ColorHistory_h
|
|
||||||
#define ColorHistory_h
|
|
||||||
|
|
||||||
|
|
||||||
#include <QColor>
|
|
||||||
#include <QObject>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Color History
|
|
||||||
///
|
|
||||||
class ColorHistory : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
static const int MAX_COLORS = 9;
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
ColorHistory();
|
|
||||||
|
|
||||||
public:
|
|
||||||
static ColorHistory* instance();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void changed();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Public Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
void addColor( const QColor& color, const QString& name );
|
|
||||||
QList<QColor> getColors();
|
|
||||||
QStringList getNames();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
QStringList readNameColorList();
|
|
||||||
void writeNameColorList( const QStringList& nameColorList );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Members
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorHistory_h
|
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
// ColorHistory.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef ColorHistory_hpp
|
||||||
|
#define ColorHistory_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Color History
|
||||||
|
///
|
||||||
|
class ColorHistory : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const int MAX_COLORS = 9;
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
ColorHistory() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static ColorHistory* instance();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void changed();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Public Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
void addColor( const QColor& color, const QString& name );
|
||||||
|
QList<QColor> getColors();
|
||||||
|
QStringList getNames();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
QStringList readNameColorList();
|
||||||
|
void writeNameColorList( const QStringList& nameColorList );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Members
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // ColorHistory_hpp
|
||||||
@@ -1,34 +1,34 @@
|
|||||||
/* ColorPaletteDialog.cpp
|
// ColorPaletteDialog.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "ColorPaletteDialog.h"
|
#include "ColorPaletteDialog.hpp"
|
||||||
|
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
|
#include <QDebug>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QtDebug>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
/* ColorPaletteDialog.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ColorPaletteDialog_h
|
|
||||||
#define ColorPaletteDialog_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "ColorHistory.h"
|
|
||||||
#include "ColorPaletteItem.h"
|
|
||||||
#include "FieldButton.h"
|
|
||||||
|
|
||||||
#include "model/ColorNode.h"
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Color Palette Dialog
|
|
||||||
///
|
|
||||||
class ColorPaletteDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
ColorPaletteDialog( const QString& defaultLabel,
|
|
||||||
const QColor& defaultColor,
|
|
||||||
const QColor& color,
|
|
||||||
bool showUseFieldButton = true,
|
|
||||||
QWidget* parent = nullptr );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void colorChanged( model::ColorNode colorNode, bool isDefault );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Public Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
void setColorNode( const model::ColorNode& colorNode );
|
|
||||||
|
|
||||||
void setKeys( const merge::Merge* merge,
|
|
||||||
const model::Variables& variables );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Slots
|
|
||||||
/////////////////////////////////
|
|
||||||
private slots:
|
|
||||||
void onPaletteItemActivated( int id );
|
|
||||||
void onHistoryItemActivated( int id );
|
|
||||||
void onDefaultButtonClicked();
|
|
||||||
void onCustomColorButtonClicked();
|
|
||||||
void onKeySelected( QString key );
|
|
||||||
void onColorHistoryChanged();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
void loadCustomColorHistory();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Members
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
QColor mDefaultColor;
|
|
||||||
model::ColorNode mColorNode;
|
|
||||||
|
|
||||||
static const int PALETTE_COLS = ColorHistory::MAX_COLORS;
|
|
||||||
static const int PALETTE_ROWS = 4;
|
|
||||||
|
|
||||||
struct ColorTableEntry {
|
|
||||||
QString colorSpec;
|
|
||||||
const char* trname;
|
|
||||||
};
|
|
||||||
|
|
||||||
static ColorTableEntry mColorTable[];
|
|
||||||
|
|
||||||
ColorHistory* mColorHistory;
|
|
||||||
ColorPaletteItem* mHistoryItem[PALETTE_COLS];
|
|
||||||
|
|
||||||
FieldButton* mFieldButton;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorPaletteDialog_h
|
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
// ColorPaletteDialog.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014-2016 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef ColorPaletteDialog_hpp
|
||||||
|
#define ColorPaletteDialog_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "ColorHistory.hpp"
|
||||||
|
#include "ColorPaletteItem.hpp"
|
||||||
|
#include "FieldButton.hpp"
|
||||||
|
|
||||||
|
#include "model/ColorNode.hpp"
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Color Palette Dialog
|
||||||
|
///
|
||||||
|
class ColorPaletteDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
ColorPaletteDialog( const QString& defaultLabel,
|
||||||
|
const QColor& defaultColor,
|
||||||
|
const QColor& color,
|
||||||
|
bool showUseFieldButton = true,
|
||||||
|
QWidget* parent = nullptr );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void colorChanged( model::ColorNode colorNode, bool isDefault );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Public Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
void setColorNode( const model::ColorNode& colorNode );
|
||||||
|
|
||||||
|
void setKeys( const merge::Merge* merge,
|
||||||
|
const model::Variables& variables );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
void onPaletteItemActivated( int id );
|
||||||
|
void onHistoryItemActivated( int id );
|
||||||
|
void onDefaultButtonClicked();
|
||||||
|
void onCustomColorButtonClicked();
|
||||||
|
void onKeySelected( QString key );
|
||||||
|
void onColorHistoryChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
void loadCustomColorHistory();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Members
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
QColor mDefaultColor;
|
||||||
|
model::ColorNode mColorNode;
|
||||||
|
|
||||||
|
static const int PALETTE_COLS = ColorHistory::MAX_COLORS;
|
||||||
|
static const int PALETTE_ROWS = 4;
|
||||||
|
|
||||||
|
struct ColorTableEntry {
|
||||||
|
QString colorSpec;
|
||||||
|
const char* trname;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ColorTableEntry mColorTable[];
|
||||||
|
|
||||||
|
ColorHistory* mColorHistory;
|
||||||
|
ColorPaletteItem* mHistoryItem[PALETTE_COLS];
|
||||||
|
|
||||||
|
FieldButton* mFieldButton;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // ColorPaletteDialog_hpp
|
||||||
@@ -1,32 +1,30 @@
|
|||||||
/* ColorPaletteItem.cpp
|
// ColorPaletteItem.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "ColorPaletteItem.h"
|
|
||||||
|
#include "ColorPaletteItem.hpp"
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private
|
// Private
|
||||||
//
|
//
|
||||||
@@ -40,6 +38,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor From Data
|
/// Constructor From Data
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
/* ColorPaletteItem.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ColorPaletteItem_h
|
|
||||||
#define ColorPaletteItem_h
|
|
||||||
|
|
||||||
|
|
||||||
#include <QColor>
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Color Palette Item
|
|
||||||
///
|
|
||||||
class ColorPaletteItem : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
ColorPaletteItem( int id,
|
|
||||||
const QColor& color,
|
|
||||||
const QString& tip,
|
|
||||||
QWidget* parent = nullptr );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void activated( int id );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Public Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
void setColor( int id,
|
|
||||||
const QColor& color,
|
|
||||||
const QString& tip );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Event handlers
|
|
||||||
/////////////////////////////////
|
|
||||||
protected:
|
|
||||||
void paintEvent( QPaintEvent* event ) override;
|
|
||||||
void enterEvent( QEnterEvent* event ) override;
|
|
||||||
void leaveEvent( QEvent* event ) override;
|
|
||||||
void mousePressEvent( QMouseEvent* event ) override;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Data
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
int mId;
|
|
||||||
QColor mColor;
|
|
||||||
QString mTip;
|
|
||||||
|
|
||||||
bool mHover;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorPaletteItem_h
|
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
// ColorPaletteItem.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef ColorPaletteItem_hpp
|
||||||
|
#define ColorPaletteItem_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Color Palette Item
|
||||||
|
///
|
||||||
|
class ColorPaletteItem : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
ColorPaletteItem( int id,
|
||||||
|
const QColor& color,
|
||||||
|
const QString& tip,
|
||||||
|
QWidget* parent = nullptr );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void activated( int id );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Public Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
void setColor( int id,
|
||||||
|
const QColor& color,
|
||||||
|
const QString& tip );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Event handlers
|
||||||
|
/////////////////////////////////
|
||||||
|
protected:
|
||||||
|
void paintEvent( QPaintEvent* event ) override;
|
||||||
|
void enterEvent( QEnterEvent* event ) override;
|
||||||
|
void leaveEvent( QEvent* event ) override;
|
||||||
|
void mousePressEvent( QMouseEvent* event ) override;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
int mId;
|
||||||
|
QColor mColor;
|
||||||
|
QString mTip;
|
||||||
|
|
||||||
|
bool mHover;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // ColorPaletteItem_hpp
|
||||||
+24
-23
@@ -1,31 +1,29 @@
|
|||||||
/* ColorSwatch.cpp
|
// ColorSwatch.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "ColorSwatch.h"
|
|
||||||
|
#include "ColorSwatch.hpp"
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private
|
// Private
|
||||||
//
|
//
|
||||||
@@ -36,6 +34,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
/* ColorSwatch.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ColorSwatch_h
|
|
||||||
#define ColorSwatch_h
|
|
||||||
|
|
||||||
|
|
||||||
#include <QPixmap>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Simple Preview Widget
|
|
||||||
///
|
|
||||||
class ColorSwatch : public QPixmap
|
|
||||||
{
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
ColorSwatch( int w, int h, const QColor& color );
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorSwatch_h
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
// ColorSwatch.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef ColorSwatch_hpp
|
||||||
|
#define ColorSwatch_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include <QPixmap>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Simple Preview Widget
|
||||||
|
///
|
||||||
|
class ColorSwatch : public QPixmap
|
||||||
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
ColorSwatch( int w, int h, const QColor& color );
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // ColorSwatch_hpp
|
||||||
+21
-20
@@ -1,24 +1,25 @@
|
|||||||
/* Cursors.cpp
|
// Cursors.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2013 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2013 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "Cursors.h"
|
|
||||||
|
#include "Cursors.hpp"
|
||||||
|
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
|
|||||||
@@ -1,98 +0,0 @@
|
|||||||
/* Cursors.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2013 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef Cursors_h
|
|
||||||
#define Cursors_h
|
|
||||||
|
|
||||||
|
|
||||||
#include <QCursor>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Glabels Cursors
|
|
||||||
///
|
|
||||||
namespace Cursors
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Crosshair : public QCursor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Crosshair();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class Move : public QCursor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Move();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class Barcode : public QCursor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Barcode();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class Box : public QCursor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Box();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class Ellipse : public QCursor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Ellipse();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class Image : public QCursor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Image();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class Line : public QCursor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Line();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class Text : public QCursor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Text();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // Cursors_h
|
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
// Cursors.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2013 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef Cursors_hpp
|
||||||
|
#define Cursors_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include <QCursor>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Glabels Cursors
|
||||||
|
///
|
||||||
|
namespace Cursors
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
class Crosshair : public QCursor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Crosshair();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Move : public QCursor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Move();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Barcode : public QCursor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Barcode();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Box : public QCursor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Box();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Ellipse : public QCursor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Ellipse();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Image : public QCursor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Image();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Line : public QCursor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Line();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Text : public QCursor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Text();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // Cursors_hpp
|
||||||
@@ -1,26 +1,27 @@
|
|||||||
/* EditVariableDialog.cpp
|
// EditVariableDialog.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2019 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2019 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "EditVariableDialog.h"
|
|
||||||
|
|
||||||
#include "model/Settings.h"
|
#include "EditVariableDialog.hpp"
|
||||||
|
|
||||||
|
#include "model/Settings.hpp"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
/* EditVariableDialog.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2019 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef EditVariableDialog_h
|
|
||||||
#define EditVariableDialog_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "ui_EditVariableDialog.h"
|
|
||||||
#include "model/Variable.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// New Label Dialog Widget
|
|
||||||
///
|
|
||||||
class EditVariableDialog : public QDialog, public Ui_EditVariableDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
EditVariableDialog( QWidget *parent = nullptr );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Public methods
|
|
||||||
/////////////////////////////////
|
|
||||||
void setVariable( const model::Variable& variable );
|
|
||||||
model::Variable variable() const;
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Slots
|
|
||||||
/////////////////////////////////
|
|
||||||
private slots:
|
|
||||||
void onNameEditChanged();
|
|
||||||
void onTypeComboChanged();
|
|
||||||
void onValueEditChanged();
|
|
||||||
void onColorValueButtonChanged();
|
|
||||||
void onIncrementComboChanged();
|
|
||||||
void onStepSizeEditChanged();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
/////////////////////////////////
|
|
||||||
void updateControls();
|
|
||||||
void validateCurrentInputs();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // EditVariableDialog_h
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
// EditVariableDialog.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2019 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef EditVariableDialog_hpp
|
||||||
|
#define EditVariableDialog_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "ui_EditVariableDialog.h"
|
||||||
|
|
||||||
|
#include "model/Variable.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// New Label Dialog Widget
|
||||||
|
///
|
||||||
|
class EditVariableDialog : public QDialog, public Ui_EditVariableDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
EditVariableDialog( QWidget *parent = nullptr );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Public methods
|
||||||
|
/////////////////////////////////
|
||||||
|
void setVariable( const model::Variable& variable );
|
||||||
|
model::Variable variable() const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
void onNameEditChanged();
|
||||||
|
void onTypeComboChanged();
|
||||||
|
void onValueEditChanged();
|
||||||
|
void onColorValueButtonChanged();
|
||||||
|
void onIncrementComboChanged();
|
||||||
|
void onStepSizeEditChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private methods
|
||||||
|
/////////////////////////////////
|
||||||
|
void updateControls();
|
||||||
|
void validateCurrentInputs();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // EditVariableDialog_hpp
|
||||||
+21
-20
@@ -1,24 +1,25 @@
|
|||||||
/* FieldButton.cpp
|
// FieldButton.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2019 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2019 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "FieldButton.h"
|
|
||||||
|
#include "FieldButton.hpp"
|
||||||
|
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
/* FieldButton.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2019 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef FieldButton_h
|
|
||||||
#define FieldButton_h
|
|
||||||
|
|
||||||
|
|
||||||
#include "model/Variables.h"
|
|
||||||
#include "merge/Merge.h"
|
|
||||||
|
|
||||||
#include <QAction>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QStringList>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Field Button
|
|
||||||
///
|
|
||||||
class FieldButton : public QPushButton
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Life Cycle
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
FieldButton( QWidget* parent = nullptr );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Signals
|
|
||||||
/////////////////////////////////
|
|
||||||
signals:
|
|
||||||
void keySelected( QString key );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Public Methods
|
|
||||||
/////////////////////////////////
|
|
||||||
public:
|
|
||||||
void setKeys( const merge::Merge* merge,
|
|
||||||
const model::Variables& variables );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Slots
|
|
||||||
/////////////////////////////////
|
|
||||||
private slots:
|
|
||||||
void onMenuActionTriggered( QAction* action );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Private Data
|
|
||||||
/////////////////////////////////
|
|
||||||
private:
|
|
||||||
QMenu mMenu;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // FieldButton_h
|
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
// FieldButton.hpp
|
||||||
|
//
|
||||||
|
// Copyright (C) 2019 Jaye Evins <evins@snaught.com>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef FieldButton_hpp
|
||||||
|
#define FieldButton_hpp
|
||||||
|
|
||||||
|
|
||||||
|
#include "model/Variables.hpp"
|
||||||
|
#include "merge/Merge.hpp"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Field Button
|
||||||
|
///
|
||||||
|
class FieldButton : public QPushButton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
FieldButton( QWidget* parent = nullptr );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Signals
|
||||||
|
/////////////////////////////////
|
||||||
|
signals:
|
||||||
|
void keySelected( QString key );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Public Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
void setKeys( const merge::Merge* merge,
|
||||||
|
const model::Variables& variables );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
void onMenuActionTriggered( QAction* action );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
QMenu mMenu;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // FieldButton_hpp
|
||||||
+30
-29
@@ -1,38 +1,39 @@
|
|||||||
/* File.cpp
|
// File.cpp
|
||||||
*
|
//
|
||||||
* Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
// Copyright (C) 2014 Jaye Evins <evins@snaught.com>
|
||||||
*
|
//
|
||||||
* This file is part of gLabels-qt.
|
// This file is part of gLabels-qt.
|
||||||
*
|
//
|
||||||
* gLabels-qt is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
// (at your option) any later version.
|
||||||
*
|
//
|
||||||
* gLabels-qt is distributed in the hope that it will be useful,
|
// gLabels-qt is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
*
|
//
|
||||||
* You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
// along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
//
|
||||||
|
|
||||||
#include "File.h"
|
|
||||||
|
|
||||||
#include "MainWindow.h"
|
#include "File.hpp"
|
||||||
#include "SelectProductDialog.h"
|
|
||||||
#include "TemplateDesigner.h"
|
|
||||||
|
|
||||||
#include "model/FileUtil.h"
|
#include "MainWindow.hpp"
|
||||||
#include "model/Model.h"
|
#include "SelectProductDialog.hpp"
|
||||||
#include "model/Settings.h"
|
#include "TemplateDesigner.hpp"
|
||||||
#include "model/XmlLabelParser.h"
|
|
||||||
#include "model/XmlLabelCreator.h"
|
|
||||||
|
|
||||||
|
#include "model/FileUtil.hpp"
|
||||||
|
#include "model/Model.hpp"
|
||||||
|
#include "model/Settings.hpp"
|
||||||
|
#include "model/XmlLabelParser.hpp"
|
||||||
|
#include "model/XmlLabelCreator.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QtDebug>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
/* File.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2017 Jaye Evins <evins@snaught.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef File_h
|
|
||||||
#define File_h
|
|
||||||
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward References
|
|
||||||
class MainWindow;
|
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// File Actions
|
|
||||||
///
|
|
||||||
/// Note: class provides a translation context for these static functions.
|
|
||||||
///
|
|
||||||
class File : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
static bool newLabel( MainWindow *window = nullptr );
|
|
||||||
static void open( MainWindow *window );
|
|
||||||
static void open( const QString& fileName, MainWindow *window );
|
|
||||||
static bool save( MainWindow *window );
|
|
||||||
static bool saveAs( MainWindow *window );
|
|
||||||
static void templateDesigner( MainWindow *window );
|
|
||||||
static void close( MainWindow *window );
|
|
||||||
static void exit();
|
|
||||||
|
|
||||||
private:
|
|
||||||
static QString mCwd;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // File_h
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user