Eneboo - Documentación para desarrolladores
src/kugar/mlabelobject.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002              mlabelobject.h  -  Kugar report label object
00003              -------------------
00004    begin     : Wed Aug 11 1999
00005    copyright : (C) 1999 by Mutiny Bay Software
00006    email     : info@mutinybaysoftware.com
00007    copyright : (C) 2002-2003 InfoSiAL S.L.
00008    email     : mail@infosial.com
00009 ***************************************************************************/
00010 
00011 #ifndef MLABELOBJECT_H
00012 #define MLABELOBJECT_H
00013 
00014 #include <qstring.h>
00015 #include <qfontmetrics.h>
00016 #include <qpixmap.h>
00017 #include <qdom.h>
00018 
00019 #include <qsargument.h>
00020 #include <FLApplication.h>
00021 
00022 #include "mreportobject.h"
00023 
00030 class MLabelObject: public MReportObject
00031 {
00032 
00033 public:
00034 
00038   enum FontWeight {
00039     Light = 25,
00040     Normal = 50,
00041     DemiBold = 63,
00042     Bold = 75,
00043     Black = 87
00044   };
00045 
00049   enum HAlignment {
00050     Left = 0,
00051     Center,
00052     Right
00053   };
00054 
00058   enum VAlignment {
00059     Top = 0,
00060     Middle,
00061     Bottom
00062   };
00063 
00067   MLabelObject();
00068 
00073   MLabelObject(const MLabelObject &mLabelObject);
00074 
00078   MLabelObject operator=(const MLabelObject &mLabelObject);
00079 
00083   virtual ~ MLabelObject();
00084 
00085 protected:
00086 
00090   QString text;
00091 
00095   QPixmap *pixmap;
00096 
00100   QString fontFamily;
00101 
00105   float fontSize;
00106 
00110   int fontWeight;
00111 
00115   bool fontItalic;
00116 
00120   bool adjustFontSize;
00121 
00125   int hAlignment;
00126 
00130   int vAlignment;
00131 
00135   bool wordWrap;
00136 
00140   QString labelFunction;
00141 
00145   bool changeHeight;
00146 
00150   QString paintFunction;
00151 
00158   QDomNode domNodeData;
00159 
00160 public:
00161 
00165   virtual void setText(const QString txt);
00166 
00170   virtual QString getText();
00171 
00173   bool getChangeHeight() const;
00174 
00178   virtual void setPixmap(const QPixmap &pix);
00179 
00183   void setFont(const QString family, float size, int weight, bool italic);
00184 
00188   void setAdjustFontSize(bool a);
00189 
00193   void setHorizontalAlignment(int a);
00194 
00198   void setVerticalAlignment(int a);
00199 
00203   void setWordWrap(bool state);
00204 
00208   void setChangeHeight(bool state);
00209 
00213   void setLabelFunction(const QString &lF);
00214 
00218   void setPaintFunction(const QString &pF);
00219 
00223   virtual void setDomNodeData(const QDomNode &nD);
00224 
00229   virtual int draw(FLStylePainter *p);
00230 
00234   virtual int calcHeight(FLStylePainter *p) const;
00235 
00236 private:
00237 
00243   void copy(const MLabelObject *mLabelObject);
00244 
00246   bool drawPixmap(FLStylePainter *p, QPixmap *pixmap);
00247 };
00248 
00250 inline bool MLabelObject::getChangeHeight() const
00251 {
00252   return changeHeight;
00253 }
00254 
00256 inline void MLabelObject::setHorizontalAlignment(int a)
00257 {
00258   hAlignment = a;
00259 }
00260 
00262 inline void MLabelObject::setVerticalAlignment(int a)
00263 {
00264   vAlignment = a;
00265 }
00266 
00268 inline void MLabelObject::setWordWrap(bool state)
00269 {
00270   wordWrap = state;
00271 }
00272 
00274 inline void MLabelObject::setChangeHeight(bool state)
00275 {
00276   changeHeight = state;
00277 }
00278 
00280 inline void MLabelObject::setLabelFunction(const QString &lF)
00281 {
00282   labelFunction = lF;
00283 }
00284 
00285 inline void MLabelObject::setPaintFunction(const QString &pF)
00286 {
00287   paintFunction = pF;
00288 }
00289 
00290 inline void MLabelObject::setDomNodeData(const QDomNode &nD)
00291 {
00292   domNodeData = nD;
00293 }
00294 
00296 inline void MLabelObject::setAdjustFontSize(bool a)
00297 {
00298   adjustFontSize = a;
00299 }
00300 
00301 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'