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

A ChatItem for the timestamp column. More...

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

Inheritance diagram for TimestampChatItem:
Collaboration diagram for TimestampChatItem:

Public Member Functions

 TimestampChatItem (const QRectF &boundingRect, ChatLine *parent)
virtual int type () const
virtual ChatLineModel::ColumnType column () const
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)
virtual void addActionsToMenu (QMenu *menu, const QPointF &itemPos)
virtual void handleClick (const QPointF &pos, ChatScene::ClickMode)
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 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 initLayout (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 timestamp column.

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

TimestampChatItem ( const QRectF &  boundingRect,
ChatLine parent 
)
inline

Definition at line 158 of file chatitem.h.

Member Function Documentation

virtual int type ( ) const
inlinevirtual

Reimplemented from ChatItem.

Definition at line 159 of file chatitem.h.

References ChatScene::TimestampChatItemType.

virtual ChatLineModel::ColumnType column ( ) const
inlinevirtual

Implements ChatItem.

Definition at line 160 of file chatitem.h.

References MessageModel::TimestampColumn.

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 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 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 initLayout ( QTextLayout *  layout) const
protectedvirtualinherited

Reimplemented in ContentsChatItem, and SenderChatItem.

Definition at line 161 of file chatitem.cpp.

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

Referenced by ChatItem::layout().

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 SenderChatItem::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 SenderChatItem::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 file: