Ananas Library  0.9.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
aOOTemplate Class Reference

#include <aootemplate.h>

Inheritance diagram for aOOTemplate:
iTemplate aCalcTemplate

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 setDir (const QString &dirName)
 
virtual QString getDir ()
 
virtual void cleanUpTags ()
 
virtual bool lineFeedRemove (const QString &filename)
 
- 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)
 

Protected Attributes

QString copyName
 
QString templateDir
 
QMap< QString, QString > values
 
QDomDocument docTpl
 
QDomDocument docStyle
 

Detailed Description

Class for work with pattern in OpenOffice format

Member Function Documentation

void aOOTemplate::cleanUpTags ( )
virtual

clears all tags from pattern

Reimplemented from iTemplate.

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

void aOOTemplate::clear ( )
virtual

clears internal variable.

Reimplemented from iTemplate.

void aOOTemplate::clearRow ( QDomNode  node)
protected

Deletes row, having section tag

Parameters
node- context

Referenced by cleanUpTags().

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

Deletes tags from node

Parameters
node- context
section-

Referenced by cleanUpTags(), and insertRowValues().

void aOOTemplate::close ( )
virtual

Closes pattern. Deletes temporary files.

Reimplemented from iTemplate.

References copyName, docStyle, and docTpl.

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

Execute replace tags to values.

Reimplemented from iTemplate.

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

QString aOOTemplate::getDir ( )
virtual

Gets working directory

Reimplemented from iTemplate.

bool aOOTemplate::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

Reimplemented in aCalcTemplate.

Referenced by searchTags().

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

Returns value parameter name

Reimplemented from iTemplate.

References aLog::print().

Referenced by exec(), aCalcTemplate::insertTagsValues(), and insertTagsValues().

void aOOTemplate::insertRowValues ( QDomNode  node)
protected

insert new row in table and replace tag to value

See Also
searchTags()

References clearTags(), and searchTags().

Referenced by searchTags().

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

Addes to tag value of parametr tagName

Parameters
node- context
sname- tag name

Reimplemented in aCalcTemplate.

References getValue().

Referenced by searchTags().

bool aOOTemplate::lineFeedRemove ( const QString &  filename)
virtual

Deletes from a file line feeds

References aLog::print().

Referenced by save().

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

Open pattern.

Parameters
fname

Implements iTemplate.

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

QString aOOTemplate::result ( )
virtual

Returns patten

Reimplemented from iTemplate.

References docTpl.

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

Save pattern

Reimplemented from iTemplate.

References copyName, docStyle, docTpl, lineFeedRemove(), aLog::print(), and templateDir.

void aOOTemplate::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 aOOTemplate::setDir ( const QString &  dir)
virtual

Sets working directory

Reimplemented from iTemplate.

References templateDir.

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

Sets value parameter `name'

Reimplemented from iTemplate.

Referenced by exec().

Member Data Documentation

QString aOOTemplate::copyName
protected

directory name for unzip

Referenced by close(), open(), and save().

QDomDocument aOOTemplate::docStyle
protected

Variable for store unpacking teplate stales

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

QDomDocument aOOTemplate::docTpl
protected

Variable for store unpacking teplate content

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

QString aOOTemplate::templateDir
protected

directory template name

Referenced by open(), save(), and setDir().


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