69 lines
1.4 KiB
C++
69 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include "ScreenXmlTossParser.h"
|
|
#include "android/xml/Node.h"
|
|
#include "db/AccountInfo.h"
|
|
#include "db/TransactionInfo.h"
|
|
|
|
class CommonTossScript : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CommonTossScript(QObject *parent = nullptr);
|
|
|
|
~CommonTossScript() override;
|
|
|
|
protected:
|
|
virtual void doStart() = 0;
|
|
|
|
bool goToAllProducts(
|
|
const QString &deviceId,
|
|
int width,
|
|
int height
|
|
);
|
|
|
|
void postAccountsData(const QList<AccountInfo> &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 m_running = true;
|
|
ScreenXmlTossParser 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(CommonTossScript);
|
|
};
|