mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-12 21:10:01 -08:00
* [Cleanup] Unused #includes Took 44 minutes * [Cleanup] More unused #includes Took 55 minutes * [Cleanup] Include QSet Took 4 minutes * [Cleanup] Include QDebug in deck_list.cpp Took 3 minutes * [Cleanup] Include protocol stuff in servatrice_database_interface.h Took 3 minutes * [Cleanup] Include QDialogButtonBox Took 8 minutes * [Cleanup] Include QUrl Took 8 minutes * [Cleanup] Include QTextOption in header. Took 3 minutes * [Cleanup] Include QMap in user_list_manager.h Took 8 minutes * [Cleanup] Adjust qjson Took 8 minutes * [Cleanup] include button box. Took 3 minutes * [Cleanup] Redo fwd declarations. * [Cleanup] Redo last removed fwd declarations. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
/**
|
|
* @file tapped_out_interface.h
|
|
* @ingroup ApiInterfaces
|
|
* @brief TODO: Document this.
|
|
*/
|
|
|
|
#ifndef TAPPEDOUT_INTERFACE_H
|
|
#define TAPPEDOUT_INTERFACE_H
|
|
|
|
#include <libcockatrice/card/database/card_database.h>
|
|
#include <libcockatrice/deck_list/deck_list.h>
|
|
|
|
inline Q_LOGGING_CATEGORY(TappedOutInterfaceLog, "tapped_out_interface");
|
|
|
|
class QByteArray;
|
|
class QNetworkAccessManager;
|
|
class QNetworkReply;
|
|
class DeckList;
|
|
|
|
/**
|
|
* TappedOutInterface exists in order to support the "Analyze on TappedOut" feature.
|
|
* An http POST request is sent and the result is retrieved from the reply. Parsing
|
|
* logic is implemented in TappedOutInterface::queryFinished().
|
|
*/
|
|
|
|
class TappedOutInterface : public QObject
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
QNetworkAccessManager *manager;
|
|
|
|
CardDatabase &cardDatabase;
|
|
void copyDeckSplitMainAndSide(DeckList &source, DeckList &mainboard, DeckList &sideboard);
|
|
private slots:
|
|
void queryFinished(QNetworkReply *reply);
|
|
void getAnalyzeRequestData(DeckList *deck, QByteArray *data);
|
|
|
|
public:
|
|
explicit TappedOutInterface(CardDatabase &_cardDatabase, QObject *parent = nullptr);
|
|
void analyzeDeck(DeckList *deck);
|
|
};
|
|
|
|
#endif
|