1
0
forked from BRT/arc
arc/models/android/xml/Node.h
trnsmkot 0a31b4d717 Implement Event Type Handling and Status Updates
Added handling for event types (Balance, Phone) and respective processing logic in EventHandler. Introduced support for tracking and updating event statuses both locally and through network APIs. Enhanced data integrity and clarity by expanding the EventInfo model and associated database management.
2025-06-03 22:02:29 +07:00

48 lines
950 B
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 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;
bool clickable = false;
bool focusable = false;
private:
int m_x1 = -1, m_y1 = -1, m_x2 = -1, m_y2 = -1;
};