13#include <QLoggingCategory>
18#include <qtmetamacros.h>
26template <
typename T>
class QList;
90 static std::optional<LoadedDeck>
99 static std::optional<LoadedDeck>
loadFromRemote(
const QString &nativeString,
int remoteDeckId);
108 static std::optional<LoadedDeck::LoadInfo>
130 static void saveToClipboard(
const DeckList &deckList,
bool addComments =
true,
bool addSetNameAndNumber =
true);
133 bool addComments =
true,
134 bool addSetNameAndNumber =
true);
171 bool addComments =
true,
172 bool addSetNameAndNumber =
true,
173 const QString &boardZoneName = QString());
176 bool addComments =
true,
177 bool addSetNameAndNumber =
true,
178 const QString &boardZoneName = QString());
Represents a complete deck, including metadata, zones, cards, and sideboard plans.
Definition deck_list.h:67
static void saveToStream_DeckZone(QTextStream &out, const InnerDecklistNode *zoneNode, bool addComments=true, bool addSetNameAndNumber=true, const QString &boardZoneName=QString())
Definition deck_loader.cpp:400
static std::optional< LoadedDeck > loadFromRemote(const QString &nativeString, int remoteDeckId)
Loads a deck from the response of a remote deck request.
Definition deck_loader.cpp:137
void loadFromFileAsync(const QString &fileName, DeckFileFormat::Format fmt, bool userRequest)
Asynchronously loads a deck from a local file into this DeckLoader. The loadFinished signal will be e...
Definition deck_loader.cpp:110
static void printDeckList(QPrinter *printer, const DeckList &deckList)
Prints the decklist to the provided QPrinter.
Definition deck_loader.cpp:639
static std::optional< LoadedDeck > loadFromFile(const QString &fileName, DeckFileFormat::Format fmt, bool userRequest=false)
Loads a deck from a local file.
Definition deck_loader.cpp:60
bool hasNotBeenLoaded() const
Definition deck_loader.h:61
const LoadedDeck & getDeck() const
Definition deck_loader.h:155
static void saveToStream_DeckHeader(QTextStream &out, const DeckList &deckList)
Definition deck_loader.cpp:385
static bool saveToNewFile(LoadedDeck &deck, const QString &fileName, DeckFileFormat::Format fmt)
Saves a LoadedDeck to a new local file.
Definition deck_loader.cpp:200
static const QStringList ACCEPTED_FILE_EXTENSIONS
Definition deck_loader.h:50
static bool convertToCockatriceFormat(LoadedDeck &deck)
Definition deck_loader.cpp:501
static void saveToStream_DeckZoneCards(QTextStream &out, QList< DecklistCardNode * > cards, bool addComments=true, bool addSetNameAndNumber=true, const QString &boardZoneName=QString())
Definition deck_loader.cpp:469
void setDeck(const LoadedDeck &deck)
Definition deck_loader.h:159
DeckLoader(QObject *parent)
Definition deck_loader.cpp:55
void loadFinished(bool success)
static void printDeckListNode(QTextCursor *cursor, const InnerDecklistNode *node)
Definition deck_loader.cpp:558
LoadedDeck & getDeck()
Definition deck_loader.h:151
static QString exportDeckToDecklist(const DeckList &deckList, DecklistWebsite website)
Definition deck_loader.cpp:333
DeckLoader & operator=(const DeckLoader &)=delete
static void saveToClipboard(const DeckList &deckList, bool addComments=true, bool addSetNameAndNumber=true)
Definition deck_loader.cpp:356
static bool updateLastLoadedTimestamp(LoadedDeck &deck)
Updates the lastLoadedTimestamp field in the file corresponding to the deck, without changing the Fil...
Definition deck_loader.cpp:215
DeckLoader(const DeckLoader &)=delete
static std::optional< LoadedDeck::LoadInfo > saveToFile(const DeckList &deck, const QString &fileName, DeckFileFormat::Format fmt)
Saves a DeckList to a local file.
Definition deck_loader.cpp:156
bool reload()
Loads the file that the lastLoadInfo currently points to into this instance. No-ops if the lastLoadIn...
Definition deck_loader.cpp:121
LoadedDeck loadedDeck
Definition deck_loader.h:54
DecklistWebsite
Definition deck_loader.h:48
@ DecklistOrg
Definition deck_loader.h:49
@ DecklistXyz
Definition deck_loader.h:50
static const QStringList FILE_NAME_FILTERS
Definition deck_loader.h:52
static bool saveToStream_Plain(QTextStream &out, const DeckList &deckList, bool addComments=true, bool addSetNameAndNumber=true)
Definition deck_loader.cpp:365
Concrete node type representing an actual card entry in the deck.
Definition deck_list_card_node.h:52
Represents a container node in the deck list hierarchy (zones and groupings).
Definition inner_deck_list_node.h:73
Definition remote_connection_controller.h:20
Q_LOGGING_CATEGORY(CrashReportLog, "crash_report")
bool isEmpty() const
Definition loaded_deck.cpp:3
Represents a deck that was loaded from somewhere. Contains the DeckList itself, as well as info about...
Definition loaded_deck.h:14
LoadInfo lastLoadInfo
info about where the deck was loaded from
Definition loaded_deck.h:34