Introduce a new class, `ScreenXmlZiraatParser`, to handle Ziraat-related XML parsing. This includes functionality to extract transaction details, banners/dialogs recognition, and history parsing for today and yesterday. Regular expressions are utilized for precise data extraction.
74 lines
1.6 KiB
C++
74 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include "ScreenXmlZiraatParser.h"
|
|
|
|
class CommonZiraatScript : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CommonZiraatScript(QObject *parent = nullptr);
|
|
|
|
~CommonZiraatScript() override;
|
|
|
|
protected:
|
|
virtual void doStart() = 0;
|
|
|
|
static bool inputPinCode(const QString &deviceId, const QList<Node> &pincode);
|
|
|
|
bool goToAllProducts(
|
|
const QString &deviceId,
|
|
int width,
|
|
int height
|
|
);
|
|
|
|
bool findAndTapOnAccount(const QString &deviceId, const QString &accountNumbers);
|
|
|
|
void postAccountsData(const QList<QPair<AccountInfo, Node> > &accounts);
|
|
|
|
void postNewTransactionData(const AccountInfo &account, const TransactionInfo &transaction);
|
|
|
|
void updateTransactionData(
|
|
const AccountInfo &account,
|
|
int transactionId,
|
|
TransactionStatus status,
|
|
const QString &oldDesc,
|
|
const QString &newDesc
|
|
);
|
|
|
|
Node swipeToButton(
|
|
const QString &deviceId,
|
|
const QString &text,
|
|
int &counter, int width, int height
|
|
);
|
|
|
|
bool runAppAndGoToHomeScreen(
|
|
const QString &deviceId,
|
|
const QString &packageName,
|
|
const QString &pinCode,
|
|
int width,
|
|
int height
|
|
);
|
|
|
|
bool tryToCloseAllBannersOnHomePage(
|
|
const QString &deviceId, int width, int height
|
|
);
|
|
|
|
bool m_running = true;
|
|
ScreenXmlZiraatParser xmlScreenParser;
|
|
int m_counter = 0;
|
|
|
|
signals:
|
|
void finished();
|
|
|
|
void finishedWithResult(const QString &result);
|
|
|
|
public slots:
|
|
virtual void start() final;
|
|
|
|
virtual void stop() final;
|
|
|
|
private:
|
|
Q_DISABLE_COPY(CommonZiraatScript);
|
|
};
|