WOSA/XFS PTR Form解析库—FormRule.h

时间:2024-11-06 12:35:50

#ifndef _FORMRULE_H_
#define _FORMRULE_H_

#include <XFSPTR.H>
#include <string>
#include <vector>

enum NuXFS_FORMKEY {
FORMKEY_UNIT, FORMKEY_POINTSIZE, FORMKEY_ALIGNMENT, FORMKEY_ORIENTATION, FORMKEY_SKEW
, FORMKEY_VERSION, FORMKEY_LANGUAGE, FORMKEY_CPI, FORMKEY_LPI, FORMKEY_SIZE
, FORMKEY_COPYRIGHT, FORMKEY_TITLE, FORMKEY_COMMENT, FORMKEY_USERPROMPT
};

enum NuXFS_FIELDKEY {
FIELDKEY_POSITION, FIELDKEY_FOLLOWS, FIELDKEY_HEADER, FIELDKEY_FOOTER, FIELDKEY_SIDE
, FIELDKEY_SIZE, FIELDKEY_INDEX, FIELDKEY_TYPE, FIELDKEY_SCALING, FIELDKEY_BARCODE
, FIELDKEY_COERCIVITY, FIELDKEY_CLASS, FIELDKEY_ACCESS, FIELDKEY_OVERFLOW, FIELDKEY_STYLE
, FIELDKEY_CASE, FIELDKEY_HORIZONTAL, FIELDKEY_VERTICAL, FIELDKEY_COLOR, FIELDKEY_RGBCOLOR
, FIELDKEY_LANGUAGE, FIELDKEY_FONT, FIELDKEY_POINTSIZE, FIELDKEY_CPI, FIELDKEY_LPI
, FIELDKEY_FORMAT, FIELDKEY_INITIALVALUE
};

enum NuXFS_FRAMEKEY {
FRAMEKEY_POSITION, FRAMEKEY_FRAMES, FRAMEKEY_HEADER, FRAMEKEY_FOOTER, FRAMEKEY_SIDE
, FRAMEKEY_SIZE, FRAMEKEY_REPEATONX, FRAMEKEY_REPEATONY, FRAMEKEY_TYPE, FRAMEKEY_CLASS
, FRAMEKEY_OVERFLOW, FRAMEKEY_STYLE, FRAMEKEY_COLOR, FRAMEKEY_RGBCOLOR, FRAMEKEY_FILLCOLOR
, FRAMEKEY_RGBFILLCOLOR, FRAMEKEY_FILLSTYLE, FRAMEKEY_SUBSTSIGN, FRAMEKEY_TITLE, FRAMEKEY_HORIZONTAL
, FRAMEKEY_VERTICAL
};

enum NuXFS_SUBFORMKEY {
SUBFORMKEY_POSITION, SUBFORMKEY_SIZE
};

enum NuXFS_MEDIAKEY {
MEDIAKEY_TYPE, MEDIAKEY_SOURCE, MEDIAKEY_UNIT, MEDIAKEY_SIZE, MEDIAKEY_PRINTAREA
, MEDIAKEY_RESTRICTED, MEDIAKEY_FOLD, MEDIAKEY_STAGGERING, MEDIAKEY_PAGE, MEDIAKEY_LINES
};

