Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfFrame.h
Context not available. | |||||
28 | #include "AcbfPage.h" | 28 | #include "AcbfPage.h" | ||
---|---|---|---|---|---|
29 | 29 | | |||
30 | #include <QPoint> | 30 | #include <QPoint> | ||
31 | #include <QRect> | ||||
31 | /** | 32 | /** | ||
32 | * \brief a Class to handle comic panels. | 33 | * \brief a Class to handle comic panels. | ||
33 | * | 34 | * | ||
Context not available. | |||||
46 | class ACBF_EXPORT Frame : public QObject | 47 | class ACBF_EXPORT Frame : public QObject | ||
47 | { | 48 | { | ||
48 | Q_OBJECT | 49 | Q_OBJECT | ||
49 | 50 | Q_PROPERTY(QString bgcolor READ bgcolor WRITE setBgcolor NOTIFY bgcolorChanged) | |||
51 | Q_PROPERTY(int pointCount READ pointCount NOTIFY pointCountChanged) | ||||
52 | Q_PROPERTY(QRect bounds READ bounds NOTIFY boundsChanged) | ||||
50 | public: | 53 | public: | ||
51 | explicit Frame(Page* parent = nullptr); | 54 | explicit Frame(Page* parent = nullptr); | ||
52 | ~Frame() override; | 55 | ~Frame() override; | ||
Context not available. | |||||
69 | * @param index - the index of the desired point. | 72 | * @param index - the index of the desired point. | ||
70 | * @return a point for an index. | 73 | * @return a point for an index. | ||
71 | */ | 74 | */ | ||
72 | QPoint point(int index) const; | 75 | Q_INVOKABLE QPoint point(int index) const; | ||
73 | /** | 76 | /** | ||
74 | * @param point - a point from the points list. | 77 | * @param point - a point from the points list. | ||
75 | * @return the index of the given point. | 78 | * @return the index of the given point. | ||
76 | */ | 79 | */ | ||
77 | int pointIndex(const QPoint& point) const; | 80 | Q_INVOKABLE int pointIndex(const QPoint& point) const; | ||
78 | 81 | | |||
79 | /** | 82 | /** | ||
80 | * \brief add a point to the points list. | 83 | * \brief add a point to the points list. | ||
Context not available. | |||||
82 | * @param index - the index to add it at. If afterIndex is larger than zero, | 85 | * @param index - the index to add it at. If afterIndex is larger than zero, | ||
83 | * the insertion will happen at that index | 86 | * the insertion will happen at that index | ||
84 | */ | 87 | */ | ||
85 | void addPoint(const QPoint& point, int index = -1); | 88 | Q_INVOKABLE void addPoint(const QPoint& point, int index = -1); | ||
86 | /** | 89 | /** | ||
87 | * \brief remove a point from the list. | 90 | * \brief remove a point from the list. | ||
88 | * @param point - point to remove from the list. | 91 | * @param point - point to remove from the list. | ||
89 | */ | 92 | */ | ||
90 | void removePoint(const QPoint& point); | 93 | Q_INVOKABLE void removePoint(const QPoint& point); | ||
91 | /** | 94 | /** | ||
92 | * \brief Swap two points in the list. | 95 | * \brief Swap two points in the list. | ||
93 | * @param swapThis - the first points to swap. | 96 | * @param swapThis - the first points to swap. | ||
94 | * @param withThis - the second points to swap. | 97 | * @param withThis - the second points to swap. | ||
95 | */ | 98 | */ | ||
96 | bool swapPoints(const QPoint& swapThis, const QPoint& withThis); | 99 | bool swapPoints(const QPoint& swapThis, const QPoint& withThis); | ||
100 | /** | ||||
101 | * @brief set the points based on a top left and bottom right. | ||||
102 | * @param topLeft the topleft corner of the rect. | ||||
103 | * @param bottomRight the bottomright corner of the rect. | ||||
104 | */ | ||||
105 | Q_INVOKABLE void setPointsFromRect(const QPoint& topLeft, const QPoint& bottomRight); | ||||
106 | | ||||
107 | int pointCount() const; | ||||
108 | /** | ||||
109 | * @brief fires when the point counts changes. | ||||
110 | */ | ||||
111 | Q_SIGNAL void pointCountChanged(); | ||||
112 | /** | ||||
113 | * @brief convenience function to get the ractangle of the points. | ||||
114 | * @return the bounds of the frame. | ||||
115 | */ | ||||
116 | QRect bounds() const; | ||||
117 | /** | ||||
118 | * @brief fires when the bounds change, which happens when the point count changes. | ||||
119 | */ | ||||
120 | Q_SIGNAL void boundsChanged(); | ||||
97 | /** | 121 | /** | ||
98 | * @return the background color as a QString. | 122 | * @return the background color as a QString. | ||
99 | * | 123 | * | ||
Context not available. | |||||
106 | * @param newColor - a String with an 8bit per channel rgb hexcode (#ff00ff, or the like) | 130 | * @param newColor - a String with an 8bit per channel rgb hexcode (#ff00ff, or the like) | ||
107 | */ | 131 | */ | ||
108 | void setBgcolor(const QString& newColor = QString()); | 132 | void setBgcolor(const QString& newColor = QString()); | ||
133 | /** | ||||
134 | * @brief fires when the background color changes. | ||||
135 | */ | ||||
136 | Q_SIGNAL void bgcolorChanged(); | ||||
109 | 137 | | |||
110 | private: | 138 | private: | ||
111 | class Private; | 139 | class Private; | ||
Context not available. |