Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
ContentsChatItem Class Reference

A ChatItem for the contents column. More...

#include </tmp/quassel/src/qtui/chatitem.h>

Inheritance diagram for ContentsChatItem:
Collaboration diagram for ContentsChatItem:

Classes

class  ActionProxy
 Acts as a proxy for Action signals targetted at a ContentsChatItem. More...
class  WrapColumnFinder

Public Member Functions

const QAbstractItemModel * model () const
ChatLinechatLine () const
ChatScenechatScene () const
ChatViewchatView () const
int row () const
QRectF boundingRect () const
qreal width () const
qreal height () const
QPointF pos () const
qreal x () const
qreal y () const
QPointF mapToLine (const QPointF &) const
QPointF mapFromLine (const QPointF &) const
QPointF mapToScene (const QPointF &) const
QPointF mapFromScene (const QPointF &) const
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
QVariant data (int role) const
QString selection () const
void clearSelection ()
void setFullSelection ()
void continueSelecting (const QPointF &pos)
bool hasSelection () const
bool isPosOverSelection (const QPointF &pos) const
QList< QRectF > findWords (const QString &searchWord, Qt::CaseSensitivity caseSensitive)
void initLayoutHelper (QTextLayout *layout, QTextOption::WrapMode, Qt::Alignment=Qt::AlignLeft) const

Protected Types

enum  SelectionMode { NoSelection, PartialSelection, FullSelection }

Protected Member Functions

virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
virtual void handleClick (const QPointF &pos, ChatScene::ClickMode clickMode)
virtual void addActionsToMenu (QMenu *menu, const QPointF &itemPos)
virtual void copyLinkToClipboard ()
virtual QVector
< QTextLayout::FormatRange > 
additionalFormats () const
virtual void initLayout (QTextLayout *layout) const
virtual void doLayout (QTextLayout *layout) const
virtual UiStyle::FormatList formatList () const
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *)
QTextLayout * layout () const
void paintBackground (QPainter *)
QVector< QTextLayout::FormatRange > selectionFormats () const
void overlayFormat (UiStyle::FormatList &fmtList, int start, int end, quint32 overlayFmt) const
qint16 selectionStart () const
void setSelectionStart (qint16 start)
qint16 selectionEnd () const
void setSelectionEnd (qint16 end)
SelectionMode selectionMode () const
void setSelectionMode (SelectionMode mode)
void setSelection (SelectionMode mode, qint16 selectionStart, qint16 selectionEnd)
qint16 posToCursor (const QPointF &pos) const
void setGeometry (qreal width, qreal height)
void setHeight (const qreal &height)
void setWidth (const qreal &width)
void setPos (const QPointF &pos)

Private Member Functions

Q_DECLARE_TR_FUNCTIONS(ContentsChatItem)
public 
~ContentsChatItem ()
virtual int type () const
ChatLineModel::ColumnType column () const
QFontMetricsF * fontMetrics () const
virtual void clearCache ()
ContentsChatItemPrivateprivateData () const
Clickable clickableAt (const QPointF &pos) const
void endHoverMode ()
void showWebPreview (const Clickable &click)
void clearWebPreview ()
qreal setGeometryByWidth (qreal w)

Private Attributes

ContentsChatItemPrivate_data
QFontMetricsF * _fontMetrics

Static Private Attributes

static ActionProxy _actionProxy

Friends

class ChatLine
struct ContentsChatItemPrivate

Detailed Description

A ChatItem for the contents column.

Definition at line 188 of file chatitem.h.

Member Enumeration Documentation

enum SelectionMode
protectedinherited
Enumerator:
NoSelection 
PartialSelection 
FullSelection 

Definition at line 95 of file chatitem.h.

Constructor & Destructor Documentation

~ContentsChatItem ( )
private

Definition at line 574 of file chatitem.cpp.

References _data.

Member Function Documentation

virtual int type ( ) const
inlineprivatevirtual

Definition at line 196 of file chatitem.h.

References ChatScene::ContentsChatItemType.

ChatLineModel::ColumnType column ( ) const
inlineprivate

Definition at line 198 of file chatitem.h.

References MessageModel::ContentsColumn.

QFontMetricsF * fontMetrics ( ) const
private
void clearCache ( )
privatevirtual

Definition at line 580 of file chatitem.cpp.

References _data.

Referenced by ChatLine::clearCache().

void mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Reimplemented from ChatItem.

Definition at line 751 of file chatitem.cpp.

References endHoverMode().

void hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Reimplemented from ChatItem.

Definition at line 759 of file chatitem.cpp.

References endHoverMode().

QVector< QTextLayout::FormatRange > additionalFormats ( ) const
protectedvirtual
void initLayout ( QTextLayout *  layout) const
protectedvirtual

Reimplemented from ChatItem.

Definition at line 619 of file chatitem.cpp.

References doLayout(), and ChatItem::initLayoutHelper().

void doLayout ( QTextLayout *  layout) const
protectedvirtual
Clickable clickableAt ( const QPointF &  pos) const
private
void endHoverMode ( )
private
void clearWebPreview ( )
private

