Engauge Digitizer 2
Loading...
Searching...
No Matches
ImportCroppingUtilBase.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2016 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include "EngaugeAssert.h"
9#include <QHash>
10#include <QObject>
11
12const ImportCropping DEFAULT_IMPORT_CROPPING = IMPORT_CROPPING_MULTIPAGE_PDFS; // Traditional, and simplest, option
13
17
19{
20 QHash<ImportCropping, QString> lookupTable;
21
22 lookupTable.insert (IMPORT_CROPPING_NEVER, QObject::tr ("No cropping"));
23 lookupTable.insert (IMPORT_CROPPING_MULTIPAGE_PDFS, QObject::tr ("Crop pdf files with multiple pages"));
24 lookupTable.insert (IMPORT_CROPPING_ALWAYS, QObject::tr ("Always crop"));
25
26 ENGAUGE_ASSERT (lookupTable.count() == NUMBER_IMPORT_CROPPING);
27
28 QString rtn;
29
30 if (lookupTable.contains (importCropping)) {
31 rtn = lookupTable [importCropping];
32 }
33
34 return rtn;
35}
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
const ImportCropping DEFAULT_IMPORT_CROPPING
ImportCropping
@ NUMBER_IMPORT_CROPPING
@ IMPORT_CROPPING_NEVER
@ IMPORT_CROPPING_MULTIPAGE_PDFS
@ IMPORT_CROPPING_ALWAYS
ImportCroppingUtilBase()
Single constructor.
static QString importCroppingToString(ImportCropping importCropping)
Option as string for display to user.