Implemented `PayByCardScript` to enable automated card payments on the Ozon platform. Includes ad banner detection/handling, OCR-based transaction ID extraction, fee calculation, and database updates for transactions. Added XML asset `pay_by_card_success.xml` for payment result handling.
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <QString>
|
|
|
|
class Node {
|
|
public:
|
|
Node() = default;
|
|
|
|
void setBounds(const int x1, const int y1, const int x2, const int y2) {
|
|
m_x1 = x1;
|
|
m_y1 = y1;
|
|
m_x2 = x2;
|
|
m_y2 = y2;
|
|
}
|
|
|
|
bool isEmpty() {
|
|
return m_x1 < 0 && m_y1 < 0 && m_x2 < 0 && m_y2 < 0 && text.isEmpty() && className.isEmpty();
|
|
}
|
|
|
|
/**
|
|
* const int x = (x1() + x2()) / 2;
|
|
* const int y = (y1() + y2()) / 2;
|
|
*/
|
|
[[nodiscard]] int width() const { return m_x2 - m_x1; }
|
|
[[nodiscard]] int height() const { return m_y2 - m_y1; }
|
|
|
|
[[nodiscard]] int x() const {
|
|
if (m_x1 < 0) {
|
|
return -1;
|
|
}
|
|
return m_x1 + (m_x2 - m_x1) / 2;
|
|
}
|
|
|
|
[[nodiscard]] int y() const {
|
|
if (m_y1 < 0) {
|
|
return -1;
|
|
}
|
|
return m_y1 + (m_y2 - m_y1) / 2;
|
|
}
|
|
|
|
QString text;
|
|
QString contentDesc;
|
|
QString resourceId;
|
|
QString className;
|
|
QString hint;
|
|
bool clickable = false;
|
|
bool focusable = false;
|
|
|
|
private:
|
|
int m_x1 = -1, m_y1 = -1, m_x2 = -1, m_y2 = -1;
|
|
};
|