summaryrefslogtreecommitdiffstats
path: root/kbarcode/tcanvasitem.h
blob: 811c1be2bbf8994a674824e79d53872a0a053fb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

#ifndef TCANVASITEM_H
#define TCANVASITEM_H
#include <tqstring.h>
#include <tqcanvas.h>

#include "documentitem.h"
#include "referencecounted.h"

class MyCanvasView;
/**
 * Class TCanvasItem
 * Represents a DocumentItem on a TQCanvas. 
 * This class is also responsible for drawing 
 * the drag marks provided by SpotProvider.
 *
 * The class is also ReferenceCounted!!!
 */
class TCanvasItem : public TQCanvasRectangle, 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 ( TQPainter & p );

private:
    DocumentItem* m_item;
    MyCanvasView* m_view;
};
#endif //TCANVASITEM_H