2017-09-15 17:23:49 +02:00
|
|
|
#pragma once
|
|
|
|
|
2019-12-14 12:57:40 +01:00
|
|
|
#include "widgets/BasePopup.hpp"
|
2017-09-15 17:23:49 +02:00
|
|
|
|
2018-01-24 20:58:53 +01:00
|
|
|
#include <pajlada/signals/signal.hpp>
|
2022-01-02 15:59:16 +01:00
|
|
|
#include <QLineEdit>
|
|
|
|
|
2017-09-15 17:23:49 +02:00
|
|
|
namespace chatterino {
|
|
|
|
|
2018-09-30 19:15:17 +02:00
|
|
|
struct Link;
|
2018-08-11 22:23:06 +02:00
|
|
|
class ChannelView;
|
|
|
|
class Channel;
|
|
|
|
using ChannelPtr = std::shared_ptr<Channel>;
|
2022-12-31 15:41:01 +01:00
|
|
|
class Notebook;
|
|
|
|
class TwitchChannel;
|
2018-08-11 22:23:06 +02:00
|
|
|
|
2019-12-14 12:57:40 +01:00
|
|
|
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
|
|
|
|
2018-01-24 13:15:41 +01:00
|
|
|
void loadChannel(ChannelPtr channel);
|
2017-09-16 00:05:06 +02:00
|
|
|
|
2022-12-17 18:33:17 +01:00
|
|
|
void closeEvent(QCloseEvent *event) override;
|
2020-04-13 13:15:51 +02:00
|
|
|
|
2018-06-28 19:38:57 +02:00
|
|
|
pajlada::Signals::Signal<Link> linkClicked;
|
2018-01-24 20:58:53 +01:00
|
|
|
|
2017-09-16 00:05:06 +02:00
|
|
|
private:
|
2018-08-11 14:20:53 +02:00
|
|
|
ChannelView *globalEmotesView_{};
|
|
|
|
ChannelView *channelEmotesView_{};
|
|
|
|
ChannelView *subEmotesView_{};
|
|
|
|
ChannelView *viewEmojis_{};
|
2022-01-02 15:59:16 +01:00
|
|
|
/**
|
|
|
|
* @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_{};
|
2021-11-21 18:46:21 +01:00
|
|
|
|
2022-01-02 15:59:16 +01:00
|
|
|
QLineEdit *search_;
|
2021-11-21 18:46:21 +01:00
|
|
|
Notebook *notebook_;
|
2022-01-02 15:59:16 +01:00
|
|
|
|
2022-01-22 14:05:01 +01:00
|
|
|
void filterTwitchEmotes(std::shared_ptr<Channel> searchChannel,
|
|
|
|
const QString &searchText);
|
2022-01-02 15:59:16 +01:00
|
|
|
void filterEmotes(const QString &text);
|
2021-11-21 18:46:21 +01:00
|
|
|
void addShortcuts() override;
|
2023-12-16 14:40:05 +01:00
|
|
|
bool eventFilter(QObject *object, QEvent *event) override;
|
2017-09-15 17:23:49 +02:00
|
|
|
};
|
2017-12-17 02:10:35 +01:00
|
|
|
|
|
|
|
} // namespace chatterino
|