Read@CVL
|
#include <Elements.h>
Public Member Functions | |
PageElement (const QString &xmlPath=QString()) | |
Initializes a new instance of the PageElement class. This class corresponds to a PAGE XML file. It hold's the XML file's path. After parsing the PAGE XML, the rootRegion() should contain all relevant regions. More... | |
bool | isEmpty () |
void | setXmlPath (const QString &xmlPath) |
Set the XML path. More... | |
QString | xmlPath () const |
The PAGE XML path. More... | |
void | setImageFileName (const QString &name) |
Set the filename of the corresponding image. More... | |
QString | imageFileName () const |
Returns the filename of the corresponding image. More... | |
void | setImageSize (const QSize &size) |
Set the size of the image. More... | |
QSize | imageSize () const |
The image size. More... | |
void | setRootRegion (QSharedPointer< RootRegion > region) |
Set the root region. This is needed for writing to a PAGE XML file. More... | |
QSharedPointer< RootRegion > | rootRegion () const |
Returns the root region. This is needed if the XML is read. More... | |
void | setCreator (const QString &creator) |
Set the creator of the PAGE XML. More... | |
QString | creator () const |
The PAGE XML creator. More... | |
void | setDateCreated (const QDateTime &date) |
Set the date created of the PAGE XML. More... | |
QDateTime | dateCreated () const |
Returns the date created of the PAGE XML. More... | |
void | setDateModified (const QDateTime &date) |
Set the date modified of the PAGE XML. More... | |
QDateTime | dateModified () const |
The modified date of the PAGE XML. More... | |
void | setLayers (const QVector< QSharedPointer< LayerElement >> &layers) |
QVector< QSharedPointer< LayerElement > > | layers () const |
void | setDefaultLayer (const QSharedPointer< LayerElement > &defaultLayer) |
QSharedPointer< LayerElement > | defaultLayer () const |
void | redefineLayersByType (const QVector< Region::Type > &layerTypeAssignment) |
Redefine the layers of the page by assigning all regions of the same type to the same layer. Region types not specified in layerTypeAssignment are assigned to the default layer. The zIndex is set according to the order of layerTypeAssignment. More... | |
void | sortLayers (bool checkIfSorted=false) |
Sorts the layers by their zIndex in ascending order. More... | |
virtual QString | toString () const |
Creates a string with all relevant attributes of the current instance. More... | |
Static Protected Member Functions | |
static bool | layerZIndexGt (const QSharedPointer< LayerElement > &l1, const QSharedPointer< LayerElement > &l2) |
Protected Attributes | |
QString | mXmlPath |
QString | mImageFileName |
QSize | mImageSize |
QString | mCreator |
QDateTime | mDateCreated |
QDateTime | mDateModified |
QSharedPointer< RootRegion > | mRoot |
QVector< QSharedPointer< LayerElement > > | mLayers |
QSharedPointer< LayerElement > | mDefaultLayer |
Friends | |
DllCoreExport QDebug | operator<< (QDebug d, const PageElement &p) |
Prints the page element to the debug stream. More... | |
DllCoreExport QDataStream & | operator<< (QDataStream &s, const PageElement &p) |
Appends the page element to the data stream s. More... | |
rdf::PageElement::PageElement | ( | const QString & | xmlPath = QString() | ) |
Initializes a new instance of the PageElement class. This class corresponds to a PAGE XML file. It hold's the XML file's path. After parsing the PAGE XML, the rootRegion() should contain all relevant regions.
xmlPath | The XML path. |
QString rdf::PageElement::creator | ( | ) | const |
The PAGE XML creator.
QDateTime rdf::PageElement::dateCreated | ( | ) | const |
Returns the date created of the PAGE XML.
QDateTime rdf::PageElement::dateModified | ( | ) | const |
The modified date of the PAGE XML.
QSharedPointer< LayerElement > rdf::PageElement::defaultLayer | ( | ) | const |
QString rdf::PageElement::imageFileName | ( | ) | const |
Returns the filename of the corresponding image.
QSize rdf::PageElement::imageSize | ( | ) | const |
The image size.
bool rdf::PageElement::isEmpty | ( | ) |
QVector< QSharedPointer< LayerElement > > rdf::PageElement::layers | ( | ) | const |
|
staticprotected |
void rdf::PageElement::redefineLayersByType | ( | const QVector< Region::Type > & | layerTypeAssignment | ) |
Redefine the layers of the page by assigning all regions of the same type to the same layer. Region types not specified in layerTypeAssignment are assigned to the default layer. The zIndex is set according to the order of layerTypeAssignment.
layerTypeAssignment | The type-to-layer assignments. |
QSharedPointer< RootRegion > rdf::PageElement::rootRegion | ( | ) | const |
Returns the root region. This is needed if the XML is read.
void rdf::PageElement::setCreator | ( | const QString & | creator | ) |
Set the creator of the PAGE XML.
creator | The PAGE creator (CVL if we write). |
void rdf::PageElement::setDateCreated | ( | const QDateTime & | date | ) |
Set the date created of the PAGE XML.
date | The date created. |
void rdf::PageElement::setDateModified | ( | const QDateTime & | date | ) |
Set the date modified of the PAGE XML.
date | The last modified date of the PAGE XML. |
void rdf::PageElement::setDefaultLayer | ( | const QSharedPointer< LayerElement > & | defaultLayer | ) |
void rdf::PageElement::setImageFileName | ( | const QString & | name | ) |
Set the filename of the corresponding image.
name | The image's filename. |
void rdf::PageElement::setImageSize | ( | const QSize & | size | ) |
Set the size of the image.
size | The image size. |
void rdf::PageElement::setLayers | ( | const QVector< QSharedPointer< LayerElement >> & | layers | ) |
void rdf::PageElement::setRootRegion | ( | QSharedPointer< RootRegion > | region | ) |
Set the root region. This is needed for writing to a PAGE XML file.
region | The root region. |
void rdf::PageElement::setXmlPath | ( | const QString & | xmlPath | ) |
Set the XML path.
xmlPath | The XML path. |
void rdf::PageElement::sortLayers | ( | bool | checkIfSorted = false | ) |
Sorts the layers by their zIndex in ascending order.
checkIfSorted | if set to true [only sort if not already sorted]. |
|
virtual |
Creates a string with all relevant attributes of the current instance.
QString rdf::PageElement::xmlPath | ( | ) | const |
The PAGE XML path.
|
friend |
Prints the page element to the debug stream.
d | The debug stream. |
p | The page element. |
|
friend |
Appends the page element to the data stream s.
s | The data stream. |
p | The page element. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |