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

#include </tmp/quassel/src/uisupport/abstractbuffercontainer.h>

Inheritance diagram for AbstractBufferContainer:
Collaboration diagram for AbstractBufferContainer:

Signals

void currentChanged (BufferId)
void currentChanged (const QModelIndex &)

Public Member Functions

 AbstractBufferContainer (QWidget *parent)
virtual ~AbstractBufferContainer ()
BufferId currentBuffer () const
QAbstractItemModel * model ()
void setModel (QAbstractItemModel *model)
QItemSelectionModel * selectionModel () const
void setSelectionModel (QItemSelectionModel *selectionModel)
QModelIndex currentIndex () const

Protected Slots

virtual void currentChanged (const QModelIndex &current, const QModelIndex &previous)
virtual void rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
virtual void showChatView (BufferId)=0
 Show the given chat view.
virtual void closeEditor (QWidget *, QAbstractItemDelegate::EndEditHint)
virtual void commitData (QWidget *)
virtual void dataChanged (const QModelIndex &, const QModelIndex &)
virtual void editorDestroyed (QObject *)
virtual void rowsInserted (const QModelIndex &, int, int)
virtual void selectionChanged (const QItemSelection &, const QItemSelection &)

Protected Member Functions

virtual AbstractChatViewcreateChatView (BufferId)=0
 Create an AbstractChatView for the given BufferId and add it to the UI if necessary.
virtual void removeChatView (BufferId)=0
 Remove a chat view from the UI and delete it.
virtual bool autoMarkerLine () const
 If true, the marker line will be set automatically on buffer switch.

Protected Attributes

QPointer< QAbstractItemModel > _model
QPointer< QItemSelectionModel > _selectionModel

Private Slots

void removeBuffer (BufferId bufferId)
void setCurrentBuffer (BufferId bufferId)

Private Attributes

BufferId _currentBuffer
QHash< BufferId,
AbstractChatView * > 
_chatViews

Detailed Description

Definition at line 31 of file abstractbuffercontainer.h.

Constructor & Destructor Documentation

AbstractBufferContainer ( QWidget *  parent)

Definition at line 26 of file abstractbuffercontainer.cpp.

Definition at line 33 of file abstractbuffercontainer.cpp.

Member Function Documentation

BufferId currentBuffer ( ) const
inline
void currentChanged ( BufferId  )
signal

Referenced by currentChanged().

void currentChanged ( const QModelIndex &  )
signal
virtual AbstractChatView* createChatView ( BufferId  )
protectedpure virtual

Create an AbstractChatView for the given BufferId and add it to the UI if necessary.

Implemented in BufferWidget.

Referenced by setCurrentBuffer().

virtual void removeChatView ( BufferId  )
protectedpure virtual

Remove a chat view from the UI and delete it.

This method shall remove the view from the UI (for example, from a QStackedWidget) if appropriate. It also shall delete the object afterwards.

Parameters
viewThe chat view to be removed and deleted

Implemented in BufferWidget.

Referenced by removeBuffer(), and rowsAboutToBeRemoved().

virtual bool autoMarkerLine ( ) const
inlineprotectedvirtual

If true, the marker line will be set automatically on buffer switch.

Returns
Whether the marker line should be set on buffer switch

Reimplemented in BufferWidget.

Definition at line 59 of file abstractbuffercontainer.h.

void currentChanged ( const QModelIndex &  current,
const QModelIndex &  previous 
)
protectedvirtualslot
void rowsAboutToBeRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
protectedvirtualslot
virtual void showChatView ( BufferId  )
protectedpure virtualslot

Show the given chat view.

This method is called when the given chat view should be displayed. Use this e.g. for selecting the appropriate page in a QStackedWidget.

Parameters
viewThe chat view to be displayed. May be 0 if no chat view is selected.

Referenced by setCurrentBuffer().

void removeBuffer ( BufferId  bufferId)
privateslot

Definition at line 67 of file abstractbuffercontainer.cpp.

References _chatViews, and removeChatView().

Referenced by rowsAboutToBeRemoved().

virtual void closeEditor ( QWidget *  ,
QAbstractItemDelegate::EndEditHint   
)
inlineprotectedvirtualslotinherited

Definition at line 48 of file abstractitemview.h.

virtual void commitData ( QWidget *  )
inlineprotectedvirtualslotinherited

Definition at line 49 of file abstractitemview.h.

virtual void dataChanged ( const QModelIndex &  ,
const QModelIndex &   
)
inlineprotectedvirtualslotinherited

Definition at line 51 of file abstractitemview.h.

Referenced by AbstractItemView::setModel().

virtual void editorDestroyed ( QObject *  )
inlineprotectedvirtualslotinherited

Definition at line 52 of file abstractitemview.h.

virtual void rowsInserted ( const QModelIndex &  ,
int  ,
int   
)
inlineprotectedvirtualslotinherited

Definition at line 54 of file abstractitemview.h.

Referenced by AbstractItemView::setModel().

virtual void selectionChanged ( const QItemSelection &  ,
const QItemSelection &   
)
inlineprotectedvirtualslotinherited

Definition at line 55 of file abstractitemview.h.

Referenced by AbstractItemView::setSelectionModel().

Member Data Documentation

BufferId _currentBuffer
private

Definition at line 77 of file abstractbuffercontainer.h.

Referenced by currentBuffer(), and setCurrentBuffer().

QHash<BufferId, AbstractChatView *> _chatViews
private

Definition at line 78 of file abstractbuffercontainer.h.

Referenced by removeBuffer(), rowsAboutToBeRemoved(), and setCurrentBuffer().

QPointer<QAbstractItemModel> _model
protectedinherited

Definition at line 55 of file abstractitemview.h.

Referenced by AbstractItemView::model(), and AbstractItemView::setModel().

QPointer<QItemSelectionModel> _selectionModel
protectedinherited

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