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