MagicSmoke  $VERSION$
MTemplateStore Class Reference

this class implements the storage end of the template subsystem, its only instance exists in the webrequest More...

#include <templates.h>

Public Member Functions

QList< MTemplateallTemplates ()
 returns all templates (for MTemplateEditor) More...
 
MTemplate getTemplate (QString base, bool useFirst=false)
 returns a specific template by its base name, opens a template choice dialog if necessary More...
 
MTemplate getTemplateByFile (QString full)
 returns a specific template by its full name, returns an invalid template if it does not exist More...
 

Protected Member Functions

 MTemplateStore (QString)
 instantiates the template subsystem More...
 
bool deleteTemplate (QString)
 deletes a template (requires full name), used by MTemplateEditor More...
 
bool setTemplate (QString templatename, QString localfile)
 stores a specific template More...
 
bool setTemplateDescription (QString templatename, QString description)
 stores a new description for a template More...
 
bool setTemplateFlags (QString templatename, QString flags)
 stores a change of flags for a template More...
 
void updateTemplates (bool force)
 updates the template directory, does not do anything if force==false and the last update was less than 5min ago More...
 

Friends

class MSInterface
 
class MTemplateEditor
 

Detailed Description

this class implements the storage end of the template subsystem, its only instance exists in the webrequest

Constructor & Destructor Documentation

MTemplateStore::MTemplateStore ( QString  p)
protected

instantiates the template subsystem

References MTemplateStore().

Referenced by MTemplateStore().

Member Function Documentation

QList< MTemplate > MTemplateStore::allTemplates ( )

returns all templates (for MTemplateEditor)

References req, and updateTemplates().

bool MTemplateStore::deleteTemplate ( QString  n)
protected

deletes a template (requires full name), used by MTemplateEditor

References req.

MTemplate MTemplateStore::getTemplate ( QString  base,
bool  useFirst = false 
)

returns a specific template by its base name, opens a template choice dialog if necessary

Parameters
basethe base name of the template to retrieve (eg. "ticket" or "voucher")
useFirstif true: use the first match regardless of whether there are more candidates

References MSInterface::checkFlags(), MSInterface::instance(), req, templaceChoser(), and updateTemplates().

MTemplate MTemplateStore::getTemplateByFile ( QString  full)

returns a specific template by its full name, returns an invalid template if it does not exist

Parameters
fullthe full name of the template to retrieve (eg. "ticket.xtt,1")

References req, and updateTemplates().

Referenced by PrintingRun::PrintingRun(), and MPServerConfig::validateConfig().

bool MTemplateStore::setTemplate ( QString  templatename,
QString  localfile 
)
protected

stores a specific template

References req.

bool MTemplateStore::setTemplateDescription ( QString  templatename,
QString  description 
)
protected

stores a new description for a template

References req.

bool MTemplateStore::setTemplateFlags ( QString  templatename,
QString  flags 
)
protected

stores a change of flags for a template

References req.

void MTemplateStore::updateTemplates ( bool  force)
protected

Friends And Related Function Documentation

friend class MSInterface
friend
friend class MTemplateEditor
friend

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