added colon emote popup for ffz and bttv

This commit is contained in:
fourtf
2020-08-15 18:59:17 +02:00
parent 6781482485
commit f7237dccdd
26 changed files with 700 additions and 251 deletions
@@ -1,52 +1,10 @@
#pragma once
#include <memory>
#include "widgets/dialogs/switcher/AbstractSwitcherItem.hpp"
#include "widgets/listview/GenericListModel.hpp"
namespace chatterino {
class QuickSwitcherModel : public QAbstractListModel
{
public:
QuickSwitcherModel(QWidget *parent = nullptr);
using QuickSwitcherModel = GenericListModel;
/**
* @brief Reimplements QAbstractItemModel::rowCount.
*
* @return number of items currrently present in this model
*/
int rowCount(const QModelIndex &parent = QModelIndex()) const;
/**
* @brief Reimplements QAbstractItemModel::data. Currently, the role parameter
* is not used and an AbstractSwitcherItem * is always returned.
*
* @param index index of item to fetch data from
* @param role (not used)
*
* @return AbstractSwitcherItem * (wrapped as QVariant) at index
*/
QVariant data(const QModelIndex &index, int role) const;
/**
* @brief Add an item to this QuickSwitcherModel. It will be displayed in
* attached views.
*
* NOTE: The model will take ownership of the pointer. In particular,
* the same item should not be passed to multiple QuickSwitcherModels.
*
* @param item item to add to the model
*/
void addItem(std::unique_ptr<AbstractSwitcherItem> item);
/**
* @brief Clears this QuickSwitcherModel of all items. This will delete all
* AbstractSwitcherItems added after the last invokation of
* QuickSwitcherModel::clear (and invalidate their pointers).
*/
void clear();
private:
std::vector<std::unique_ptr<AbstractSwitcherItem>> items_;
};
} // namespace chatterino
}