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

A ChatItem for the sender column. More...

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

Inheritance diagram for SenderChatItem:
Collaboration diagram for SenderChatItem:

Public Member Functions

 SenderChatItem (const QRectF &boundingRect, ChatLine *parent)
virtual ChatLineModel::ColumnType column () const
virtual void handleClick (const QPointF &pos, ChatScene::ClickMode clickMode)
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
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)
virtual void addActionsToMenu (QMenu *menu, const QPointF &itemPos)
void initLayoutHelper (QTextLayout *layout, QTextOption::WrapMode, Qt::Alignment=Qt::AlignLeft) const
virtual void clearCache ()
 Remove internally cached data.

Protected Types

enum  SelectionMode { NoSelection, PartialSelection, FullSelection }

Protected Member Functions

virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
virtual int type () const
virtual void initLayout (QTextLayout *layout) const
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *)
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *)
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *)
QTextLayout * layout () const
virtual void doLayout (QTextLayout *) const
virtual UiStyle::FormatList formatList () const
void paintBackground (QPainter *)
QVector< QTextLayout::FormatRange > selectionFormats () const
virtual QVector
< QTextLayout::FormatRange > 
additionalFormats () 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)

Detailed Description

A ChatItem for the sender column.

Definition at line 168 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

SenderChatItem ( const QRectF &  boundingRect,
ChatLine parent 
)
inline

Definition at line 171 of file chatitem.h.

Member Function Documentation

virtual ChatLineModel::ColumnType column ( ) const
inlinevirtual

Implements ChatItem.

Definition at line 172 of file chatitem.h.

References MessageModel::SenderColumn.

void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
protectedvirtual
virtual int type ( ) const
inlineprotectedvirtual

Reimplemented from ChatItem.

Definition at line 177 of file chatitem.h.

References ChatScene::SenderChatItemType.

void initLayout ( QTextLayout *  layout) const
protectedvirtual

Reimplemented from ChatItem.

Definition at line 484 of file chatitem.cpp.

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

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 y ( ) const
inlineinherited

Definition at line 305 of file chatitem.h.

References ChatItem::pos().

Referenced by ChatItem::findWords(), and ContentsChatItem::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
QPointF mapFromScene ( const QPointF &  p) const
inherited
void clearSelection ( )
inherited
void setFullSelection ( )
inherited
void continueSelecting ( const QPointF &  pos)
inherited
bool isPosOverSelection ( const QPointF &  pos) const
inherited
void addActionsToMenu ( QMenu *  menu,
const QPointF &  itemPos 
)
virtualinherited
void initLayoutHelper ( QTextLayout *  layout,
QTextOption::WrapMode  wrapMode,
Qt::Alignment  alignment = Qt::AlignLeft 
) const
inherited
void clearCache ( )
virtualinherited

Remove internally cached data.

This removes e.g. the cached QTextLayout to avoid wasting space for nonvisible ChatLines

Definition at line 137 of file chatitem.cpp.

References ChatItem::_cachedLayout.

Referenced by ChatLine::clearCache(), ChatItem::setGeometry(), ChatItem::setHeight(), and ChatItem::setWidth().

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().

virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent *  )
inlineprotectedvirtualinherited

Reimplemented in ContentsChatItem.

Definition at line 105 of file chatitem.h.

Referenced by ChatLine::hoverLeaveEvent().

virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent *  )
inlineprotectedvirtualinherited

Reimplemented in ContentsChatItem.

Definition at line 106 of file chatitem.h.

Referenced by ChatLine::hoverMoveEvent().

void doLayout ( QTextLayout *  layout) const
protectedvirtualinherited

Reimplemented in ContentsChatItem.

Definition at line 168 of file chatitem.cpp.

References ChatItem::width().

Referenced by ChatItem::initLayout(), and initLayout().

UiStyle::FormatList formatList ( ) const
protectedvirtualinherited

Reimplemented in ContentsChatItem.

Definition at line 180 of file chatitem.cpp.

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

Referenced by ChatItem::initLayoutHelper(), and ChatItem::selectionFormats().

void paintBackground ( QPainter *  painter)
protectedinherited
QVector< QTextLayout::FormatRange > additionalFormats ( ) const
protectedvirtualinherited

Reimplemented in ContentsChatItem.

Definition at line 286 of file chatitem.cpp.

References ChatItem::selectionFormats().

Referenced by ChatItem::paint(), and paint().

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 ContentsChatItem::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 ContentsChatItem::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 ContentsChatItem::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 ContentsChatItem::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().


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