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

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

Collaboration diagram for ChatLine:

Public Types

enum  { Type = ChatScene::ChatLineType }

Public Member Functions

 ChatLine (int row, QAbstractItemModel *model, const qreal &width, const qreal &timestampWidth, const qreal &senderWidth, const qreal &contentsWidth, const QPointF &senderPos, const QPointF &contentsPos, QGraphicsItem *parent=0)
virtual ~ChatLine ()
virtual QRectF boundingRect () const
QModelIndex index () const
MsgId msgId () const
Message::Type msgType () const
int row () const
void setRow (int row)
const QAbstractItemModel * model () const
ChatScenechatScene () const
ChatViewchatView () const
qreal width () const
qreal height () const
ChatItemitem (ChatLineModel::ColumnType)
ChatItemitemAt (const QPointF &pos)
ChatItemtimestampItem ()
ChatItemsenderItem ()
ContentsChatItemcontentsItem ()
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
virtual int type () const
void setFirstColumn (const qreal &timestampWidth, const qreal &senderWidth, const QPointF &senderPos)
void setSecondColumn (const qreal &senderWidth, const qreal &contentsWidth, const QPointF &contentsPos, qreal &linePos)
void setGeometryByWidth (const qreal &width, const qreal &contentsWidth, qreal &linePos)
void setSelected (bool selected, ChatLineModel::ColumnType minColumn=ChatLineModel::ContentsColumn)
void setHighlighted (bool highlighted)
void clearCache ()

Protected Member Functions

virtual bool sceneEvent (QEvent *event)
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
ChatItemmouseEventTargetItem (const QPointF &pos)
ChatItemmouseGrabberItem () const
void setMouseGrabberItem (ChatItem *item)

Private Types

enum  { ItemMask = 0x3f, Selected = 0x40, Highlighted = 0x80 }

Private Attributes

int _row
QAbstractItemModel * _model
ContentsChatItem _contentsItem
SenderChatItem _senderItem
TimestampChatItem _timestampItem
qreal _width
qreal _height
quint8 _selection
ChatItem_mouseGrabberItem
ChatItem_hoverItem

Detailed Description

Definition at line 30 of file chatline.h.

Member Enumeration Documentation

anonymous enum
Enumerator:
Type 

Definition at line 64 of file chatline.h.

anonymous enum
private
Enumerator:
ItemMask 
Selected 
Highlighted 

Definition at line 103 of file chatline.h.

Constructor & Destructor Documentation

ChatLine ( int  row,
QAbstractItemModel *  model,
const qreal &  width,
const qreal &  timestampWidth,
const qreal &  senderWidth,
const qreal &  contentsWidth,
const QPointF &  senderPos,
const QPointF &  contentsPos,
QGraphicsItem *  parent = 0 
)
~ChatLine ( )
virtual

Definition at line 64 of file chatline.cpp.

References chatView(), and ChatView::setHasCache().

Member Function Documentation

virtual QRectF boundingRect ( ) const
inlinevirtual

Definition at line 41 of file chatline.h.

References _height, and _width.

Referenced by paint().

QModelIndex index ( ) const
inline

Definition at line 43 of file chatline.h.

References model(), and row().

Referenced by ChatLine(), msgId(), msgType(), and BufferWidget::setMarkerLine().

MsgId msgId ( ) const
inline

Definition at line 44 of file chatline.h.

References index(), and MessageModel::MsgIdRole.

Referenced by ChatView::lastVisibleMsgId().

Message::Type msgType ( ) const
inline

Definition at line 45 of file chatline.h.

References index(), and MessageModel::TypeRole.

Referenced by ChatView::lastVisibleChatLine().

void setRow ( int  row)
inline

Definition at line 48 of file chatline.h.

References _row, and row().

const QAbstractItemModel* model ( ) const
inline

Definition at line 50 of file chatline.h.

References _model.

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

ChatScene* chatScene ( ) const
inline

Definition at line 51 of file chatline.h.

Referenced by ChatItem::chatScene(), chatView(), and sceneEvent().

ChatView* chatView ( ) const
inline

Definition at line 52 of file chatline.h.

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

Referenced by ~ChatLine().

qreal width ( ) const
inline

