#ifndef XMLPARSER_H
#define XMLPARSER_H

#include <QObject>
#include <QXmlStreamReader>
#include <QList>
#include "auto_payment/UiElement.h"

class XmlParser final : public QObject
{
    Q_OBJECT
public:
    explicit XmlParser(QObject *parent = nullptr);

    static QList<UiElement> parseUiDumpUsingQXml(const QString &filepath);
    static bool isSecurityBanner(const QList<UiElement>& elements);
    static bool isPinCodeScreen(const QList<UiElement>& elements);
    static bool isBannerOrDialog(const QList<UiElement>& elements);
    static bool isMainScreen(const QList<UiElement>& elements);
    static bool isDetailCardScreen(const QList<UiElement>& elements);
private:
    static QList<UiElement> extractElementsFromXml(QXmlStreamReader &xmlReader);
};

#endif // XMLPARSER_H
