ReadFramework
rdf::PageElement Class Reference

#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< RootRegionrootRegion () 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< LayerElementdefaultLayer () 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< RootRegionmRoot
 
QVector< QSharedPointer< LayerElement > > mLayers
 
QSharedPointer< LayerElementmDefaultLayer
 

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...
 

Constructor & Destructor Documentation

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.

Parameters
xmlPathThe XML path.

Member Function Documentation

QString rdf::PageElement::creator ( ) const

The PAGE XML creator.

Returns
QDateTime rdf::PageElement::dateCreated ( ) const

Returns the date created of the PAGE XML.

Returns
QDateTime rdf::PageElement::dateModified ( ) const

The modified date of the PAGE XML.

Returns
QSharedPointer< LayerElement > rdf::PageElement::defaultLayer ( ) const
QString rdf::PageElement::imageFileName ( ) const

Returns the filename of the corresponding image.

Returns
QSize rdf::PageElement::imageSize ( ) const

The image size.

Returns
bool rdf::PageElement::isEmpty ( )
QVector< QSharedPointer< LayerElement > > rdf::PageElement::layers ( ) const
bool rdf::PageElement::layerZIndexGt ( const QSharedPointer< LayerElement > &  l1,
const QSharedPointer< LayerElement > &  l2 
)
staticprotected

Here is the caller graph for this function:

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.

Parameters
layerTypeAssignmentThe type-to-layer assignments.
QSharedPointer< RootRegion > rdf::PageElement::rootRegion ( ) const

Returns the root region. This is needed if the XML is read.

Returns
void rdf::PageElement::setCreator ( const QString &  creator)

Set the creator of the PAGE XML.

Parameters
creatorThe PAGE creator (CVL if we write).
void rdf::PageElement::setDateCreated ( const QDateTime &  date)

Set the date created of the PAGE XML.

Parameters
dateThe date created.
void rdf::PageElement::setDateModified ( const QDateTime &  date)

Set the date modified of the PAGE XML.

Parameters
dateThe 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.

Parameters
nameThe image's filename.
void rdf::PageElement::setImageSize ( const QSize &  size)

Set the size of the image.

Parameters
sizeThe 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.

Parameters
regionThe root region.
void rdf::PageElement::setXmlPath ( const QString &  xmlPath)

Set the XML path.

Parameters
xmlPathThe XML path.
void rdf::PageElement::sortLayers ( bool  checkIfSorted = false)

Sorts the layers by their zIndex in ascending order.

Parameters
checkIfSortedif set to true [only sort if not already sorted].
QString rdf::PageElement::toString ( ) const
virtual

Creates a string with all relevant attributes of the current instance.

Returns

Here is the caller graph for this function:

QString rdf::PageElement::xmlPath ( ) const

The PAGE XML path.

Returns

Friends And Related Function Documentation

DllCoreExport QDebug operator<< ( QDebug  d,
const PageElement p 
)
friend

Prints the page element to the debug stream.

Parameters
dThe debug stream.
pThe page element.
Returns
DllCoreExport QDataStream& operator<< ( QDataStream &  s,
const PageElement p 
)
friend

Appends the page element to the data stream s.

Parameters
sThe data stream.
pThe page element.
Returns

Member Data Documentation

QString rdf::PageElement::mCreator
protected
QDateTime rdf::PageElement::mDateCreated
protected
QDateTime rdf::PageElement::mDateModified
protected
QSharedPointer<LayerElement> rdf::PageElement::mDefaultLayer
protected
QString rdf::PageElement::mImageFileName
protected
QSize rdf::PageElement::mImageSize
protected
QVector<QSharedPointer<LayerElement> > rdf::PageElement::mLayers
protected
QSharedPointer<RootRegion> rdf::PageElement::mRoot
protected
QString rdf::PageElement::mXmlPath
protected

The documentation for this class was generated from the following files: