]> git.sven.stormbind.net Git - sven/vym.git/blob - frameobj.h
Import Upstream version 2.6.11
[sven/vym.git] / frameobj.h
1 #ifndef FRAMEOBJ_H
2 #define FRAMEOBJ_H
3
4 #include "mapobj.h"
5
6
7 /*! \brief This class adds a frame to a MapObj. 
8 */
9
10 class FrameObj:public MapObj {
11 public:
12
13     /*! \brief Supported frame types */
14     enum FrameType {NoFrame,Rectangle,RoundedRectangle,Ellipse,Cloud};
15
16     FrameObj(QGraphicsItem *parent);
17     ~FrameObj();
18     void init();
19     void clear();
20     void move (double x,double y);  // move to absolute Position
21     void moveBy (double x,double y);// move to relative Position
22     void positionBBox();             
23     void calcBBoxSize();            
24     void setRect (const QRectF &);   // set dimensions          
25     void setPadding(const int &);
26     int getPadding();
27     qreal getTotalPadding();         // padding + borderwidth + xsize (e.g. cloud)
28     qreal getXPadding();
29     void setBorderWidth (const int &);
30     int getBorderWidth ();
31     FrameType getFrameType ();
32     FrameType getFrameType (const QString &);
33     QString getFrameTypeName ();
34     void setFrameType (const FrameType &);
35     void setFrameType (const QString &);
36     void setPenColor (QColor);
37     QColor getPenColor ();
38     void setBrushColor (QColor);
39     QColor getBrushColor ();
40     void setFrameIncludeChildren(bool);
41     bool getFrameIncludeChildren();
42     void repaint();
43     void setZValue (double z);
44     void setVisibility(bool);
45     QString saveToDir ();
46
47 private:
48     FrameType type;         //!< Frame type
49     QGraphicsRectItem * rectFrame;
50     QGraphicsEllipseItem * ellipseFrame;
51     QGraphicsPathItem *pathFrame;
52     int padding;            // distance text - frame
53     int borderWidth;
54     qreal xsize;            //! Extra size caused e.g. by cloud geometry
55     QColor penColor;
56     QColor brushColor;
57     bool includeChildren;
58 };
59 #endif
60