summaryrefslogtreecommitdiffstats
path: root/kbarcode/tcanvasitem.h
diff options
context:
space:
mode:
Diffstat (limited to 'kbarcode/tcanvasitem.h')
-rw-r--r--kbarcode/tcanvasitem.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/kbarcode/tcanvasitem.h b/kbarcode/tcanvasitem.h
new file mode 100644
index 0000000..7493fa8
--- /dev/null
+++ b/kbarcode/tcanvasitem.h
@@ -0,0 +1,57 @@
+
+#ifndef TCANVASITEM_H
+#define TCANVASITEM_H
+#include <qstring.h>
+#include <qcanvas.h>
+
+#include "documentitem.h"
+#include "referencecounted.h"
+
+class MyCanvasView;
+/**
+ * Class TCanvasItem
+ * Represents a DocumentItem on a QCanvas.
+ * This class is also responsible for drawing
+ * the drag marks provided by SpotProvider.
+ *
+ * The class is also ReferenceCounted!!!
+ */
+class TCanvasItem : public QCanvasRectangle, public ReferenceCounted {
+public:
+
+ TCanvasItem ( MyCanvasView* cv );
+ ~TCanvasItem ( );
+
+ void update();
+
+ int rtti() const;
+
+ void setZ( double z );
+ void moveBy( double x, double y );
+ void setSize( int width, int height );
+
+ void moveMM( int x, int y );
+ void moveByMM( int x, int y );
+ void setSizeMM( int w, int h );
+
+ void show();
+ void hide();
+
+ void setItem (DocumentItem* item);
+ DocumentItem* item () const;
+
+ MyCanvasView* canvasView() const;
+
+protected:
+ /**
+ *
+ * @param painter
+ */
+ void drawShape ( QPainter & p );
+
+private:
+ DocumentItem* m_item;
+ MyCanvasView* m_view;
+};
+#endif //TCANVASITEM_H
+