Definition at line 54 of file chatline.h.

References _width.

Referenced by paint(), and setGeometryByWidth().

ChatItem * itemAt ( const QPointF &  pos)
ChatItem* timestampItem ( )
inline

Definition at line 59 of file chatline.h.

References _timestampItem.

Referenced by paint().

ChatItem* senderItem ( )
inline

Definition at line 60 of file chatline.h.

References _senderItem.

Referenced by paint(), and ChatViewSearchController::repositionHighlights().

ContentsChatItem* contentsItem ( )
inline

Definition at line 61 of file chatline.h.

References _contentsItem.

Referenced by paint(), and ChatViewSearchController::repositionHighlights().

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

Definition at line 65 of file chatline.h.

References Type.

Referenced by paint().

void setFirstColumn ( const qreal &  timestampWidth,
const qreal &  senderWidth,
const QPointF &  senderPos 
)
void setSecondColumn ( const qreal &  senderWidth,
const qreal &  contentsWidth,
const QPointF &  contentsPos,
qreal &  linePos 
)
void setGeometryByWidth ( const qreal &  width,
const qreal &  contentsWidth,
qreal &  linePos 
)
void setSelected ( bool  selected,
ChatLineModel::ColumnType  minColumn = ChatLineModel::ContentsColumn 
)
void setHighlighted ( bool  highlighted)

Definition at line 202 of file chatline.cpp.

References _selection, and Highlighted.

Referenced by ChatLine().

void clearCache ( )
bool sceneEvent ( QEvent *  event)
protectedvirtual

Definition at line 112 of file chatline.cpp.

References chatScene(), ChatScene::chatView(), itemAt(), and setMouseGrabberItem().

void mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 252 of file chatline.cpp.

References item(), mouseEventTargetItem(), and ChatItem::mouseMoveEvent().

void mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 260 of file chatline.cpp.

References item(), mouseEventTargetItem(), and ChatItem::mousePressEvent().

void mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 268 of file chatline.cpp.

References item(), mouseEventTargetItem(), and ChatItem::mouseReleaseEvent().

void hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Definition at line 276 of file chatline.cpp.

References _hoverItem, ChatItem::hoverEnterEvent(), item(), and mouseEventTargetItem().

void hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Definition at line 286 of file chatline.cpp.

References _hoverItem, and ChatItem::hoverLeaveEvent().

void hoverMoveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Definition at line 295 of file chatline.cpp.

References ChatItem::hoverMoveEvent(), item(), and mouseEventTargetItem().

ChatItem * mouseEventTargetItem ( const QPointF &  pos)
protected
ChatItem* mouseGrabberItem ( ) const
inlineprotected

Definition at line 92 of file chatline.h.

References _mouseGrabberItem.

Referenced by mouseEventTargetItem().

void setMouseGrabberItem ( ChatItem item)
protected

Definition at line 106 of file chatline.cpp.

References _mouseGrabberItem, and item().

Referenced by sceneEvent().

Member Data Documentation

int _row
private

Definition at line 96 of file chatline.h.

Referenced by row(), and setRow().

QAbstractItemModel* _model
private

Definition at line 97 of file chatline.h.

Referenced by model().

ContentsChatItem _contentsItem
private

Definition at line 98 of file chatline.h.

Referenced by clearCache(), contentsItem(), item(), itemAt(), setGeometryByWidth(), and setSecondColumn().

SenderChatItem _senderItem
private
TimestampChatItem _timestampItem
private
qreal _width
private

Definition at line 101 of file chatline.h.

Referenced by boundingRect(), setGeometryByWidth(), and width().

qreal _height
private

Definition at line 101 of file chatline.h.

Referenced by boundingRect(), height(), setFirstColumn(), setGeometryByWidth(), and setSecondColumn().

quint8 _selection
private

Definition at line 110 of file chatline.h.

Referenced by paint(), setHighlighted(), and setSelected().

ChatItem* _mouseGrabberItem
private

Definition at line 112 of file chatline.h.

Referenced by mouseGrabberItem(), and setMouseGrabberItem().

ChatItem* _hoverItem
private

Definition at line 113 of file chatline.h.

Referenced by hoverEnterEvent(), and hoverLeaveEvent().


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