mirror-chatterino2/src/messages/link.h

47 lines
633 B
C
Raw Normal View History

#pragma once
2017-01-05 16:07:20 +01:00
2017-01-05 20:49:33 +01:00
#include <QString>
2017-01-05 16:07:20 +01:00
2017-04-14 17:52:22 +02:00
namespace chatterino {
namespace messages {
2017-01-18 21:30:23 +01:00
2017-01-05 16:07:20 +01:00
class Link
{
public:
2017-01-05 20:49:33 +01:00
enum Type {
None,
Url,
CloseCurrentSplit,
UserInfo,
2017-01-15 16:38:30 +01:00
UserTimeout,
UserBan,
2017-01-05 20:49:33 +01:00
InsertText,
ShowMessage,
};
2017-01-05 16:07:20 +01:00
Link();
2017-01-18 04:33:30 +01:00
Link(Type getType, const QString &getValue);
2017-01-05 20:49:33 +01:00
2017-04-24 23:00:26 +02:00
bool isValid() const
2017-01-11 18:52:09 +01:00
{
2017-04-24 23:00:26 +02:00
return type != None;
2017-01-05 20:49:33 +01:00
}
2017-04-12 17:46:44 +02:00
Type getType() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return type;
2017-01-05 20:49:33 +01:00
}
2017-04-12 17:46:44 +02:00
const QString &getValue() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return value;
2017-01-05 20:49:33 +01:00
}
private:
2017-01-18 04:33:30 +01:00
Type type;
QString value;
2017-01-05 16:07:20 +01:00
};
} // namespace messages
} // namespace chatterino