6#ifndef REMOTE_PUBLIC_DECKS_MODEL_H
7#define REMOTE_PUBLIC_DECKS_MODEL_H
11#include <QAbstractListModel>
19#include <qnamespace.h>
20#include <qtmetamacros.h>
65 [[nodiscard]]
int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
66 [[nodiscard]] QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
69 void refresh(
const QString &userName);
102 [[nodiscard]] DeckEntry
entryAt(
int row)
const;
Definition abstract_client.h:73
Definition remote_connection_controller.h:20
Definition dlg_manage_sets.h:29
int totalCount() const
The number of decks before filtering.
Definition remote_public_decks_model.h:91
QSet< QString > includedTags
Definition remote_public_decks_model.h:131
AbstractClient * client
Definition remote_public_decks_model.h:121
int requestSequence
Monotonically increases per refresh; only the newest request may update the grid.
Definition remote_public_decks_model.h:126
void refresh(const QString &userName)
Fetches the public decks of another user, replacing the current contents.
Definition remote_public_decks_model.cpp:135
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition remote_public_decks_model.cpp:46
void setLoading(bool value)
Definition remote_public_decks_model.cpp:172
void loadingChanged(bool loading)
Emitted when a refresh starts, completes, or fails (see loading()).
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition remote_public_decks_model.cpp:41
QSet< QString > excludedTags
Definition remote_public_decks_model.h:132
QList< int > visibleIndices
Row indices into decks that pass the current filters.
Definition remote_public_decks_model.h:124
void setColorFilter(FilterMode mode, const QSet< QChar > &colors)
Sets the active color identity filter and mode.
Definition remote_public_decks_model.cpp:71
RemotePublicDecksModel(AbstractClient *client, QObject *parent=nullptr)
Definition remote_public_decks_model.cpp:21
void addTreeItem(const ServerInfo_DeckStorage_TreeItem &item)
Definition remote_public_decks_model.cpp:205
VisualDeckStorageSortFilterProxyModel::FilterMode colorFilterMode
Definition remote_public_decks_model.h:129
bool isLoading() const
True while a refresh request is in flight and the grid has no data yet.
Definition remote_public_decks_model.h:97
void onLoadingTimeout()
Definition remote_public_decks_model.cpp:160
QTimer * loadingTimeoutTimer
Definition remote_public_decks_model.h:122
bool loading
Definition remote_public_decks_model.h:125
void setTagFilter(const QSet< QString > &selected, const QSet< QString > &excluded)
Filters decks by required (selected) and forbidden (excluded) tags.
Definition remote_public_decks_model.cpp:79
QList< DeckEntry > decks
Definition remote_public_decks_model.h:123
void clear()
Definition remote_public_decks_model.cpp:166
int filteredCount() const
The number of decks after filtering.
Definition remote_public_decks_model.h:85
VisualDeckStorageSortFilterProxyModel::FilterMode FilterMode
The color identity filter mode, shared with the Visual Deck Storage.
Definition remote_public_decks_model.h:61
void rebuildVisibleIndices()
Definition remote_public_decks_model.cpp:95
QSet< QString > allTags() const
All tags present across all loaded decks, for building filter chips.
Definition remote_public_decks_model.cpp:86
DeckEntry entryAt(int row) const
Definition remote_public_decks_model.cpp:57
QSet< QChar > activeColors
Definition remote_public_decks_model.h:130
QString searchText
Definition remote_public_decks_model.h:128
void setSearchText(const QString &text)
Sets a case-insensitive substring filter on the deck name.
Definition remote_public_decks_model.cpp:65
void decksReceived(const Response &response, const CommandContainer &commandContainer)
Definition remote_public_decks_model.cpp:181
void loadFailed(const QString &message)
Emitted when the last refresh failed; contains a user-facing message.
void addFolder(const ServerInfo_DeckStorage_Folder &folder)
Definition remote_public_decks_model.cpp:197
FilterMode
How the color identity filter is applied.
Definition visual_deck_storage_sort_filter_proxy_model.h:49
@ Includes
Definition visual_deck_storage_sort_filter_proxy_model.h:51
Definition commands.proto:8
Definition remote_public_decks_model.h:48
QStringList tags
Definition remote_public_decks_model.h:55
QString bannerCardName
Definition remote_public_decks_model.h:52
QString bannerCardProvider
Definition remote_public_decks_model.h:53
QString name
Definition remote_public_decks_model.h:50
QString colorIdentity
Definition remote_public_decks_model.h:54
QDateTime uploadTime
Definition remote_public_decks_model.h:51
Definition response.proto:11
Definition serverinfo_deckstorage.proto:17
Definition serverinfo_deckstorage.proto:21
Sorting and filtering proxy on top of VisualDeckStorageModel.