Crossfire Server, Trunk
CREMessageItemModel Class Reference

#include <CREMessageItemModel.h>

+ Inheritance diagram for CREMessageItemModel:
+ Collaboration diagram for CREMessageItemModel:

Public Member Functions

virtual int columnCount (const QModelIndex &parent) const override
 
 CREMessageItemModel (QObject *parent)
 
virtual QVariant data (const QModelIndex &index, int role) const override
 
void duplicateRow (int row)
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const override
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent) const override
 
virtual bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
void moveUpDown (int row, bool up)
 
virtual QModelIndex parent (const QModelIndex &index) const override
 
virtual bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
virtual int rowCount (const QModelIndex &parent) const override
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void setMessage (MessageFile *message)
 
void setSelectedRule (const QModelIndex &index)
 
virtual ~CREMessageItemModel ()
 

Protected Attributes

QSet< int > myBlue
 
MessageFilemyMessage
 
QSet< int > myRed
 

Detailed Description

Item model for a message file.

Definition at line 26 of file CREMessageItemModel.h.

Constructor & Destructor Documentation

◆ CREMessageItemModel()

CREMessageItemModel::CREMessageItemModel ( QObject *  parent)

Definition at line 17 of file CREMessageItemModel.cpp.

◆ ~CREMessageItemModel()

CREMessageItemModel::~CREMessageItemModel ( )
virtual

Definition at line 21 of file CREMessageItemModel.cpp.

Member Function Documentation

◆ columnCount()

int CREMessageItemModel::columnCount ( const QModelIndex &  parent) const
overridevirtual

Definition at line 136 of file CREMessageItemModel.cpp.

References parent().

+ Here is the call graph for this function:

◆ data()

QVariant CREMessageItemModel::data ( const QModelIndex &  index,
int  role 
) const
overridevirtual

Definition at line 171 of file CREMessageItemModel.cpp.

References index(), myBlue, myMessage, myRed, npc_dialog::rule, MessageFile::rules(), and toDisplay().

+ Here is the call graph for this function:

◆ duplicateRow()

void CREMessageItemModel::duplicateRow ( int  row)

Definition at line 333 of file CREMessageItemModel.cpp.

References myMessage, MessageFile::rules(), and MessageFile::setModified().

Referenced by CREMessagePanel::onDuplicate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flags()

Qt::ItemFlags CREMessageItemModel::flags ( const QModelIndex &  index) const
overridevirtual

Definition at line 234 of file CREMessageItemModel.cpp.

References index().

+ Here is the call graph for this function:

◆ headerData()

QVariant CREMessageItemModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
overridevirtual

Definition at line 210 of file CREMessageItemModel.cpp.

◆ index()

QModelIndex CREMessageItemModel::index ( int  row,
int  column,
const QModelIndex &  parent 
) const
overridevirtual

Definition at line 143 of file CREMessageItemModel.cpp.

References parent().

Referenced by data(), flags(), CREMessagePanel::onAddRule(), CREMessagePanel::onDuplicate(), CREMessagePanel::onMoveDown(), CREMessagePanel::onMoveUp(), rowCount(), setData(), and setSelectedRule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertRows()

bool CREMessageItemModel::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
overridevirtual

Definition at line 280 of file CREMessageItemModel.cpp.

References disinfect::count, myMessage, parent(), MessageFile::rules(), and MessageFile::setModified().

Referenced by CREMessagePanel::onAddRule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveUpDown()

void CREMessageItemModel::moveUpDown ( int  row,
bool  up 
)

Definition at line 316 of file CREMessageItemModel.cpp.

References myMessage, MessageFile::rules(), and MessageFile::setModified().

Referenced by CREMessagePanel::onMoveDown(), and CREMessagePanel::onMoveUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parent()

QModelIndex CREMessageItemModel::parent ( const QModelIndex &  index) const
overridevirtual

Definition at line 150 of file CREMessageItemModel.cpp.

Referenced by columnCount(), index(), insertRows(), and removeRows().

+ Here is the caller graph for this function:

◆ removeRows()

bool CREMessageItemModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
overridevirtual

Definition at line 297 of file CREMessageItemModel.cpp.

References disinfect::count, myMessage, parent(), MessageFile::rules(), and MessageFile::setModified().

Referenced by CREMessagePanel::onDeleteRule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rowCount()

int CREMessageItemModel::rowCount ( const QModelIndex &  parent) const
overridevirtual

Definition at line 155 of file CREMessageItemModel.cpp.

References index(), myMessage, and MessageFile::rules().

+ Here is the call graph for this function:

◆ setData()

bool CREMessageItemModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
overridevirtual

Definition at line 241 of file CREMessageItemModel.cpp.

References index(), myMessage, npc_dialog::rule, MessageFile::rules(), MessageFile::setModified(), and autojail::value.

+ Here is the call graph for this function:

◆ setMessage()

void CREMessageItemModel::setMessage ( MessageFile message)

Definition at line 25 of file CREMessageItemModel.cpp.

References diamondslots::message, and myMessage.

Referenced by CREMessagePanel::updateItem().

+ Here is the caller graph for this function:

◆ setSelectedRule()

void CREMessageItemModel::setSelectedRule ( const QModelIndex &  index)

Definition at line 32 of file CREMessageItemModel.cpp.

References Ice::b, c, bigchest::check, index(), push::match, myBlue, myMessage, myRed, ring_occidental_mages::r, npc_dialog::rule, and MessageFile::rules().

Referenced by CREMessagePanel::currentRowChanged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ myBlue

QSet<int> CREMessageItemModel::myBlue
protected

Definition at line 53 of file CREMessageItemModel.h.

Referenced by data(), and setSelectedRule().

◆ myMessage

MessageFile* CREMessageItemModel::myMessage
protected

Message file currently displayed.

Definition at line 52 of file CREMessageItemModel.h.

Referenced by data(), duplicateRow(), insertRows(), moveUpDown(), removeRows(), rowCount(), setData(), setMessage(), and setSelectedRule().

◆ myRed

QSet<int> CREMessageItemModel::myRed
protected

Indexes of message rules that should be with a blue or red background.

Definition at line 53 of file CREMessageItemModel.h.

Referenced by data(), and setSelectedRule().


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