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

rtksection.h

00001 /*<<<<<COPYRIGHT*/
00002 /*
00003  * RTK The report toolkit
00004  * Copyright (C) 2003 Francisco Santiago Capel Torres
00005 
00006  * rtksection.h RTK section 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 #ifndef RTKSECTION_H
00021 #define RTKSECTION_H
00022 
00023 #include <vector>
00024 
00025 #include "rtkobject.h"
00026 
00027 namespace RTK {
00028 
00029 class Section: public Object
00030 {
00031     friend class Report;
00032 /*<<<<<SECTION_CONSTRUCTOR*/
00033 public:
00034         Section(SectionType type = SectionDetails, const String& groupname = "", 
00035                 Variant groupvalue = Variant(), uint grouplevel = 0, Variant pagebefore = false, 
00036                 Variant pageafter = false, Variant resetnpage = false, Variant supifblank = false, Variant repeatheader = false,
00037         const String& name = String::null, Variant value = 0, 
00038                 AggregateType aggregate = AggNone, String posx = 0, String posy = 0, 
00039                 String sizex = 0, String sizey = 0, const String& style = String::null, 
00040                 const String& url = String::null, const String& tag = String::null, Variant marginleft = 0, 
00041                 Variant marginright = 0, Variant margintop = 0, Variant marginbottom = 0, 
00042                 Variant visible = true, Variant supressed = false, Variant fontfamily = String::null, 
00043                 Variant fontsize = 12, Variant fontweight = 0, Variant fontitalic = false, 
00044                 Variant mask = String::null, Variant format = String::null, Variant halignment = AlignAuto, 
00045                 Variant valignment = AlignTop, Variant maxlines = 0, Variant minfontsize = 8, 
00046                 Variant adjustment = AdjustTrim, Variant textcolor = Qt::black, Variant backcolor = Qt::white, 
00047                 Variant bordercolor = Qt::black, Variant borderwidth = 0, Variant borderstyle = BorderNone, Variant backgroundimage = String::null)
00048         :Object(name, value, 
00049                 aggregate, posx, posy, 
00050                 sizex, sizey, style, 
00051                 url, tag, marginleft, 
00052                 marginright, margintop, marginbottom, 
00053                 visible, supressed, fontfamily, 
00054                 fontsize, fontweight, fontitalic, 
00055                 mask, format, halignment, 
00056                 valignment, maxlines, minfontsize, 
00057                 adjustment, textcolor, backcolor, 
00058                 bordercolor, borderwidth, borderstyle, backgroundimage),
00059         mType(type), mGroupName(groupname), 
00060                 mGroupValue(groupvalue), mGroupLevel(grouplevel), mPageBefore(pagebefore), 
00061                 mPageAfter(pageafter), mResetNPage(resetnpage), mSupIfBlank(supifblank), mRepeatHeader(repeatheader)
00062 /*>>>>>SECTION_CONSTRUCTOR*/
00063         , mRecordCount(0)
00064     {};
00065 
00066     bool groupChanged() const { return mNextRealGroupValue != mRealGroupValue; }
00067         void setRealGroupValue(Variant value) { mRealGroupValue = mNextRealGroupValue; mNextRealGroupValue = value; };
00068         Variant getRealGroupValue() { return mRealGroupValue; }
00069     
00070   uint getNObjects() const { return mObjects.size(); }
00071   Object *getObject(const String &name) const;
00072   Object *getObject(int i) const;
00073   int insertObject(Object *object);
00074 /*<<<<<SECTION_INSERTOBJECT*/
00075         int insertObject(String name = String::null, Variant value = 0, AggregateType aggregate = AggNone, String posx = 0, String posy = 0, String sizex = 0, String sizey = 0, String style = String::null, String url = String::null, String tag = String::null, String marginleft = 0, String marginright = 0, String margintop = 0, String marginbottom = 0, bool visible = true, bool supressed = false, String fontfamily = String::null, int fontsize = 12, int fontweight = 0, bool fontitalic = false, String mask = String::null, String format = String::null, AlignmentType halignment = AlignAuto, AlignmentType valignment = AlignTop, int maxlines = 0, int minfontsize = 8, AdjustmentType adjustment = AdjustTrim, Color textcolor = Qt::black, Color backcolor = Qt::white, Color bordercolor = Qt::black, int borderwidth = 0, BorderStyle borderstyle = BorderNone, String backgroundimage = String::null);
00076 /*>>>>>SECTION_INSERTOBJECT*/
00077   void fixObjectsMeasures(UnitsType outunit, Measure outsizex, Measure outsizey,
00078       UnitsType repunit, Measure repsizex, Measure repsizey);
00079   void calcAggregateValues(uint level);
00080         int getRecordCount() const { return mRecordCount; }
00081 /*<<<<<SECTION_GETSET*/
00082 public:
00084         SectionType getType() const { return mType; };
00086         void setType(SectionType type) { mType = type; };
00088         const String& getGroupName() const { return mGroupName; };
00090         void setGroupName(const String& groupname) { mGroupName = groupname; };
00092         Variant getGroupValue() const { return mGroupValue; };
00094         void setGroupValue(Variant groupvalue) { mGroupValue = groupvalue; };
00096         uint getGroupLevel() const { return mGroupLevel; };
00098         void setGroupLevel(uint grouplevel) { mGroupLevel = grouplevel; };
00100         bool isPageBefore() const;
00101         bool isNullPageBefore() const { return mPageBefore.isNull(); }
00103         void setPageBefore(const Variant & pagebefore) { mPageBefore = pagebefore; };
00105         bool isPageAfter() const;
00106         bool isNullPageAfter() const { return mPageAfter.isNull(); }
00108         void setPageAfter(const Variant & pageafter) { mPageAfter = pageafter; };
00110         bool isResetNPage() const;
00111         bool isNullResetNPage() const { return mResetNPage.isNull(); }
00113         void setResetNPage(const Variant & resetnpage) { mResetNPage = resetnpage; };
00115         bool isSupIfBlank() const;
00116         bool isNullSupIfBlank() const { return mSupIfBlank.isNull(); }
00118         void setSupIfBlank(const Variant & supifblank) { mSupIfBlank = supifblank; };
00120         bool isRepeatHeader() const;
00121         bool isNullRepeatHeader() const { return mRepeatHeader.isNull(); }
00123         void setRepeatHeader(const Variant & repeatheader) { mRepeatHeader = repeatheader; };
00124 protected:
00125         SectionType mType;
00126         String mGroupName;
00127         Variant mGroupValue;
00128         uint mGroupLevel;
00129         Variant mPageBefore;
00130         Variant mPageAfter;
00131         Variant mResetNPage;
00132         Variant mSupIfBlank;
00133         Variant mRepeatHeader;
00134 /*>>>>>SECTION_GETSET*/
00135     
00136     QValueList<Object *> mObjects;
00137     Variant mRealGroupValue, mNextRealGroupValue;
00138         int mRecordCount;
00139     
00140 #ifndef NDEBUG
00141 public:
00142     int debug_print() const;
00143 #endif
00144     
00145 };
00146 
00147 }; // namespace
00148 
00149 #endif
00150 

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