Menu

[efa3d9]: / src / frame-container.h  Maximize  Restore  History

Download this file

76 lines (63 with data), 1.8 kB

 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef FRAME_CONTAINER_H
#define FRAME_CONTAINER_H
#include "container.h"
#include "xmlobj.h"
#include <QPen>
/*! \brief This class adds a frame to a Container.
*/
class BranchContainer;
class FrameContainer : public XMLObj, public Container {
public:
/*! \brief Supported frame types */
enum FrameType {
NoFrame,
Rectangle,
RoundedRectangle,
Pipe,
Ellipse,
Circle,
Cloud
};
/*! When saving, save also the usage */
enum FrameUsage {Undefined, InnerFrame, OuterFrame};
FrameContainer();
~FrameContainer();
void init();
void clear();
void repaint();
virtual void reposition();
// Interfaces
FrameType frameType();
static FrameType frameTypeFromString(const QString &);
static QString frameTypeString(int);
QString frameTypeString();
void setFrameType(const FrameType &);
void setFrameType(const QString &);
private:
void updateGeometry(const QRectF &);
public:
int framePadding();
void setFramePadding(const int &);
int framePenWidth();
void setFramePenWidth(const int &);
QColor framePenColor();
void setFramePenColor(const QColor&);
QColor frameBrushColor();
void setFrameBrushColor(const QColor &);
void setParentBranchContainer(BranchContainer *pbc); //! ask BranchContainer about autodesign when saving
void setUsage(FrameUsage u);
QString saveFrame();
protected:
BranchContainer *parentBranchContainer;
FrameType frameTypeInt; //! Frame type
int framePaddingInt; //! Distance text - frame
QPen framePen;
QBrush frameBrush;
private:
QGraphicsRectItem *rectFrame;
QGraphicsEllipseItem *ellipseFrame;
QGraphicsPathItem *pathFrame;
QRectF contentRect;
FrameUsage usage;
};
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.