- ContentsChatItem *contentsItem;
- ContentsChatItemPrivate::PreviewItem *previewItem;
-
- QString url;
-};
-
-class QWebView;
-class ContentsChatItemPrivate::PreviewItem : public QGraphicsItem {
-public:
- PreviewItem(QWebView *webView);
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
- virtual inline QRectF boundingRect() const { return _boundingRect; }
-
-private:
- QRectF _boundingRect;
-};
-
-//inlines regarding ContentsChatItemPrivate
-ContentsChatItemPrivate *ContentsChatItem::privateData() const { return (ContentsChatItemPrivate *)ChatItem::privateData(); }
-
-class ContentsChatItem::WrapColumnFinder {
-public:
- WrapColumnFinder(ChatItem *parent);
- ~WrapColumnFinder();
-
- qint16 nextWrapColumn();
-
-private:
- ChatItem *item;
- QTextLayout *layout;
- QTextLine line;
- ChatLineModel::WrapList wrapList;
- qint16 wordidx;
- qint16 lineCount;
- qreal choppedTrailing;
+ /// Returns the ContentsChatItem that should receive the action event.
+ /** For efficiency reasons, values are not checked for validity. You gotta make sure that you set the data() member
+ * in the Action correctly.
+ * @return The ChatItem from which the sending Action originated
+ */
+ inline ContentsChatItem *item() const {
+ return static_cast<ContentsChatItem *>(qobject_cast<QAction *>(sender())->data().value<void *>());
+ }