Ananas Library  0.9.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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

void aMSOTemplate::cleanUpTags ( )
virtual

clears all tags from pattern

Reimplemented from iTemplate.

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

void aMSOTemplate::clear ( )
virtual

clears internal variable.

Reimplemented from iTemplate.

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

Referenced by cleanUpTags().

void aMSOTemplate::clearRow ( QDomNode  node)
protected

Deletes row, having section tag

Parameters
node- context

Referenced by cleanUpTags().

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

Deletes tags from node

Parameters
node- context
section-

Referenced by cleanUpTags(), and insertRowValues().

void aMSOTemplate::close ( )
virtual

Closes pattern.

Reimplemented from iTemplate.

References docTpl.

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

QString aMSOTemplate::getDir ( )
virtual

The catalogue for storage of time files of the report

Reimplemented from iTemplate.

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

int aMSOTemplate::getRowIndex ( QDomNode  node)
protected

Defines number of a line in a pattern

Parameters
node- context

Referenced by insertRowValues().

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

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

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

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

Open pattern.

Parameters
fnamename of pattern.

Implements iTemplate.

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

QString aMSOTemplate::result ( )
virtual

Returns patten

Reimplemented from iTemplate.

References docTpl.

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

Save pattern

Reimplemented from iTemplate.

References docTpl, and aLog::print().

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(), and insertTagsValues().

Referenced by exec(), and insertRowValues().

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.

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

QDomDocument aMSOTemplate::docTpl
protected

Variable for store unpacking teplate content

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

QString aMSOTemplate::templateDir
protected

directory template name

Referenced by open(), and setDir().


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