Definition at line 860 of file chatitem.cpp.

References ChatItem::chatScene().

Referenced by endHoverMode().

const QAbstractItemModel * model ( ) const
inherited

Definition at line 77 of file chatitem.cpp.

References ChatItem::chatLine(), and ChatLine::model().

Referenced by ChatItem::data(), and ChatItem::findWords().

ChatView * chatView ( ) const
inherited

Definition at line 71 of file chatitem.cpp.

References ChatItem::chatScene(), and ChatScene::chatView().

Referenced by ChatItem::layout().

QRectF boundingRect ( ) const
inlineinherited
qreal width ( ) const
inlineinherited
qreal height ( ) const
inlineinherited
qreal y ( ) const
inlineinherited

Definition at line 305 of file chatitem.h.

References ChatItem::pos().

Referenced by ChatItem::findWords(), and showWebPreview().

QPointF mapToLine ( const QPointF &  p) const
inherited

Definition at line 89 of file chatitem.cpp.

References ChatItem::pos().

QPointF mapFromLine ( const QPointF &  p) const
inherited

Definition at line 95 of file chatitem.cpp.

References ChatItem::pos().

Referenced by ChatItem::posToCursor().

QPointF mapToScene ( const QPointF &  p) const
inherited

Definition at line 102 of file chatitem.cpp.

References ChatItem::chatLine().

Referenced by showWebPreview(), and ChatScene::startGlobalSelection().

QPointF mapFromScene ( const QPointF &  p) const
inherited
void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
virtualinherited
void clearSelection ( )
inherited
void setFullSelection ( )
inherited
void continueSelecting ( const QPointF &  pos)
inherited
bool isPosOverSelection ( const QPointF &  pos) const
inherited
void initLayoutHelper ( QTextLayout *  layout,
QTextOption::WrapMode  wrapMode,
Qt::Alignment  alignment = Qt::AlignLeft 
) const
inherited
void mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtualinherited

Definition at line 452 of file chatitem.cpp.

Referenced by ChatLine::mousePressEvent().

void mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtualinherited
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent *  )
inlineprotectedvirtualinherited

Definition at line 104 of file chatitem.h.

Referenced by ChatLine::hoverEnterEvent().

void paintBackground ( QPainter *  painter)
protectedinherited
void overlayFormat ( UiStyle::FormatList fmtList,
int  start,
int  end,
quint32  overlayFmt 
) const
protectedinherited

Definition at line 260 of file chatitem.cpp.

References ChatItem::data(), and MessageModel::DisplayRole.

Referenced by formatList().

qint16 selectionStart ( ) const
inlineprotectedinherited

Definition at line 119 of file chatitem.h.

References ChatItem::_selectionStart.

void setSelectionStart ( qint16  start)
inlineprotectedinherited

Definition at line 120 of file chatitem.h.

References ChatItem::_selectionStart.

Referenced by handleClick().

qint16 selectionEnd ( ) const
inlineprotectedinherited

Definition at line 121 of file chatitem.h.

References ChatItem::_selectionEnd.

void setSelectionEnd ( qint16  end)
inlineprotectedinherited

Definition at line 122 of file chatitem.h.

References ChatItem::_selectionEnd.

Referenced by handleClick().

SelectionMode selectionMode ( ) const
inlineprotectedinherited

Definition at line 123 of file chatitem.h.

References ChatItem::_selectionMode.

void setSelectionMode ( SelectionMode  mode)
inlineprotectedinherited

Definition at line 124 of file chatitem.h.

References ChatItem::_selectionMode.

Referenced by handleClick().

void setSelection ( SelectionMode  mode,
qint16  selectionStart,
qint16  selectionEnd 
)
protectedinherited
void setGeometry ( qreal  width,
qreal  height 
)
inlineprotectedinherited
void setHeight ( const qreal &  height)
inlineprotectedinherited
void setWidth ( const qreal &  width)
inlineprotectedinherited

Definition at line 131 of file chatitem.h.

References ChatItem::_boundingRect, and ChatItem::clearCache().

void setPos ( const QPointF &  pos)
inlineprotectedinherited

Definition at line 132 of file chatitem.h.

References ChatItem::_boundingRect.

Referenced by ChatLine::setFirstColumn(), and ChatLine::setSecondColumn().

Friends And Related Function Documentation

friend class ChatLine
friend

Definition at line 238 of file chatitem.h.

friend struct ContentsChatItemPrivate
friend

Definition at line 239 of file chatitem.h.

Referenced by privateData().

Member Data Documentation

ContentsChatItemPrivate* _data
mutableprivate

Definition at line 220 of file chatitem.h.

Referenced by clearCache(), privateData(), setGeometryByWidth(), and ~ContentsChatItem().

QFontMetricsF* _fontMetrics
private

Definition at line 233 of file chatitem.h.

ContentsChatItem::ActionProxy _actionProxy
staticprivate

Definition at line 236 of file chatitem.h.

Referenced by addActionsToMenu().


The documentation for this class was generated from the following files: