-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 : ChatItemPrivate {
- ContentsChatItem *contentsItem;
- QList<ContentsChatItem::Clickable> clickables;
- ContentsChatItem::Clickable currentClickable;
- bool hasDragged;
-
-#ifdef HAVE_WEBKIT
- ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false), controller(0) {}
-#else
- ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false) {}
-#endif
- ~ContentsChatItemPrivate();
-
-#ifdef HAVE_WEBKIT
- void loadWebPreview(const QString &url, const QRectF &urlRect);
- void clearPreview();
-
-private:
- class PreviewController;
- class PreviewItem;
- PreviewController *controller;
-#endif //#ifdef HAVE_WEBKIT