X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.h;h=e94bda198a6283739ad71bafaa0182cc855cd67d;hp=9abd761b2cb85001cb809ecdcf082da8926c762a;hb=55579f53f3bd37f2a20d9be7458bdc54b345a052;hpb=c9057c565220fa7f5e264775fde4bf41c5eae308 diff --git a/src/qtui/chatitem.h b/src/qtui/chatitem.h index 9abd761b..e94bda19 100644 --- a/src/qtui/chatitem.h +++ b/src/qtui/chatitem.h @@ -27,6 +27,7 @@ #include "chatlinemodel.h" #include "chatscene.h" +#include "clickable.h" #include "uistyle.h" #include "qtui.h" @@ -195,14 +196,12 @@ protected: virtual UiStyle::FormatList formatList() const; private: - struct Clickable; class ActionProxy; class WrapColumnFinder; ContentsChatItemPrivate *_data; ContentsChatItemPrivate *privateData() const; - QList findClickables() const; Clickable clickableAt(const QPointF &pos) const; void endHoverMode(); @@ -219,31 +218,13 @@ private: static ActionProxy _actionProxy; }; -struct ContentsChatItem::Clickable { - // Don't change these enums without also changing the regexps in analyze()! - enum Type { - Invalid = -1, - Url = 0, - Channel = 1, - Nick = 2 - }; - - Type type; - quint16 start; - quint16 length; - - inline Clickable() : type(Invalid) {}; - inline Clickable(Type type_, quint16 start_, quint16 length_) : type(type_), start(start_), length(length_) {}; - inline bool isValid() const { return type != Invalid; } -}; - struct ContentsChatItemPrivate { ContentsChatItem *contentsItem; - QList clickables; - ContentsChatItem::Clickable currentClickable; - ContentsChatItem::Clickable activeClickable; + ClickableList clickables; + Clickable currentClickable; + Clickable activeClickable; - ContentsChatItemPrivate(const QList &c, ContentsChatItem *parent) : contentsItem(parent), clickables(c) {} + ContentsChatItemPrivate(const ClickableList &c, ContentsChatItem *parent) : contentsItem(parent), clickables(c) {} }; class ContentsChatItem::WrapColumnFinder {