00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef RTKOUTPUTOPENOFFICE_H
00022 #define RTKOUTPUTOPENOFFICE_H
00023
00024 #include <qfile.h>
00025
00026 #include "rtkoutput.h"
00027
00028 namespace RTK
00029 {
00030
00031 class OutputOpenOffice : public Output
00032 {
00033 public:
00034 enum OOCreateOptions { CREATE, REPLACE_CONTENT, ADD_FIRST_SHEET, ADD_LAST_SHEET, REPLACE_FIRST_SHEET, REPLACE_LAST_SHEET };
00035
00036 public:
00037 OutputOpenOffice(const String& filename = String::null, const String& encoding = String::null,
00038 const String& templatedir = String::null, const OOCreateOptions& replacecontent = CREATE,
00039 PaperType papertype = A4, UnitsType units = dots,
00040 Measure sizex = 595, Measure sizey = 841, Measure marginleft = 0,
00041 Measure marginright = 0, Measure margintop = 0, Measure marginbottom = 0, int pageorientation = 0)
00042 :Output(papertype, units,
00043 sizex, sizey, marginleft,
00044 marginright, margintop, marginbottom, pageorientation),
00045 mFileName(filename), mEncoding(encoding),
00046 mTemplatePath(templatedir), mReplaceContent(replacecontent)
00047
00048 , mDetailsFieldCount(0) {}
00049
00050 ~OutputOpenOffice() {}
00051 int startReport( const Report &report );
00052 int endReport( const Report &report );
00053 Measure startPage();
00054 Measure endPage();
00055 Measure startSection( const Section §ion );
00056 Measure endSection( const Section §ion );
00057 Measure startObject( const Section §ion, const Object &object );
00058 Measure endObject( const Section §ion, const Object &object );
00059 Measure printObject( const Report &report, const Section §ion, const Object &object );
00060 Measure setPosX( Measure newx );
00061 Measure setPosY( Measure newy );
00062
00063
00064 public:
00066 const String& getFileName() const { return mFileName; };
00068 void setFileName(const String& filename) { mFileName = filename; };
00070 const String& getEncoding() const { return mEncoding; };
00072 void setEncoding(const String& encoding) { mEncoding = encoding; };
00074 const String& getTemplatePath() const { return mTemplatePath; };
00076 void setTemplatePath(const String& templatedir) { mTemplatePath = templatedir; };
00078 const OOCreateOptions& getReplaceContent() const { return mReplaceContent; };
00080 void setReplaceContent(const OOCreateOptions& replacecontent) { mReplaceContent = replacecontent; };
00081 protected:
00082 String mFileName;
00083 String mEncoding;
00084 String mTemplatePath;
00085 OOCreateOptions mReplaceContent;
00086
00087
00088 private:
00089 int mDetailsFieldCount;
00090 int mIntSizeX, mIntSizeY;
00091 QFile *pFile;
00092 };
00093
00094 };
00095
00096 #endif
00097