mirror-chatterino2/src/widgets/dialogs/EmotePopup.hpp

52 lines
1.2 KiB
C++
Raw Normal View History

2017-09-15 17:23:49 +02:00
#pragma once
#include "providers/twitch/TwitchChannel.hpp"
#include "widgets/BasePopup.hpp"
#include "widgets/Notebook.hpp"
2017-09-15 17:23:49 +02:00
2018-01-24 20:58:53 +01:00
#include <pajlada/signals/signal.hpp>
#include <QLineEdit>
2017-09-15 17:23:49 +02:00
namespace chatterino {
2018-09-30 19:15:17 +02:00
struct Link;
class ChannelView;
class Channel;
using ChannelPtr = std::shared_ptr<Channel>;
class EmotePopup : public BasePopup
2017-09-15 17:23:49 +02:00
{
public:
2019-08-13 16:39:22 +02:00
EmotePopup(QWidget *parent = nullptr);
2017-09-15 17:23:49 +02:00
void loadChannel(ChannelPtr channel);
void closeEvent(QCloseEvent *event) override;
pajlada::Signals::Signal<Link> linkClicked;
2018-01-24 20:58:53 +01:00
private:
2018-08-11 14:20:53 +02:00
ChannelView *globalEmotesView_{};
ChannelView *channelEmotesView_{};
ChannelView *subEmotesView_{};
ChannelView *viewEmojis_{};
/**
* @brief Visible only when the user has specified a search query into the `search_` input.
* Otherwise the `notebook_` and all other views are visible.
*/
ChannelView *searchView_{};
ChannelPtr channel_;
TwitchChannel *twitchChannel_{};
QLineEdit *search_;
Notebook *notebook_;
void filterTwitchEmotes(std::shared_ptr<Channel> searchChannel,
const QString &searchText);
void filterEmotes(const QString &text);
void addShortcuts() override;
2017-09-15 17:23:49 +02:00
};
2017-12-17 02:10:35 +01:00
} // namespace chatterino