Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 mlineobject.h - Kugar report line object 00003 ------------------- 00004 begin : Wed Feb 23 2000 00005 copyright : (C) 2000 by Mutiny Bay Software 00006 email : info@mutinybaysoftware.com 00007 ***************************************************************************/ 00008 00009 #ifndef MLINEOBJECT_H 00010 #define MLINEOBJECT_H 00011 00012 #include <qobject.h> 00013 #include <qpainter.h> 00014 #include <qpaintdevice.h> 00015 #include <qcolor.h> 00016 #include <FLStylePainter.h> 00017 00024 class MLineObject: public QObject 00025 { 00026 00027 public: 00028 00032 enum Style { 00033 NoPen = 0, 00034 SolidLine, 00035 DashLine, 00036 DotLine, 00037 DashDotLine, 00038 DashDotDotLine 00039 }; 00040 00044 MLineObject(); 00045 00049 MLineObject(const MLineObject &mLineObject); 00050 00054 MLineObject operator=(const MLineObject &mLineObject); 00055 00059 virtual ~ MLineObject(); 00060 00061 protected: 00062 00066 int xpos1; 00067 00071 int ypos1; 00072 00076 int xpos2; 00077 00081 int ypos2; 00082 00086 int penWidth; 00087 00091 QColor penColor; 00092 00096 int penStyle; 00097 00101 int objectId; 00102 00103 public: 00104 00108 int getObjectId() const; 00109 00113 void setLine(int xStart, int yStart, int xEnd, int yEnd); 00114 00118 void setWidth(int width); 00119 00123 void setStyle(int style); 00124 00128 void setColor(int r, int g, int b); 00129 00133 void setObjectId(int id); 00134 00138 virtual void draw(FLStylePainter *p); 00139 00140 protected: 00141 00145 void drawBase(FLStylePainter *p); 00146 00147 private: 00148 00154 void copy(const MLineObject *mLineObject); 00155 00156 friend class MReportSection; 00157 }; 00158 00160 inline int MLineObject::getObjectId() const 00161 { 00162 return objectId; 00163 } 00164 00166 inline void MLineObject::setColor(int r, int g, int b) 00167 { 00168 penColor.setRgb(r, g, b); 00169 } 00170 00172 inline void MLineObject::setStyle(int style) 00173 { 00174 penStyle = style; 00175 } 00176 00178 inline void MLineObject::setWidth(int width) 00179 { 00180 penWidth = width; 00181 } 00182 00184 inline void MLineObject::setObjectId(int id) 00185 { 00186 objectId = id; 00187 } 00188 #endif