mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
3bf111a091
There are missing parts to the "account-based" emotes that needs to be completed before emote completion can be considered done. For now, when I've been testing, I've been manually injecting the oauthClient and oauthToken to the settings file with the `user_subscriptions` scope
48 lines
969 B
C++
48 lines
969 B
C++
#pragma once
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QVector>
|
|
|
|
#include <string>
|
|
|
|
namespace chatterino {
|
|
|
|
class EmoteManager;
|
|
|
|
class CompletionModel : public QAbstractListModel
|
|
{
|
|
public:
|
|
virtual int columnCount(const QModelIndex & /*parent*/) const override
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
virtual QVariant data(const QModelIndex &index, int role) const override
|
|
{
|
|
// TODO: Implement more safely
|
|
return QVariant(this->emotes.at(index.row()));
|
|
}
|
|
|
|
virtual int rowCount(const QModelIndex &parent) const override
|
|
{
|
|
return this->emotes.size();
|
|
}
|
|
|
|
QVector<QString> emotes;
|
|
};
|
|
|
|
class CompletionManager
|
|
{
|
|
CompletionManager(EmoteManager &_emoteManager);
|
|
|
|
EmoteManager &emoteManager;
|
|
|
|
public:
|
|
CompletionModel *createModel(const std::string &channelName);
|
|
void updateModel(CompletionModel *model, const std::string &channelName = std::string());
|
|
|
|
friend class Application;
|
|
};
|
|
|
|
} // namespace chatterino
|