Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

rtkoutput.h

00001 /*<<<<<COPYRIGHT*/
00002 /*
00003  * RTK The report toolkit
00004  * Copyright (C) 2003 Francisco Santiago Capel Torres
00005 
00006  * rtkoutput.h RTK output object
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  */
00019 /*>>>>>COPYRIGHT*/
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 /*<<<<<OUTPUT_CONSTRUCTOR*/
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 /*>>>>>OUTPUT_CONSTRUCTOR*/
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 &section) = 0;
00058         virtual Measure endSection(const Section &section) = 0;
00059         virtual Measure startObject(const Section &section, const Object &object) = 0;
00060         virtual Measure endObject(const Section &section, const Object &object) = 0;
00061         virtual Measure printObject(const Report &report, const Section &section, const Object &object) = 0;
00062         virtual Measure setPosX(Measure newx);
00063         virtual Measure setPosY(Measure newy);
00064         virtual bool sectionFits(const Section &, Measure /*nextsectheight*/) const { return true; }
00065 
00066         int getCurrentPage()
00067         {
00068                 return mCurrentPage;
00069         }
00070         int getTotalPages()
00071         {
00072                 return mTotalPages;
00073         }
00074 
00075         /*<<<<<OUTPUT_GETSET*/
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 /*>>>>>OUTPUT_GETSET*/
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 }; // namespace
00117 
00118 #endif

Generated on Tue Feb 22 14:44:37 2005 for RTK. Report ToolKit by  doxygen 1.3.9.1