Class Document
#include <Document.h >
Class that abstracts a formatted document.
A document created with this class can be converted to other formats (e.g. HTML, wiki).
A document is a abstract document that is not format specific until it is rendered.
Today, a document can be output to HTML or PDF. Other formats are expected for the future.
A document is made up of a series of blocks.
An example block is: header, paragraph, table cell, image
A block is made up of a series of items.
An example item is: text fragment of a particular style.
White space is not automatically added between items.
A region is a block.
Text written to a region is appended.
A bookmark is an anchor where a link from elsewhere in the document points to.
A link points to a bookmark inside the document. An external link points to somewhere outside the document.
An index key is the text that appears in a generated index, perhaps different from the text it references.
When headers are used, Document can generate a table of contents for the document.
When named indexes are used, Document can generate an index for each named index.
int group_id |
Default value: 0 |
string docName |
Default value: "" |
string module |
Default value: "" |
using this class to communicate with docmaker
float newWidth |
|
float newHeight |
Specify how many units wide and tall the document is; specify how many pixels are in a unit
const string& text |
|
int depth |
Default value: 1 |
const string& bookmarkLabel |
Default value: "" |
Header 0 is reserved for the cover page title (not part of the table of contents)
const string& text |
|
const string& style |
Default value: "" |
const string& linkToBookmark |
Default value: "" |
Generate text using the optional style provided and optionally link it to a bookmark provided
const string& text |
|
const string& style |
Default value: "" |
const string& indexReadableReference |
Default value: "here" |
const string& indexName |
Default value: "" |
Generate text and add an index entry to here using printed text, with reference text provided inside the named index
const string& text |
|
const string& indexReadableReference |
Default value: "here" |
const string& indexName |
Default value: "" |
Generate NO text, but add an index entry to here using printed text, with reference text provided inside the named index
const string& text |
|
const string& style |
Default value: "" |
const string& bookmarkLabel |
Default value: "" |
const string& text |
|
const string& linkToBookmark |
Default value: "" |
const string& text |
|
const string& linkToBookmark |
Default value: "" |
const string& text |
|
const string& linkToBookmark |
Default value: "" |
const string& text |
|
const string& linkToBookmark |
Default value: "" |
const Image& image |
|
const string& alignment |
Default value: "center" |
align: left, center, right
const string& imagefile |
|
const string& alignment |
Default value: "center" |
const string& title |
Default value: "" |
int maxdepth |
Default value: 0 |
const string& title |
Default value: "" |
const string& indexName |
Default value: "" |
string comment |
does not appear visible in output document
float width |
Default value: 8.5 |
float height |
Default value: 11.0 |
Start/End blocks
string style |
Default value: "" |
const string& listType |
Default value: "." |
const string& style |
Default value: "" |
a list is a container of paragraphs
const string& style |
Default value: "" |
int rows |
|
int columns |
|
const string& name |
Default value: "" |
const string& alignment |
Default value: "center" |
a table name is an identifier which may include dashes
const string& sectionType |
Default value: "" |
const Document& newdoc |
const Document& newdoc |
Document navigation
int regionId |
int regionId |
bool createIfNone |
Default value: true |
beginning of document
end of document
beginning of page
end of page
const string& tableName |
const string& caption |
int row |
|
int column |
|
const string& style |
Default value: "" |
if not inside table or invalid row/column, document returns itself at current region
end of table (immediately following the table)
end of cell
const string& style |
Control output styles
const string& style |
const string& style |
const string& style |
const string& style |
const string& blockType |
|
const string& style |
Valid block types: paragraph, table, tablecell, list, listline
const string& blockType |
string format |
Default value: "html" |
bool fulldoc |
Default value: true |
alt format: pdf, xml
FILE* f |
|
string format |
Default value: "html" |
bool fulldoc |
Default value: true |
alt format: pdf, xml
GET
string id |
SET
int group_id |
|
string docName |
|
string module |
DbRecNum id |
string newModule |
string newName |
managing change
querying the document
const string& indexName |
Default value: "" |
Count how many entries are in the named index
int newBlock |
convert structure data to XML
int regionId |
int group_id |
using this class to write to the docmaker daemon |
string name |
|
string module |
|
bool changed |
Flag: true if data was changed and needs to be saved |
DocumentIndexRefList indexRefs |
|
HashArray defaultStyle |
for block types: paragraph |
vector <DocumentBlock > block |
common variables |
vector <Image > images |
|
int nextRegionId |
|
int currentBlock |
current block for manipulation |
static htmlTagFN htmlStartTag |
|
static htmlTagFN htmlEndTag |
const string& tableName |
int row |
|
int column |
int startPos |
Default value: 0 |
bool insideTable |
Default value: false |
int startPos |
Default value: 0 |
int depth |
|
int startBlock |
Default value: 0 |
const string& type |
Default value: "" |
append after currentBlock
DocumentBlock block |
Point& p |
|
Point translate |
|
float scale |
|
float rotate |
PointList& p |
|
Point translate |
|
float scale |
|
float rotate |
const string& link |
string link |
string link |
const string& bookmark |
|
int& regionId |
|
int& itemId |
int regionId |
|
DbRecNum itemId |
const string& bookmark |
const DocumentBlock& b |
const DocumentBlock& b |
bool fulldoc |
Default value: true |
int startBlock |
|
int keyBlock |
|
int noBlocks |
Default value: 19 |
for debugging