Documents > BPS V2 C++ API
bpsgraphicsitem.h
Go to the documentation of this file.
00001 
00004 #ifndef BPSGRAPHICSITEM_H
00005 #define BPSGRAPHICSITEM_H
00006 
00007 #include "bps.h"
00008 #include <QAbstractGraphicsShapeItem>
00009 
00010 class BpsMargins;
00011 
00018 class BPSCORE_EXPORT BpsGraphicsSimpletextItem : public QAbstractGraphicsShapeItem
00019 {
00020     BPS_PRIVATE(BpsGraphicsSimpletextItem)
00021 
00022 public:
00027     BpsGraphicsSimpletextItem(QGraphicsItem* aParent = 0);
00028 
00032     QRectF rect() const;
00033 
00038     void setRect(const QRectF& aRect); 
00039 
00043     QString text() const;
00044 
00049     void setText(const QString& aText);
00050 
00054     QColor color() const;
00055 
00060     void setColor(const QColor &aColor);
00061 
00065     QFont font() const;
00066 
00071     void setFont(const QFont& aFont);
00072 
00076     Bps::Alignment alignment() const;
00077 
00082     void setAlignment(Bps::Alignment aAlignment);
00083 
00087     Bps::Direction direction() const;
00088 
00093     void setDirection(Bps::Direction aDirection);
00094 
00098     int roundness() const;
00099 
00106     void setRoundness(int aRoundness);
00107 
00111     BpsMargins margins() const;
00112 
00117     void setMargins(const BpsMargins& aMargins);
00118 
00120     enum { Type = 10000000 };
00121     virtual ~BpsGraphicsSimpletextItem();
00122     virtual int type() const;
00123     virtual QRectF boundingRect() const;
00124     virtual QPainterPath shape() const;
00125     virtual void paint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, QWidget* aWidget = 0);
00127 
00128 }; // BpsGraphicsSimpletextItem
00129 
00135 class BPSCORE_EXPORT BpsGraphicsRichtextItem : public QAbstractGraphicsShapeItem
00136 {
00137     BPS_PRIVATE(BpsGraphicsRichtextItem)
00138 
00139 public:
00144     BpsGraphicsRichtextItem(QGraphicsItem* aParent = 0);
00145 
00149     int resolution() const; 
00150 
00155     void setResolution(int aResolution);
00156 
00160     Bps::Direction direction() const;
00161 
00166     void setDirection(Bps::Direction aDirection);
00167 
00171     int roundness() const;
00172 
00179     void setRoundness(int aRoundness);
00180 
00184     BpsMargins margins() const;
00185 
00190     void setMargins(const BpsMargins& aMargins);
00191 
00195     qreal textWidth() const;
00196 
00201     void setTextWidth(qreal aWidth);
00202 
00206     QFont defaultFont() const;
00207 
00212     void setDefaultFont(const QFont& aFont);
00213 
00217     QString toHtml() const;
00218 
00223     void setHtml(const QString& aText);
00224 
00228     QString toPlainText() const;
00229 
00234     void setPlainText(const QString& aText);
00235 
00239     QRectF handleRect() const;
00240 
00242     enum { Type = 10000001 };
00243     virtual ~BpsGraphicsRichtextItem();
00244     virtual int type() const;
00245     virtual QRectF boundingRect() const;
00246     virtual QPainterPath shape() const;
00247     virtual bool contains(const QPointF& aPoint) const;
00248     virtual void paint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, QWidget* aWidget = 0);
00250 
00251 }; // BpsGraphicsRichtextItem
00252 
00262 class BPSCORE_EXPORT BpsGraphicsLineItem : public QGraphicsItem
00263 {
00264     BPS_PRIVATE(BpsGraphicsLineItem)
00265 
00266 public:
00271     BpsGraphicsLineItem(QGraphicsItem* aParent = 0);
00272 
00276     QPen pen() const;
00277 
00282     void setPen(const QPen &aPen);
00283 
00287     QLineF line() const;
00288 
00293     void setLine(const QLineF& aLine); 
00294 
00298     QPointF p1() const;
00299 
00304     void setP1(const QPointF& aPoint);
00305 
00309     QPointF p2() const;
00310 
00315     void setP2(const QPointF& aPoint);
00316 
00318     enum { Type = 10000002 };
00319     virtual ~BpsGraphicsLineItem();
00320     virtual int type() const;
00321     virtual QRectF boundingRect() const;
00322     virtual QPainterPath shape() const;
00323     virtual bool contains(const QPointF &point) const;
00324     virtual void paint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, QWidget* aWidget = 0);
00326 
00327 }; // BpsGraphicsLineItem
00328 
00332 class BPSCORE_EXPORT BpsGraphicsRectItem : public QAbstractGraphicsShapeItem
00333 {
00334     BPS_PRIVATE(BpsGraphicsRectItem)
00335 
00336 public:
00337 
00342     BpsGraphicsRectItem(QGraphicsItem* aParent = 0);
00343 
00347     QRectF rect() const;
00348 
00353     void setRect(const QRectF& aRect); 
00354 
00358     int roundness() const;
00359 
00366     void setRoundness(int aRoundness);
00367 
00369     enum { Type = 10000003 };
00370     virtual ~BpsGraphicsRectItem();
00371     virtual int type() const;
00372     virtual QRectF boundingRect() const;
00373     virtual QPainterPath shape() const;
00374     virtual void paint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, QWidget* aWidget = 0);
00376 
00377 }; // BpsGraphicsRectItem
00378 
00382 class BPSCORE_EXPORT BpsGraphicsBarcodeItem : public QGraphicsItem
00383 {
00384     BPS_PRIVATE(BpsGraphicsBarcodeItem)
00385 
00386 public:
00387 
00392     BpsGraphicsBarcodeItem(QGraphicsItem* aParent = 0);
00393 
00397     QRectF rect() const;
00398 
00403     void setRect(const QRectF& aRect); 
00404 
00408     qreal module() const;
00409 
00414     void setModule(qreal aModule);
00415 
00419     QColor color() const;
00420 
00425     void setColor(const QColor &aColor);
00426 
00430     QString text() const;
00431 
00435     QString codeText() const;
00436 
00440     QString humanText() const;
00441 
00446     void setText(const QString& aText);
00447 
00451     Bps::Barcode barcodeType() const;
00452 
00457     void setBarcodeType(Bps::Barcode aBarcodeType);
00458 
00462     Bps::Direction direction() const;
00463 
00468     void setDirection(Bps::Direction aDirection);
00469 
00470 
00474     QFont font() const;
00475 
00480     void setFont(const QFont& aFont);
00481 
00485     bool textprinted() const;
00486 
00491     void setTextprinted(bool aEnable);
00492 
00494     enum { Type = 10000004 };
00495     virtual ~BpsGraphicsBarcodeItem();
00496     virtual int type() const;
00497     virtual QRectF boundingRect() const;
00498     virtual QPainterPath shape() const;
00499     virtual void paint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, QWidget* aWidget = 0);
00501 
00502 }; // BpsGraphicsBarcodeItem
00503 
00507 class BPSCORE_EXPORT BpsGraphicsPixmapItem : public QGraphicsItem
00508 {
00509     BPS_PRIVATE(BpsGraphicsPixmapItem)
00510 
00511 public:
00512 
00516     enum Sizing { 
00517         SizeFixed,          
00518         SizeFit,            
00519         SizeFill            
00520     };
00521 
00526     BpsGraphicsPixmapItem(QGraphicsItem* aParent = 0);
00527 
00531     QRectF rect() const;
00532 
00537     void setRect(const QRectF& aRect); 
00538 
00542     QPixmap pixmap() const;
00543 
00548     void setPixmap(const QPixmap& aPixmap);
00549 
00553     Sizing sizing() const;
00554 
00559     void setSizing(Sizing aSizing);
00560 
00564     Bps::Alignment alignment() const;
00565 
00570     void setAlignment(Bps::Alignment aAlignment);
00571 
00575     Bps::Rotation rotation() const;
00576 
00581     void setRotation(Bps::Rotation aRotation);
00582 
00586     int ppi() const;
00587 
00592     void setPpi(int aPpi);
00593 
00595     enum { Type = 10000005 };
00596     virtual ~BpsGraphicsPixmapItem();
00597     virtual int type() const;
00598     virtual QRectF boundingRect() const;
00599     virtual QPainterPath shape() const;
00600     virtual void paint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, QWidget* aWidget = 0);
00602 
00603 }; // BpsGraphicsPixmapItem
00604 
00605 #endif // BPSGRAPHICSITEM_H