// Type value
enum NuXFS_TYPEVALUE {
NuXFS_TYPE_FORMUNIT, NuXFS_TYPE_FORMALIGNMENT
, NuXFS_TYPE_FORMORIENTATION, NuXFS_TYPE_FIELDSIDE
, NuXFS_TYPE_FIELDTYPE, NuXFS_TYPE_FIELDSCALING
, NuXFS_TYPE_FIELDBARCODE, NuXFS_TYPE_FIELDCOERCIVITY
, NuXFS_TYPE_FIELDCLASS, NuXFS_TYPE_FIELDACCESS
, NuXFS_TYPE_FIELDOVERFLOW, NuXFS_TYPE_FIELDSTYLE
, NuXFS_TYPE_FIELDHORIZONTAL, NuXFS_TYPE_FIELDVERTICAL
, NuXFS_TYPE_FIELDCOLOR, NuXFS_TYPE_FRAMETYPE
, NuXFS_TYPE_FRAMECLASS, NuXFS_TYPE_FRAMEOVERFLOW
, NuXFS_TYPE_FRAMESTYLE, NuXFS_TYPE_FRAMECOLOR
, NuXFS_TYPE_FRAMEFILLCOLOR, NuXFS_TYPE_FRAMEHORIZONTAL
, NuXFS_TYPE_FRAMEVERTICA, NuXFS_TYPE_MEDIATYPE
, NuXFS_TYPE_MEDIASOURCE, NuXFS_TYPE_MEDIAFLOD
};

//**********************************************************
// About XFSFORM
std::vector<std::string> FORMUNITSTR = {
"INCH", "MM", "ROWCOLUMN"
};
enum NuXFS_FORMBASE {
FORMBASE_INCH = WFS_FRM_INCH, FORMBASE_MM = WFS_FRM_MM, FORMBASE_ROWCOLUMN = WFS_FRM_ROWCOLUMN
};

std::vector<std::string> FORMALIGNMENTSTR = {
"TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT"
};
enum NuXFS_FORMALIGNMENT {
FORMALIGNMENT_TOPLEFT = WFS_FRM_TOPLEFT, FORMALIGNMENT_TOPRIGHT = WFS_FRM_TOPRIGHT
, FORMALIGNMENT_BOTTOMLEFT = WFS_FRM_BOTTOMLEFT
, FORMALIGNMENT_BOTTOMRIGHT = WFS_FRM_BOTTOMRIGHT
};

std::vector<std::string> FORMORIENTATIONSTR = {
"PORTRAIT", "LANDSCAPE"
};
enum NuXFS_FORMORIENTATION {
FORMORIENTATION_PORTRAIT = WFS_FRM_PORTRAIT, FORMORIENTATION_LANDSCAPE = WFS_FRM_PORTRAIT
};

// About XFSFIELD
std::vector<std::string> FIELDSIDESTR = {
"FRONT", "BACK"
};
enum NuXFS_FIELDSIDE {
FIELDSIDE_FRONT, FIELDSIDE_BACK
};

std::vector<std::string> FIELDTYPESTR = {
"TEXT", "MICR", "OCR", "MSF", "BARCODE", "GRAPHIC", "PAGEMARK", "LOGO"/*Extend*/
};
enum NuXFS_FIELDTYPE {
FIELDTYPE_TEXT = WFS_FRM_FIELDTEXT, FIELDTYPE_MICR = WFS_FRM_FIELDMICR
, FIELDTYPE_OCR = WFS_FRM_FIELDOCR, FIELDTYPE_MSF = WFS_FRM_FIELDMSF
, FIELDTYPE_BARCODE = WFS_FRM_FIELDBARCODE, FIELDTYPE_GRAPHIC = WFS_FRM_FIELDGRAPHIC
, FIELDTYPE_PAGEMARK = WFS_FRM_FIELDPAGEMARK, FIELDTYPE_LOGO
};

std::vector<std::string> FIELDSCALINGSTR = {
"BESTFIT", "ASIS", "MAINTAINASPECT"
};
enum NuXFS_FIELDSCALING {
FIELDSCALING_BESTFIT, FIELDSCALING_ASIS, FIELDSCALING_MAINTAINASPECT
};

std::vector<std::string> FIELDBARCODESTR = {
"NONE", "ABOVE", "BELOW", "BOTH"
};
enum NuXFS_FIELDBARCODE {
FIELDBARCODE_NONE, FIELDBARCODE_ABOVE, FIELDBARCODE_BELOW, FIELDBARCODE_BOTH
};

