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

rtkoutputqpainter.h

00001 /*<<<<<COPYRIGHT*/
00002 /*
00003  * RTK The report toolkit
00004  * Copyright (C) 2003 Francisco Santiago Capel Torres
00005 
00006  * rtkoutputqpainter.h RTK standard qpainter 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 RTKOUTPUTQPAINTER_H
00022 #define RTKOUTPUTQPAINTER_H
00023 
00024 #include <qpicture.h>
00025 #include <qpainter.h>
00026 #include <qvaluevector.h>
00027 #include "rtkoutput.h"
00028 
00029 namespace RTK {
00030 
00031 typedef QValueVector<QPicture *> QPageCollection;
00032             
00033 class OutputQPainter : public Output  {
00034 /*<<<<<OUTPUTQPAINTER_CONSTRUCTOR*/
00035 public:
00036         OutputQPainter(Measure unitsperinchx = 72, Measure unitsperinchy = 72,
00037         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         :Output(papertype, units, 
00041                 sizex, sizey, marginleft, 
00042                 marginright, margintop, marginbottom, pageorientation),
00043         mUnitsPerInchX(unitsperinchx), mUnitsPerInchY(unitsperinchy)
00044 /*>>>>>OUTPUTQPAINTER_CONSTRUCTOR*/
00045         {
00046           initSizes();
00047         };
00048   
00049     ~OutputQPainter() {};
00050     int startReport(const Report &report);
00051     int endReport(const Report &report);
00052     Measure startPage();
00053     Measure endPage();
00054     Measure startSection(const Section &section);
00055     Measure endSection(const Section &section);
00056     Measure startObject(const Section &section, const Object &object);
00057     Measure endObject(const Section &section, const Object &object);
00058     Measure printObject(const Report &report, const Section &section, const Object &object);
00059     bool sectionFits(const Section &section, Measure nextsectionheight) const;
00060 
00061     QPicture *getFirstPage() const;
00062     const QPageCollection *getPageCollection() const
00063       { return &mPageCollection; }
00064 
00065 /*<<<<<OUTPUTQPAINTER_GETSET*/
00066 public:
00067         Measure getUnitsPerInchX() const { return mUnitsPerInchX; };
00068         void setUnitsPerInchX(Measure unitsperinchx) { mUnitsPerInchX = unitsperinchx; };
00069         Measure getUnitsPerInchY() const { return mUnitsPerInchY; };
00070         void setUnitsPerInchY(Measure unitsperinchy) { mUnitsPerInchY = unitsperinchy; };
00071 protected:
00072         Measure mUnitsPerInchX;
00073         Measure mUnitsPerInchY;
00074 /*>>>>>OUTPUTQPAINTER_GETSET*/
00075 
00076 private:    
00077     QPageCollection mPageCollection;
00078     QPainter mPainter;
00079     void initSizes();
00080         QBrush mSavedBrush;
00081 };
00082 
00083 }; // namespace
00084 
00085 #endif // RTKOUTPUTQPAINTER
00086 

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