00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef RTKOUTPUT_H
00022 #define RTKOUTPUT_H
00023
00024 #include "rtknamespace.h"
00025
00026 namespace RTK
00027 {
00028
00029 class Object;
00030 class Section;
00031 class Report;
00032
00033 class Output
00034 {
00035
00036 public:
00037 Output(PaperType papertype = A4, UnitsType units = dots,
00038 Measure sizex = 595, Measure sizey = 841, Measure marginleft = 0,
00039 Measure marginright = 0, Measure margintop = 0, Measure marginbottom = 0, int pageorientation = 0)
00040 :mPaperType(papertype), mUnits(units),
00041 mSizeX(sizex), mSizeY(sizey), mMarginLeft(marginleft),
00042 mMarginRight(marginright), mMarginTop(margintop), mMarginBottom(marginbottom), mPageOrientation(pageorientation)
00043
00044 { fixPaperSize();
00045 }
00046 public:
00047 Output()
00048 {}
00049 ;
00050 virtual ~Output()
00051 {}
00052 ;
00053 virtual int startReport(const Report &report) = 0;
00054 virtual int endReport(const Report &report) = 0;
00055 virtual Measure startPage() = 0;
00056 virtual Measure endPage() = 0;
00057 virtual Measure startSection(const Section §ion) = 0;
00058 virtual Measure endSection(const Section §ion) = 0;
00059 virtual Measure startObject(const Section §ion, const Object &object) = 0;
00060 virtual Measure endObject(const Section §ion, const Object &object) = 0;
00061 virtual Measure printObject(const Report &report, const Section §ion, const Object &object) = 0;
00062 virtual Measure setPosX(Measure newx);
00063 virtual Measure setPosY(Measure newy);
00064 virtual bool sectionFits(const Section &, Measure ) const { return true; }
00065
00066 int getCurrentPage()
00067 {
00068 return mCurrentPage;
00069 }
00070 int getTotalPages()
00071 {
00072 return mTotalPages;
00073 }
00074
00075
00076 public:
00077 PaperType getPaperType() const { return mPaperType; };
00078 void setPaperType(PaperType papertype) { mPaperType = papertype; };
00079 UnitsType getUnits() const { return mUnits; };
00080 void setUnits(UnitsType units) { mUnits = units; };
00081 Measure getSizeX() const { return mSizeX; };
00082 void setSizeX(Measure sizex) { mSizeX = sizex; };
00083 Measure getSizeY() const { return mSizeY; };
00084 void setSizeY(Measure sizey) { mSizeY = sizey; };
00085 Measure getMarginLeft() const { return mMarginLeft; };
00086 void setMarginLeft(Measure marginleft) { mMarginLeft = marginleft; };
00087 Measure getMarginRight() const { return mMarginRight; };
00088 void setMarginRight(Measure marginright) { mMarginRight = marginright; };
00089 Measure getMarginTop() const { return mMarginTop; };
00090 void setMarginTop(Measure margintop) { mMarginTop = margintop; };
00091 Measure getMarginBottom() const { return mMarginBottom; };
00092 void setMarginBottom(Measure marginbottom) { mMarginBottom = marginbottom; };
00093 int getPageOrientation() const { return mPageOrientation; };
00094 void setPageOrientation(int pageorientation) { mPageOrientation = pageorientation; };
00095 protected:
00096 PaperType mPaperType;
00097 UnitsType mUnits;
00098 Measure mSizeX;
00099 Measure mSizeY;
00100 Measure mMarginLeft;
00101 Measure mMarginRight;
00102 Measure mMarginTop;
00103 Measure mMarginBottom;
00104 int mPageOrientation;
00105
00106
00107 protected:
00108 static PaperSize mPaperSizes[];
00109 int mCurrentPage, mTotalPages;
00110 Measure mCurrX, mCurrY, mGrowthY;
00111
00112 private:
00113 void fixPaperSize();
00114 };
00115
00116 };
00117
00118 #endif