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

#ifndef _XFSPTRDATA_H_
#define _XFSPTRDATA_H_

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

// UNIT
typedef struct _XFS_UNIT {
WORD m_strBase;
WORD m_wX;
WORD m_wY;
}XFS_UNIT;

// SIZE
typedef struct _XFS_SIZE {
WORD m_wWidth;
WORD m_wHeight;
}XFS_SIZE;

// ALIGNMENT
typedef struct _XFS_ALIGNMENT {
WORD m_strAlignment;
WORD m_wXoffset;
WORD m_wYoffset;
}XFS_ALIGNMENT;

// VERSION
typedef struct _XFS_VERSION {
WORD m_wMajor;
WORD m_wMinor;
std::string m_strDate;
std::string m_strAuthor;
}XFS_VERSION;

// POSITION
typedef struct _XFS_POSITION {
WORD m_wX;
WORD m_wY;
}XFS_POSITION;

// INDEX
typedef struct _XFS_INDEX {
WORD m_wRepeatcount;
WORD m_wXoffset;
WORD m_wYoffset;
}XFS_INDEX;

// RGBCOLOR
typedef struct _XFS_RGBCOLOR {
WORD m_bRed;
WORD m_bGreen;
WORD m_bBlue;
}XFS_RGBCOLOR;

// REPEATONX
typedef struct _XFS_REPEATONX {
WORD m_wRepeatCount;
WORD m_wXoffset;
}XFS_REPEATONX;

// REPEATONY
typedef struct _XFS_REPEATONY {
WORD m_wRepeatCount;
WORD m_wYoffset;
}XFS_REPEATONY;

// PRINTAREA
typedef struct _XFS_PRINTAREA {
WORD m_wX;
WORD m_wY;
WORD m_wWidth;
WORD m_wHeight;
}XFS_PRINTAREA;

// RESTRICTED
typedef struct _XFS_RESTRICTED {
WORD m_wX;
WORD m_wY;
WORD m_wWidth;
WORD m_wHeight;
}XFS_RESTRICTED;


// XFSFIELD
typedef struct _wfs_ptr_form_field {
XFS_POSITION position;

std::string m_strFollows;
std::string m_strHeader;
std::string m_strFooter;

WORD m_strSide;

XFS_SIZE size;
XFS_INDEX index;

WORD m_strType;
WORD m_strScaling;
WORD m_strBarcode;
WORD m_strCoercivity;
WORD m_strClass;
WORD m_strAccess;
WORD m_strOverflow;

DWORD m_strStyle;
WORD m_strCase;
WORD m_strHorizontal;
WORD m_strVertical;
WORD m_strColor;

XFS_RGBCOLOR rgbColor;
WORD m_dwLanguage;
std::string m_strFont;

WORD m_dwPointSize;
WORD m_dwCpi;
WORD m_dwLpi;
std::string m_strFormat;
std::string m_strInitialValue;

// extra
std::string m_strFieldName;

void Init() {
position.m_wX = 0;
position.m_wY = 0;
m_strFollows = "";
m_strHeader = "";
m_strFooter = "";

m_strSide = 0; // FIELDSIDE_FRONT;
size.m_wWidth = 0;;
size.m_wHeight = 0;

index.m_wRepeatcount = 0;
index.m_wXoffset = 0;
index.m_wYoffset = 0;

m_strType = 0; // FIELDTYPE_TEXT;
m_strScaling = 0; // FIELDSCALING_BESTFIT;
m_strBarcode = 0; // FIELDBARCODE_NONE;
m_strCoercivity = 0; // FIELDCOERCIVITY_AUTO;
m_strClass = 1; // FIELDCLASS_OPTIONAL;
m_strAccess = 2; // FIELDACCESS_WRITE;
m_strOverflow = 0; // FIELDOVERFLOW_TERMINATE;

m_strStyle = 0; // FIELDSTYLE_NORMAL;
m_strCase = 0; // FIELDCASE_NOCHANGE;
m_strHorizontal = 0; // FIELDHORIZONTAL_LEFT;
m_strVertical = 0; // FIELDVERTICAL_BOTTOM;
m_strColor = 0; // FIELDCOLOR_BLACK;

rgbColor.m_bRed = 0;
rgbColor.m_bGreen = 0;
rgbColor.m_bBlue = 0;

m_dwLanguage = 0x0409;
m_strFont = "";
m_dwPointSize = 0;
m_dwCpi = 0;
m_dwLpi = 0;

m_strFormat = "";
m_strInitialValue = "";

m_strFieldName = "";
}
}WFSPTRFORMFIELD, *LPWFSPTRFORMFIELD;

