MagicSmoke  $VERSION$
MOdtRenderer Class Referenceabstract

abstract base class for all ODT rendering classes More...

#include <odtrender.h>

Inheritance diagram for MOdtRenderer:
MBillRenderer MOdtSignalRenderer

Public Types

enum  FileFormat { FileFormat::None, FileFormat::Version2, FileFormat::ConvertedV1 }
 format of the file represented by this renderer More...
 

Public Member Functions

 MOdtRenderer (MTemplate file)
 instantiates a renderer loaded from template file More...
 
virtual ~MOdtRenderer ()
 deletes the renderer More...
 
FileFormat fileFormat () const
 returns the format of the file More...
 
virtual void renderToFile (QString file)
 starts the internal rendering routine and outputs to file More...
 
virtual void renderToFile (QFile &file, bool preventOpen=false)
 starts the internal rendering routine and outputs to file More...
 
virtual QString renderToPdf ()
 like renderToPrinter, but renders to PDF, returns the PDF file name More...
 
virtual void renderToPrinter ()
 starts the internal rendering routine and outputs to printer (calls OpenOffice to print) More...
 

Static Public Member Functions

static QByteArray convertV1toV2 (const QByteArray &)
 helper routine: converts a V1 template to V2 you have to make sure to not do a double conversion on an already converted document More...
 

Protected Member Functions

virtual int getLoopIterations (QString loopname)=0
 implement this to return the amount of iterations for a defined loop; should return 0 if the loop does not exist More...
 
virtual QVariant getVariable (QString varname)=0
 implement this to return the value of a variable during rendering; should return empty string if the variable does not exist More...
 
virtual void setLoopIteration (QString loopname, int interation)=0
 implement this to populate the variables used in a specific iteration of the loop More...
 

Friends

class MOdfEngine
 
class MOdtRendererPrivate
 

Detailed Description

abstract base class for all ODT rendering classes

Member Enumeration Documentation

format of the file represented by this renderer

Enumerator
None 

no file loaded or loading was not successful

Version2 

file was a valid v2 format

ConvertedV1 

file was probably v1 or plain ODF, it has been converted

Constructor & Destructor Documentation

MOdtRenderer::MOdtRenderer ( MTemplate  file)

instantiates a renderer loaded from template file

References MTemplate::cacheFileName(), MOdfEngine, MOdtRendererPrivate, and MTemplate::targetExtension().

MOdtRenderer::~MOdtRenderer ( )
virtual

deletes the renderer

Member Function Documentation

QByteArray MOdtRenderer::convertV1toV2 ( const QByteArray &  old)
static

helper routine: converts a V1 template to V2 you have to make sure to not do a double conversion on an already converted document

References OdfTemplateNS(), and xmlize().

Referenced by MOdtRendererPrivate::MOdtRendererPrivate().

MOdtRenderer::FileFormat MOdtRenderer::fileFormat ( ) const

returns the format of the file

References MOdtRendererPrivate::fileformat.

virtual int MOdtRenderer::getLoopIterations ( QString  loopname)
protectedpure virtual

implement this to return the amount of iterations for a defined loop; should return 0 if the loop does not exist

Implemented in MOdtSignalRenderer, and MBillRenderer.

virtual QVariant MOdtRenderer::getVariable ( QString  varname)
protectedpure virtual

implement this to return the value of a variable during rendering; should return empty string if the variable does not exist

Implemented in MOdtSignalRenderer, and MBillRenderer.

Referenced by MOdfEngine::getConstant(), and MOdfEngine::hasConstant().

void MOdtRenderer::renderToFile ( QString  file)
virtual

starts the internal rendering routine and outputs to file

void MOdtRenderer::renderToFile ( QFile &  file,
bool  preventOpen = false 
)
virtual

starts the internal rendering routine and outputs to file

References openOfficeFile(), and MOdtRendererPrivate::renderToFile().

QString MOdtRenderer::renderToPdf ( )
virtual

like renderToPrinter, but renders to PDF, returns the PDF file name

References convertOfficeFilePdf(), MOdtRendererPrivate::extension, and MOdtRendererPrivate::renderToFile().

void MOdtRenderer::renderToPrinter ( )
virtual

starts the internal rendering routine and outputs to printer (calls OpenOffice to print)

References MOdtRendererPrivate::extension, printOfficeFile(), and MOdtRendererPrivate::renderToFile().

virtual void MOdtRenderer::setLoopIteration ( QString  loopname,
int  interation 
)
protectedpure virtual

implement this to populate the variables used in a specific iteration of the loop

Implemented in MBillRenderer.

Friends And Related Function Documentation

friend class MOdfEngine
friend

Referenced by MOdtRenderer().

friend class MOdtRendererPrivate
friend

Referenced by MOdtRenderer().


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