Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

WocQtOut Class Reference

Abstract base class for Qt client and server output. More...

#include <qtout.h>

Inheritance diagram for WocQtOut:
WocOutput WocQtClientOut WocQtServerOut

List of all members.

Public Types

enum  FileType { Header, Source }
 

types of files generated

More...
enum  InOut { In, Out }

Public Member Functions

 WocQtOut (QDomElement &)
 creates a Qt output object from the corresponding XML tag that specifies what kind of output is desired.
 ~WocQtOut ()=0
 deletes the output object
void addIfaceHeaderPrefix (const QString &s)
 adds data to the prefix section of the interface class header, this is for include's and forward declarations
void addIfaceHeaderClass (const QString &s)
 adds data to the class body of the interface class header, this is for method declarations
void addIfaceImpl (const QString &)
 adds code to the implementation file of the interface class
QString qttype (const WocClass &, QString, bool dolist=true)
 helper: generate a proper Qt type for a property
QString qttype (const WocTransaction &, QString, InOut)
 helper: generate a proper QT type for a transaction variable
QString qtobjtype (const WocTransaction &, QString, InOut)
 helper: generate a proper QT type for a transaction variable, WO* only
void addFile (QString basename)
 helper: adds a file to the project file
void addFile (FileType kind, QString fname)
 helper: adds a file to the project file
void addProjectLine (QString)
 helper: add a line to the project file
void addPostIface (QString)
 helper: adds a line after the class definition of the interface class
QString ifaceClassName () const
 helper: returns the class name of the interface class
void addScriptInit (QString s)
 helper: adds a line to the script initializer; this is ignored if scripting is inactive
bool doGenerateScripting () const
 helper: returns true if sub-classes are supposed to create scripting code
QString namePrefix () const
 returns the class name prefix configured for this output
QString languageSpec () const
 returns the language output spec
QString baseDir () const
 returns the base directory of the project
QString subDir () const
 returns the sub directory relative to the project where to store files
QString destinationPath () const
 returns the complete path for files, baseDir()+subDir()
QString transactionBase () const
 returns the base class of all transactions

Protected Member Functions

virtual void finalize ()
 overloaded slot, called when parsing is finished
virtual void newClass (const WocClass &)
 overloaded slot, called for each new class
virtual void newTable (const WocTable &)
 overloaded slot, called for each new table
virtual void newTransaction (const WocTransaction &)
 overloaded slot, called for each new transaction

Protected Attributes

QString m_lang
WocQtClassqclass
WocQtTableqtable
WocQtTransactionqtrans

Private Member Functions

void initScripting ()
 internal: init the scripting env
void initVersionH ()
 internal: generate the static header for version info

Private Attributes

QString m_basedir
QString m_subdir
QString m_prefix
QString m_transbase
QString m_postiface
QString m_scriptcode
bool m_clean
bool m_genscript
MFile m_pri
MFile m_iface
MFile m_ifacecpp
MFile m_hdr
QString m_iface_prefix
QString m_iface_class

Detailed Description

Abstract base class for Qt client and server output.

This class controls the main include files and uses helpers to generate transactions, classes and tables.

It generates the interface class, a .pri-file and an include-all file.


Member Enumeration Documentation

types of files generated

Enumerator:
Header 
Source 
Enumerator:
In 
Out 

Constructor & Destructor Documentation

WocQtOut::WocQtOut ( QDomElement &  el  )  [explicit]

creates a Qt output object from the corresponding XML tag that specifies what kind of output is desired.

WocQtOut::~WocQtOut (  )  [pure virtual]

deletes the output object


Member Function Documentation

void WocQtOut::addFile ( QString  basename  ) 

helper: adds a file to the project file

Parameters:
basename the class name to add
void WocQtOut::addFile ( WocQtOut::FileType  ft,
QString  fname 
)

helper: adds a file to the project file

Parameters:
fname the file name to add
kind the type of file
void WocQtOut::addIfaceHeaderClass ( const QString &  s  )  [inline]

adds data to the class body of the interface class header, this is for method declarations

void WocQtOut::addIfaceHeaderPrefix ( const QString &  s  )  [inline]

adds data to the prefix section of the interface class header, this is for include's and forward declarations

void WocQtOut::addIfaceImpl ( const QString &  s  ) 

adds code to the implementation file of the interface class

void WocQtOut::addPostIface ( QString  s  ) 

helper: adds a line after the class definition of the interface class

void WocQtOut::addProjectLine ( QString  ln  ) 

helper: add a line to the project file

void WocQtOut::addScriptInit ( QString  s  )  [inline]

helper: adds a line to the script initializer; this is ignored if scripting is inactive

QString WocQtOut::baseDir (  )  const [inline]

returns the base directory of the project

QString WocQtOut::destinationPath (  )  const [inline]

returns the complete path for files, baseDir()+subDir()

bool WocQtOut::doGenerateScripting (  )  const [inline]

helper: returns true if sub-classes are supposed to create scripting code

void WocQtOut::finalize (  )  [protected, virtual]

overloaded slot, called when parsing is finished

Implements WocOutput.

QString WocQtOut::ifaceClassName (  )  const [inline]

helper: returns the class name of the interface class

void WocQtOut::initScripting (  )  [private]

internal: init the scripting env

void WocQtOut::initVersionH (  )  [private]

internal: generate the static header for version info

QString WocQtOut::languageSpec (  )  const [inline]

returns the language output spec

QString WocQtOut::namePrefix (  )  const [inline]

returns the class name prefix configured for this output

void WocQtOut::newClass ( const WocClass cls  )  [protected, virtual]

overloaded slot, called for each new class

Implements WocOutput.

void WocQtOut::newTable ( const WocTable tbl  )  [protected, virtual]

overloaded slot, called for each new table

Implements WocOutput.

void WocQtOut::newTransaction ( const WocTransaction trn  )  [protected, virtual]

overloaded slot, called for each new transaction

Implements WocOutput.

QString WocQtOut::qtobjtype ( const WocTransaction trn,
QString  v,
InOut  io 
)

helper: generate a proper QT type for a transaction variable, WO* only

QString WocQtOut::qttype ( const WocTransaction trn,
QString  v,
InOut  io 
)

helper: generate a proper QT type for a transaction variable

QString WocQtOut::qttype ( const WocClass cls,
QString  p,
bool  dolist = true 
)

helper: generate a proper Qt type for a property

QString WocQtOut::subDir (  )  const [inline]

returns the sub directory relative to the project where to store files

QString WocQtOut::transactionBase (  )  const [inline]

returns the base class of all transactions


Member Data Documentation

QString WocQtOut::m_basedir [private]
bool WocQtOut::m_clean [private]
bool WocQtOut::m_genscript [private]
QString WocQtOut::m_iface_class [private]
QString WocQtOut::m_iface_prefix [private]
QString WocQtOut::m_lang [protected]
QString WocQtOut::m_postiface [private]
QString WocQtOut::m_prefix [private]
QString WocQtOut::m_scriptcode [private]
QString WocQtOut::m_subdir [private]
QString WocQtOut::m_transbase [private]

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