Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfJump.h
Context not available. | |||||
28 | #include "AcbfPage.h" | 28 | #include "AcbfPage.h" | ||
---|---|---|---|---|---|
29 | 29 | | |||
30 | #include <QPoint> | 30 | #include <QPoint> | ||
31 | #include <QRect> | ||||
31 | namespace AdvancedComicBookFormat | 32 | namespace AdvancedComicBookFormat | ||
32 | { | 33 | { | ||
33 | /** | 34 | /** | ||
Context not available. | |||||
48 | class ACBF_EXPORT Jump : public QObject | 49 | class ACBF_EXPORT Jump : public QObject | ||
49 | { | 50 | { | ||
50 | Q_OBJECT | 51 | Q_OBJECT | ||
52 | Q_PROPERTY(int pointCount READ pointCount NOTIFY pointCountChanged) | ||||
53 | Q_PROPERTY(QRect bounds READ bounds NOTIFY boundsChanged) | ||||
54 | Q_PROPERTY(int pageIndex READ pageIndex WRITE setPageIndex NOTIFY pageIndexChanged) | ||||
51 | 55 | | |||
52 | public: | 56 | public: | ||
53 | explicit Jump(Page* parent = nullptr); | 57 | explicit Jump(Page* parent = nullptr); | ||
Context not available. | |||||
71 | * @param index - the index of the desired point. | 75 | * @param index - the index of the desired point. | ||
72 | * @return a point for an index. | 76 | * @return a point for an index. | ||
73 | */ | 77 | */ | ||
74 | QPoint point(int index) const; | 78 | Q_INVOKABLE QPoint point(int index) const; | ||
75 | /** | 79 | /** | ||
76 | * @param point - a point from the points list. | 80 | * @param point - a point from the points list. | ||
77 | * @return the index of the given point. | 81 | * @return the index of the given point. | ||
78 | */ | 82 | */ | ||
79 | int pointIndex(const QPoint& point) const; | 83 | Q_INVOKABLE int pointIndex(const QPoint& point) const; | ||
80 | 84 | | |||
81 | /** | 85 | /** | ||
82 | * \brief add a point to the points list. | 86 | * \brief add a point to the points list. | ||
Context not available. | |||||
84 | * @param index - the index to add it at. If afterIndex is larger than zero, | 88 | * @param index - the index to add it at. If afterIndex is larger than zero, | ||
85 | * the insertion will happen at that index | 89 | * the insertion will happen at that index | ||
86 | */ | 90 | */ | ||
87 | void addPoint(const QPoint& point, int index = -1); | 91 | Q_INVOKABLE void addPoint(const QPoint& point, int index = -1); | ||
88 | /** | 92 | /** | ||
89 | * \brief remove a point from the list. | 93 | * \brief remove a point from the list. | ||
90 | * @param point - point to remove from the list. | 94 | * @param point - point to remove from the list. | ||
91 | */ | 95 | */ | ||
92 | void removePoint(const QPoint& point); | 96 | Q_INVOKABLE void removePoint(const QPoint& point); | ||
93 | /** | 97 | /** | ||
94 | * \brief Swap two points in the list. | 98 | * \brief Swap two points in the list. | ||
95 | * @param swapThis - the first points to swap. | 99 | * @param swapThis - the first points to swap. | ||
96 | * @param withThis - the second points to swap. | 100 | * @param withThis - the second points to swap. | ||
97 | */ | 101 | */ | ||
98 | bool swapPoints(const QPoint& swapThis, const QPoint& withThis); | 102 | bool swapPoints(const QPoint& swapThis, const QPoint& withThis); | ||
99 | 103 | /** | |||
104 | * @brief set the points based on a top left and bottom right. | ||||
105 | * @param topLeft the topleft corner of the rect. | ||||
106 | * @param bottomRight the bottomright corner of the rect. | ||||
107 | */ | ||||
108 | Q_INVOKABLE void setPointsFromRect(const QPoint& topLeft, const QPoint& bottomRight); | ||||
109 | | ||||
110 | int pointCount() const; | ||||
111 | /** | ||||
112 | * @brief fires when the point counts changes. | ||||
113 | */ | ||||
114 | Q_SIGNAL void pointCountChanged(); | ||||
115 | /** | ||||
116 | * @brief convenience function to get the ractangle of the points. | ||||
117 | * @return the bounds of the frame. | ||||
118 | */ | ||||
119 | QRect bounds() const; | ||||
120 | /** | ||||
121 | * @brief fires when the bounds change, which happens when the point count changes. | ||||
122 | */ | ||||
123 | Q_SIGNAL void boundsChanged(); | ||||
100 | /** | 124 | /** | ||
101 | * @brief The page to jump to. | 125 | * @brief The page to jump to. | ||
102 | * | 126 | * | ||
Context not available. | |||||
111 | * page list. | 135 | * page list. | ||
112 | */ | 136 | */ | ||
113 | void setPageIndex(const int& pageNumber = 0); | 137 | void setPageIndex(const int& pageNumber = 0); | ||
138 | /** | ||||
139 | * @brief pageIndexChanged | ||||
140 | */ | ||||
141 | Q_SIGNAL void pageIndexChanged(); | ||||
114 | 142 | | |||
115 | private: | 143 | private: | ||
116 | class Private; | 144 | class Private; | ||
Context not available. |