2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-01 13:07:36 +01:00
|
|
|
|
2017-06-11 09:31:45 +02:00
|
|
|
#include "concurrentmap.hpp"
|
|
|
|
#include "logging/loggingchannel.hpp"
|
|
|
|
#include "messages/lazyloadedimage.hpp"
|
|
|
|
#include "messages/limitedqueue.hpp"
|
2017-01-07 20:43:55 +01:00
|
|
|
|
|
|
|
#include <QMap>
|
|
|
|
#include <QMutex>
|
2017-01-11 18:52:09 +01:00
|
|
|
#include <QString>
|
2017-01-07 20:43:55 +01:00
|
|
|
#include <QVector>
|
2017-02-02 20:35:12 +01:00
|
|
|
#include <boost/signals2.hpp>
|
2017-06-07 10:09:24 +02:00
|
|
|
|
2017-01-11 01:08:20 +01:00
|
|
|
#include <memory>
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
|
|
|
namespace messages {
|
2017-01-05 16:07:20 +01:00
|
|
|
class Message;
|
2017-01-18 21:30:23 +01:00
|
|
|
}
|
2017-01-01 13:07:36 +01:00
|
|
|
|
2017-06-13 21:13:58 +02:00
|
|
|
class WindowManager;
|
|
|
|
class EmoteManager;
|
|
|
|
class IrcManager;
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-01-01 13:07:36 +01:00
|
|
|
class Channel
|
|
|
|
{
|
|
|
|
public:
|
2017-06-13 21:13:58 +02:00
|
|
|
explicit Channel(WindowManager &_windowManager, EmoteManager &_emoteManager,
|
|
|
|
IrcManager &_ircManager, const QString &channel, bool isSpecial = false);
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
boost::signals2::signal<void(messages::SharedMessage &)> messageRemovedFromStart;
|
|
|
|
boost::signals2::signal<void(messages::SharedMessage &)> messageAppended;
|
2017-02-02 20:35:12 +01:00
|
|
|
|
2017-01-07 20:43:55 +01:00
|
|
|
// properties
|
2017-04-12 17:46:44 +02:00
|
|
|
ConcurrentMap<QString, messages::LazyLoadedImage *> &getBttvChannelEmotes();
|
|
|
|
ConcurrentMap<QString, messages::LazyLoadedImage *> &getFfzChannelEmotes();
|
|
|
|
|
|
|
|
bool isEmpty() const;
|
|
|
|
const QString &getName() const;
|
|
|
|
int getRoomID() const;
|
|
|
|
const QString &getSubLink() const;
|
|
|
|
const QString &getChannelLink() const;
|
|
|
|
const QString &getPopoutPlayerLink() const;
|
|
|
|
bool getIsLive() const;
|
|
|
|
int getStreamViewerCount() const;
|
|
|
|
const QString &getStreamStatus() const;
|
|
|
|
const QString &getStreamGame() const;
|
|
|
|
messages::LimitedQueueSnapshot<messages::SharedMessage> getMessageSnapshot();
|
2017-01-05 20:49:33 +01:00
|
|
|
|
2017-01-07 20:43:55 +01:00
|
|
|
// methods
|
2017-04-12 17:46:44 +02:00
|
|
|
void addMessage(messages::SharedMessage message);
|
|
|
|
void reloadChannelEmotes();
|
2017-01-26 17:26:20 +01:00
|
|
|
|
2017-05-27 17:45:40 +02:00
|
|
|
void sendMessage(const QString &message);
|
|
|
|
|
2017-01-01 13:07:36 +01:00
|
|
|
private:
|
2017-06-13 21:13:58 +02:00
|
|
|
WindowManager &windowManager;
|
|
|
|
EmoteManager &emoteManager;
|
|
|
|
IrcManager &ircManager;
|
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
// variabeles
|
|
|
|
messages::LimitedQueue<messages::SharedMessage> _messages;
|
2017-01-01 13:07:36 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
QString _name;
|
|
|
|
int _roomID;
|
2017-01-01 13:07:36 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
ConcurrentMap<QString, messages::LazyLoadedImage *> _bttvChannelEmotes;
|
|
|
|
ConcurrentMap<QString, messages::LazyLoadedImage *> _ffzChannelEmotes;
|
2017-01-13 18:59:11 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
QString _subLink;
|
|
|
|
QString _channelLink;
|
|
|
|
QString _popoutPlayerLink;
|
2017-01-01 13:07:36 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
bool _isLive;
|
|
|
|
int _streamViewerCount;
|
|
|
|
QString _streamStatus;
|
|
|
|
QString _streamGame;
|
|
|
|
// std::shared_ptr<logging::Channel> _loggingChannel;
|
2017-01-01 13:07:36 +01:00
|
|
|
};
|
2017-03-11 11:32:19 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace chatterino
|