std::vector<std::string> FIELDCOERCIVITYSTR = {
"AUTO", "LOW", "HIGH"
};
enum NuXFS_FIELDCOERCIVITY {
FIELDCOERCIVITY_AUTO, FIELDCOERCIVITY_LOW, FIELDCOERCIVITY_HIGH
};

std::vector<std::string> FIELDCLASSSTR = {
"STATIC", "OPTIONAL", "REQUIRED"
};
enum NuXFS_FIELDCLASS {
FIELDCLASS_STATIC = WFS_FRM_CLASSSTATIC, FIELDCLASS_OPTIONAL = WFS_FRM_CLASSOPTIONAL
, FIELDCLASS_REQUIRED = WFS_FRM_CLASSREQUIRED
};

std::vector<std::string> FIELDACCESSSTR = {
"READ", "WRITE", "READWRITE"
};
enum NuXFS_FIELDACCESS {
FIELDACCESS_READ = WFS_FRM_ACCESSREAD, FIELDACCESS_WRITE = WFS_FRM_ACCESSWRITE
, FIELDACCESS_READWRITE
};

std::vector<std::string> FIELDOVERFLOWSTR = {
"TERMINATE", "TRUNCATE", "BESTFIT", "OVERWRITE", "WORDWRAP"
};
enum NuXFS_FIELDOVERFLOW {
FIELDOVERFLOW_TERMINATE = WFS_FRM_OVFTERMINATE, FIELDOVERFLOW_TRUNCATE = WFS_FRM_OVFTRUNCATE
, FIELDOVERFLOW_BESTFIT = WFS_FRM_OVFBESTFIT, FIELDOVERFLOW_OVERWRITE = WFS_FRM_OVFOVERWRITE
, FIELDOVERFLOW_WORDWRAP = WFS_FRM_OVFWORDWRAP
};

std::vector<std::string> FIELDSTYLESTR = {
"NORMAL", "BOLD", "ITALIC", "UNDER", "DOUBLEUNDER"
, "DOUBLE", "TRIPLE", "QUADRUPLE", "STRIKETHROUGH", "ROTATE90",
"ROTATE270", "UPSIDEDOWN", "PROPORTIONAL", "DOUBLEHIGH", "TRIPLEHIGH"
, "QUADRUPLEHIGH", "CONDENSED", "SUPERSCRIPT", "SUBSCRIPT", "OVERSCORE",
"LETTERQUALITY", "NEARLETTERQUALITY", "DOUBLESTRIKE", "OPAQUE"
};
enum NuXFS_FIELDSTYLE {
FIELDSTYLE_NORMAL = 0x0000, FIELDSTYLE_BOLD = 0x0001
, FIELDSTYLE_ITALIC = 0x0002, FIELDSTYLE_UNDER = 0x0004
, FIELDSTYLE_DOUBLEUNDER = 0x0008, FIELDSTYLE_DOUBLE = 0x0010
, FIELDSTYLE_TRIPLE = 0x0020, FIELDSTYLE_QUADRUPLE = 0x0040
, FIELDSTYLE_STRIKETHROUGH = 0x0080, FIELDSTYLE_ROTATE90 = 0x0100
, FIELDSTYLE_ROTATE270 = 0x0200, FIELDSTYLE_UPSIDEDOWN = 0x0400
, FIELDSTYLE_PROPORTIONAL = 0x0800, FIELDSTYLE_DOUBLEHIGH = 0x1000
, FIELDSTYLE_TRIPLEHIGH = 0x2000, FIELDSTYLE_QUADRUPLEHIGH = 0x4000
, FIELDSTYLE_CONDENSED = 0x8000, FIELDSTYLE_SUPERSCRIPT = 0x00010000
, FIELDSTYLE_SUBSCRIPT = 0x00020000, FIELDSTYLE_OVERSCORE = 0x00040000
, FIELDSTYLE_LETTERQUALITY = 0x00080000, FIELDSTYLE_NEARLETTERQUALITY = 0x00100000
, FIELDSTYLE_DOUBLESTRIKE = 0x00200000, FIELDSTYLE_OPAQUE = 0x0040000
};
std::vector<std::string> FIELDCASESTR = {
"NOCHANGE", "UPPER", "LOWER"
};
enum NuXFS_FIELDCASE {
FIELDCASE_NOCHANGE, FIELDCASE_UPPER, FIELDCASE_LOWER
};

std::vector<std::string> FIELDHORIZONTALSTR = {
"LEFT", "RIGHT", "CENTER", "JUSTIFY"
};
enum NuXFS_FIELDHORIZONTAL {
FIELDHORIZONTAL_LEFT, FIELDHORIZONTAL_RIGHT
, FIELDHORIZONTAL_CENTER, FIELDHORIZONTAL_JUSTIFY
};

std::vector<std::string> FIELDVERTICALSTR = {
"BOTTOM", "CENTER", "TOP"
};
enum NuXFS_FIELDVERTICAL {
FIELDVERTICAL_BOTTOM, FIELDVERTICAL_CENTER, FIELDVERTICAL_TOP
};

std::vector<std::string> FIELDCOLORSTR = {
"BLACK", "WHITE", "GRAY", "RED", "BLUE", "GREEN", "YELLOW"
};
enum NuXFS_FIELDCOLOR {
FIELDCOLOR_BLACK, FIELDCOLOR_WHITE
, FIELDCOLOR_GRAY, FIELDCOLOR_RED
, FIELDCOLOR_BLUE, FIELDCOLOR_GREEN
, FIELDCOLOR_YELLOW
};

// About FRAME
std::vector<std::string> FRAMESIDESTR = {
"FRONT", "BACK"
};
enum NuXFS_FRAMESIDE {
FRAMESIDE_FRONT, FRAMESIDE_BACK
};

std::vector<std::string> FRAMETYPESTR = {
"RECTANGLE", "ROUNDED_CORNER", "ELLISPSE"
};
enum NuXFS_FRAMETYPE {
FRAMETYPE_RECTANGLE, FRAMETYPE_ROUNDED_CORNER, FRAMETYPE_ELLISPSE
};

std::vector<std::string> FRAMECLASSSTR = {
"OPTIONAL", "REQUIRED"
};
enum NuXFS_FRAMECLASS {
FRAMECLASS_OPTIONAL, FRAMECLASS_REQUIRED
};

std::vector<std::string> FRAMEOVERFLOWSTR = {
"TERMINATE", "TRUNCATE", "BESTFIT", "OVERWRITE", "WORDWRAP"
};
enum NuXFS_FRAMEOVERFLOW {
FRAMEOVERFLOW_TERMINATE = WFS_FRM_OVFTERMINATE, FRAMEOVERFLOW_TRUNCATE = WFS_FRM_OVFTRUNCATE
, FRAMEOVERFLOW_BESTFIT = WFS_FRM_OVFBESTFIT, FRAMEOVERFLOW_OVERWRITE = WFS_FRM_OVFOVERWRITE
, FRAMEOVERFLOW_WORDWRAP = WFS_FRM_OVFWORDWRAP
};

std::vector<std::string> FRAMESTYLESTR = {
"SINGLE_THIN", "DOUBLE_THIN", "SINGLE_THICK", "DOUBLE_THICK", "DOTTED"
};
enum NuXFS_FRAMESTYLE {
FRAMESTYLE_SINGLE_THIN = 0x0000, FRAMESTYLE_DOUBLE_THIN = 0x0001
, FRAMESTYLE_SINGLE_THICK = 0x0002, FRAMESTYLE_DOUBLE_THICK = 0x0004
, FRAMESTYLE_DOTTED = 0x0008
};

