Ananas Library 0.9.5
aMSOTemplate Class Reference

#include <amsotemplate.h>

Inheritance diagram for aMSOTemplate:
iTemplate

Public Member Functions

virtual bool open (const QString &fname)
virtual void close ()
virtual void clear ()
virtual QString getValue (const QString &name)
virtual void setValue (const QString &name, const QString &value)
virtual QString exec (const QString &sname)
virtual QString result ()
virtual bool save (const QString &fname)
virtual void cleanUpTags ()
virtual void setDir (const QString &dir)
virtual QString getDir ()
Public Member Functions inherited from iTemplate
 iTemplate ()
virtual ~iTemplate ()

Protected Member Functions

void searchTags (QDomNode node, const QString &sname)
virtual bool getNodeTags (QDomNode node, const QString &tagname, bool params)
void insertRowValues (QDomNode node)
virtual void insertTagsValues (QDomNode node, const QString &tagName)
void clearTags (QDomNode node, bool section)
void clearRow (QDomNode node)
void clearAttributes (QDomNode n, const QString node, const QString attr)
int getRowIndex (QDomNode node)

Protected Attributes

QMap< QString, QString > values
QString templateDir
QDomDocument docTpl

Detailed Description

Class for work with pattern in Microsoft Office Word 2003 format

Member Function Documentation

◆ cleanUpTags()

void aMSOTemplate::cleanUpTags ( )
virtual

clears all tags from pattern

Reimplemented from iTemplate.

References clearAttributes(), clearRow(), clearTags(), and docTpl.

◆ clear()

void aMSOTemplate::clear ( )
virtual

clears internal variable.

Reimplemented from iTemplate.

◆ clearAttributes()

void aMSOTemplate::clearAttributes ( QDomNode node,
const QString nodename,
const QString attr )
protected

Deletes from node attribute

Parameters
node- context
nodename- node name
attr- attribut name

References clearAttributes().

Referenced by cleanUpTags(), and clearAttributes().

◆ clearRow()

void aMSOTemplate::clearRow ( QDomNode node)
protected

Deletes row, having section tag

Parameters
node- context

References clearRow().

Referenced by cleanUpTags(), and clearRow().

◆ clearTags()

void aMSOTemplate::clearTags ( QDomNode node,
bool section )
protected

Deletes tags from node

Parameters
node- context
section-

References clearTags().

Referenced by cleanUpTags(), clearTags(), and insertRowValues().

◆ close()

void aMSOTemplate::close ( )
virtual

Closes pattern.

Reimplemented from iTemplate.

References docTpl.

◆ exec()

QString aMSOTemplate::exec ( const QString & sname)
virtual

Execute replace tags to values.

Parameters
sname- name of parametr.

Reimplemented from iTemplate.

References docTpl, getValue(), searchTags(), and setValue().

◆ getDir()

QString aMSOTemplate::getDir ( )
virtual

The catalogue for storage of time files of the report

Reimplemented from iTemplate.

◆ getNodeTags()

bool aMSOTemplate::getNodeTags ( QDomNode node,
const QString & tagname,
bool params )
protectedvirtual

Return true, if node contain tag

Parameters
node- context for searching
sname- tag name
params- true, if find simple tag and false, if section

Referenced by searchTags().

◆ getRowIndex()

int aMSOTemplate::getRowIndex ( QDomNode node)
protected

Defines number of a line in a pattern

Parameters
node- context

Referenced by insertRowValues().

◆ getValue()

QString aMSOTemplate::getValue ( const QString & name)
virtual

Returns value parameter name

Parameters
name- name of parametr.

Reimplemented from iTemplate.

References aLog::print().

Referenced by exec(), and insertTagsValues().

◆ insertRowValues()

void aMSOTemplate::insertRowValues ( QDomNode node)
protected

insert new row in table and replace tag to value

Parameters
node- context for inserting
See also
searchTags()

References clearTags(), getRowIndex(), and searchTags().

Referenced by searchTags().

◆ insertTagsValues()

void aMSOTemplate::insertTagsValues ( QDomNode node,
const QString & tagName )
protectedvirtual

Addes to tag value of parametr tagName

Parameters
node- context
sname- tag name

References getValue().

Referenced by searchTags().

◆ open()

bool aMSOTemplate::open ( const QString & fname)
virtual

Open pattern.

Parameters
fnamename of pattern.

Implements iTemplate.

References docTpl, aLog::print(), and templateDir.

◆ result()

QString aMSOTemplate::result ( )
virtual

Returns patten

Reimplemented from iTemplate.

References docTpl.

◆ save()

bool aMSOTemplate::save ( const QString & fname)
virtual

Save pattern

Reimplemented from iTemplate.

References docTpl, and aLog::print().

◆ searchTags()

void aMSOTemplate::searchTags ( QDomNode node,
const QString & sname )
protected

Added value to end tag with name ‘sname’. Don't deletes tag.

Parameters
node- context for searching
sname- tag name
See also
cleanUpTags() getNodeTags() insertRowValues()

References getNodeTags(), insertRowValues(), insertTagsValues(), and searchTags().

Referenced by exec(), insertRowValues(), and searchTags().

◆ setDir()

void aMSOTemplate::setDir ( const QString & dir)
virtual

clears all tags from pattern

Parameters
dir- The catalogue in which is a pattern

Reimplemented from iTemplate.

References templateDir.

◆ setValue()

void aMSOTemplate::setValue ( const QString & name,
const QString & value )
virtual

Sets value parameter ‘name’

Parameters
name- name of parametr.
value- value of parametr.

Reimplemented from iTemplate.

Referenced by exec().

Member Data Documentation

◆ docTpl

QDomDocument aMSOTemplate::docTpl
protected

Variable for store unpacking teplate content

Referenced by cleanUpTags(), close(), exec(), open(), result(), and save().

◆ templateDir

QString aMSOTemplate::templateDir
protected

directory template name

Referenced by open(), and setDir().


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