// XFSFRAME
typedef struct _wfs_ptr_form_frame {
XFS_POSITION position;
std::string m_strFrames;
std::string m_strHeader;
std::string m_strFooter;
WORD m_strSide;

XFS_SIZE size;
XFS_REPEATONX repeatonx;
XFS_REPEATONY repeatony;

WORD m_strType;
WORD m_strClass;
WORD m_strOverflow;
DWORD m_strStyle;
WORD m_strColor;
XFS_RGBCOLOR rgbColor;
WORD m_strFillColor;
XFS_RGBCOLOR rgbFillColor;
WORD m_strFillStyle;
std::string m_strSubStsign;
std::string m_strTitle;
WORD m_strHorizontal;
WORD m_strVertical;

// extra
std::string m_strFrameName;

void Init() {
position.m_wX = 0;
position.m_wY = 0;

m_strFrames = "";
m_strHeader = "";
m_strFooter = "";

m_strSide = 0;

size.m_wWidth = 0;
size.m_wHeight = 0;

repeatonx.m_wRepeatCount = 0;
repeatonx.m_wXoffset = 0;

repeatony.m_wRepeatCount = 0;
repeatony.m_wYoffset = 0;

m_strType = 0;

m_strClass = 0; // FRAMECLASS_OPTIONAL
m_strOverflow = 0; // FRAMEOVERFLOW_TERMINATE;
m_strStyle = 0x0000; // FRAMESTYLE_SINGLE_THIN
m_strColor = 0; // FRAMECOLOR_BLACK

rgbColor.m_bRed = 0;
rgbColor.m_bGreen = 0;
rgbColor.m_bBlue = 0;

m_strFillColor = 1; // FRAMEFILLCOLOR_WHITE

rgbFillColor.m_bRed = 255;
rgbFillColor.m_bGreen = 255;
rgbFillColor.m_bBlue = 255;

m_strFillStyle = 0; // FRAMEFILLSTYLE_NONE
m_strSubStsign = "";
m_strTitle = "";
m_strHorizontal = 0; // FRAMEHORIZONTAL_LEFT
m_strVertical = 0; // FRAMEVERTICAL_TOP

m_strFrameName = "";
}
}WFSPTRFORMFRAME, *LPWFSPTRFORMFRAME;

// XFSFSUBFORM
typedef struct _wfs_ptr_form_subform {
XFS_POSITION position;
XFS_SIZE size;

std::vector<WFSPTRFORMFIELD> listFields;
std::vector<WFSPTRFORMFRAME> listFrames;

// extra
std::string m_strSubFormName;
WORD m_dwNumFields; // the number of fields
WORD m_dwNumFrames; // the number of frames
WORD m_dwSize; // size of this struct

void Init() {
m_strSubFormName = "";
}
} WFSPTRFORMSUBFORM, *LPWFSPTRFORMSUBFORM;

// XFSFFORM
typedef struct _wfs_ptr_form {
XFS_UNIT unit;
XFS_SIZE size;
XFS_ALIGNMENT alignment;

WORD m_strOrientation;
WORD m_dwSkew;
XFS_VERSION version;
WORD m_dwLanguage;
WORD m_dwCpi;
WORD m_dwLpi;
WORD m_dwPointSize;
std::string m_strCopyRight;
std::string m_strTitle;
std::string m_strComment;
std::string m_strUserPrompt;


std::vector<WFSPTRFORMFIELD> listFields;
std::vector<WFSPTRFORMFRAME> listFrames;
std::vector<WFSPTRFORMSUBFORM> listSubforms;

// extra;
std::string strFileName;
std::string m_strFormName;
std::string m_strFields;
WORD m_dwNumFields; // the number of fields
WORD m_dwNumFrames; // the number of frames
WORD m_dwNumSubForms; // the number of subformnames;
WORD m_dwSize; // size of this struct

int nLastFieldIndex;
int nLastFrameIndex;
std::vector<std::string> listTempFormKeys;
std::vector<std::string> listTempLastFieldKeys;
std::vector<std::string> listTempLastFrameKeys;

void Init() {
unit.m_strBase = WFS_FRM_ROWCOLUMN; // ROWCOLUMN
unit.m_wX = 0;
unit.m_wY = 0;

size.m_wWidth = 0;
size.m_wHeight = 0;

alignment.m_strAlignment = 0; // TOPLEFT
alignment.m_wXoffset = 0;
alignment.m_wYoffset = 0;

m_strOrientation = 0;
m_dwSkew = 0;

version.m_wMajor = 0;
version.m_wMinor = 0;
version.m_strDate = "";
version.m_strAuthor = "";

m_dwLanguage = 0x0409;
m_dwCpi = 0;
m_dwLpi = 0;
m_dwPointSize = 0;
m_strCopyRight = "";
m_strTitle = "";
m_strComment = "";
m_strUserPrompt = "";

strFileName = "";
m_strFormName = "";
m_dwNumFields = 0;
m_dwNumFrames = 0;
m_dwNumSubForms = 0;
m_dwSize = 0;

nLastFieldIndex = -1; // start from -1
nLastFrameIndex = -1; // start from -1
}
} WFSPTRFORM, *LPWFSPTRFORM;

// XFSFMEDIA
typedef struct _wfs_ptr_media {
WORD m_strType;
WORD m_strSource;
XFS_UNIT unit;
XFS_SIZE size;
XFS_PRINTAREA printArea;
XFS_RESTRICTED restricted;
WORD m_strFold;

WORD m_dwStaggering;
WORD m_dwPage;
WORD m_dwLines;

// extra
std::string strFileName;
std::string m_strMediaName;

std::vector<std::string> listTempMediaKeys;

void Init() {
m_strType = WFS_FRM_MEDIAGENERIC; // GENERIC
m_strSource = WFS_PTR_PAPERANY; // ANY

unit.m_wX = 0;
unit.m_wY = 0;

size.m_wWidth = 0;
size.m_wHeight = 0;

printArea.m_wX = 0;
printArea.m_wY = 0;
printArea.m_wWidth = 0;
printArea.m_wHeight = 0;

restricted.m_wX = 0;
restricted.m_wY = 0;
restricted.m_wWidth = 0;
restricted.m_wHeight = 0;

m_strFold = 1; // MEDIAFLOD_HORIZONTAL;
m_dwStaggering = 0;
m_dwPage = 0;
m_dwLines = 0;

strFileName = "";
m_strMediaName = "";
}
}WFSPTRMEDIA, *LPWFSPTRMEDIA;

// XFSFFIELDKEYINDEXVALUE
typedef struct _wfs_ptr_field_key_index_value {
std::string strKey;
int nIndex;
std::string strValue;
WFSPTRFORMFIELD ptrField;

void Init() {
strKey = "";
nIndex = 0;
strValue = "";
ptrField.Init();
}
}WFSPTRFIELDKEYINDEXVALUE, *LPWFSPTRFIELDKEYINDEXVALUE;
#endif

posted @ 2019-02-20 15:57  lizhigang  阅读(488)  评论(0编辑  收藏  举报