std::vector<std::string> FRAMECOLORSTR = {
"BLACK", "WHITE", "GRAY", "RED", "BLUE", "GREEN", "YELLOW"
};
enum NuXFS_FRAMECOLOR {
FRAMECOLOR_BLACK, FRAMECOLOR_WHITE, FRAMECOLOR_GRAY, FRAMECOLOR_RED, FRAMECOLOR_BLUE
, FRAMECOLOR_GREEN, FRAMECOLOR_YELLOW
};

std::vector<std::string> FRAMEFILLCOLORSTR = {
"BLACK", "WHITE", "GRAY", "RED", "BLUE", "GREEN", "YELLOW"
};
enum NuXFS_FRAMEFILLCOLOR {
FRAMEFILLCOLOR_BLACK, FRAMEFILLCOLOR_WHITE
, FRAMEFILLCOLOR_GRAY, FRAMEFILLCOLOR_RED, FRAMEFILLCOLOR_BLUE
, FRAMEFILLCOLOR_GREEN, FRAMEFILLCOLOR_YELLOW
};

std::vector<std::string> FRAMEFILLSTYLESTR = {
"NONE", "SOLID", "BDIAGONAL", "CROSS", "DIAGCROSS", "FDIAGONAL", "HORIZONTAL", "VERTICAL"
};
enum NuXFS_FRAMEFILLSTYLE {
FRAMEFILLSTYLE_NONE, FRAMEFILLSTYLE_SOLID
, FRAMEFILLSTYLE_BDIAGONAL, FRAMEFILLSTYLE_CROSS, FRAMEFILLSTYLE_DIAGCROSS
, FRAMEFILLSTYLE_FDIAGONAL, FRAMEFILLSTYLE_HORIZONTAL
, FRAMEFILLSTYLE_VERTICAL
};

std::vector<std::string> FRAMEHORIZONTALSTR = {
"LEFT", "RIGHT", "CENTER"
};
enum NuXFS_FRAMEHORIZONTAL {
FRAMEHORIZONTAL_LEFT, FRAMEHORIZONTAL_RIGHT, FRAMEHORIZONTAL_CENTER
};

std::vector<std::string> FRAMEVERTICALSTR = {
"TOP", "BOTTOM"
};
enum NuXFS_FRAMEVERTICAL {
FRAMEVERTICAL_TOP, FRAMEVERTICAL_BOTTOM
};

// About XFSMEDIA
std::vector<std::string> MEDIATYPESTR = {
"GENERIC", "PASSBOOK", "MULTIPART"
};
enum NuXFS_MEDIATYPE {
MEDIATYPE_GENERIC = WFS_FRM_MEDIAGENERIC, MEDIATYPE_PASSBOOK = WFS_FRM_MEDIAPASSBOOK
, MEDIATYPE_MULTIPART = WFS_FRM_MEDIAMULTIPART
};

std::vector<std::string> MEDIASOURCESTR = {
"ANY", "UPPER", "LOWER", "EXTERNAL", "AUX", "AUX2", "PARK"
};
enum NuXFS_MEDIASOURCE {
MEDIASOURCE_ANY = WFS_PTR_PAPERANY, MEDIASOURCE_UPPER = WFS_PTR_PAPERUPPER
, MEDIASOURCE_LOWER = WFS_PTR_PAPERLOWER, MEDIASOURCE_EXTERNAL = WFS_PTR_PAPEREXTERNAL
, MEDIASOURCE_AUX = WFS_PTR_PAPERAUX, MEDIASOURCE_AUX2 = WFS_PTR_PAPERAUX2
, MEDIASOURCE_PARK = WFS_PTR_PAPERPARK
};

std::vector<std::string> MEDIAFOLDSTR = {
"NONE", "HORIZONTAL", "VERTICAL"
};
enum NuXFS_MEDIAFLOD {
MEDIAFLOD_NONE = WFS_FRM_FOLDNONE, MEDIAFLOD_HORIZONTAL = WFS_FRM_FOLDHORIZONTAL
, MEDIAFLOD_VERTICAL = WFS_FRM_FOLDVERTICAL
};

#endif