Classified ads
Classes | Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
PrivateMessageSearchModel Class Reference

Model-class for performing search on private messages. This is supposed to act as an underlying data-container for an user-interface view (QListView etc.) More...

#include <privmsgsearchmodel.h>

Inheritance diagram for PrivateMessageSearchModel:
Inheritance graph
[legend]
Collaboration diagram for PrivateMessageSearchModel:
Collaboration graph
[legend]

Classes

struct  PrivateMessageListItem
 

Public Slots

void doUpdateDataOnIdle ()
 

Signals

void error (MController::CAErrorSituation aError, const QString &aExplanation)
 

Public Member Functions

 PrivateMessageSearchModel (Model &aModel, MController &aController)
 
 ~PrivateMessageSearchModel ()
 
void setSearchHash (const Hash &aSearch)
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
void setAsRead (const Hash &aMessage, bool aIsRead)
 
void newMsgReceived (const Hash &aMessage, const Hash &aRecipient)
 
void newMsgReceived (const PrivMessage &aMessage)
 

Private Member Functions

void performSearch ()
 
bool updateSenderAndSubjectOfMsg (PrivateMessageListItem &aItem)
 

Private Attributes

ModeliModel
 
MControlleriController
 
QList< PrivateMessageListItemiPrivateMessages
 
Hash iSearchHash
 
QIcon iLeftIcon
 
QIcon iRightIcon
 

Detailed Description

Model-class for performing search on private messages. This is supposed to act as an underlying data-container for an user-interface view (QListView etc.)

Constructor & Destructor Documentation

◆ PrivateMessageSearchModel()

PrivateMessageSearchModel::PrivateMessageSearchModel ( Model aModel,
MController aController 
)

◆ ~PrivateMessageSearchModel()

PrivateMessageSearchModel::~PrivateMessageSearchModel ( )

Member Function Documentation

◆ columnCount()

virtual int PrivateMessageSearchModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

re-implemented from QAbstractTableModel

Returns
number of columns in view

◆ data()

virtual QVariant PrivateMessageSearchModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
virtual

re-implemented from QAbstractListModel

Returns
data to display in list

◆ doUpdateDataOnIdle

void PrivateMessageSearchModel::doUpdateDataOnIdle ( )
slot

method called via QTimer::singleShot() that is used for filling missing parts (message subjects etc.) from data that model is listing

◆ error

void PrivateMessageSearchModel::error ( MController::CAErrorSituation  aError,
const QString &  aExplanation 
)
signal

◆ headerData()

virtual QVariant PrivateMessageSearchModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual

◆ newMsgReceived() [1/2]

void PrivateMessageSearchModel::newMsgReceived ( const Hash aMessage,
const Hash aRecipient 
)

notification method called when new private message is inserted into database

◆ newMsgReceived() [2/2]

void PrivateMessageSearchModel::newMsgReceived ( const PrivMessage aMessage)

notification method called when new private message is inserted into database , this variant is called from UI

◆ performSearch()

void PrivateMessageSearchModel::performSearch ( )
private

◆ rowCount()

virtual int PrivateMessageSearchModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

re-implemented from QAbstractTableModel

Returns
number of rows in list

◆ setAsRead()

void PrivateMessageSearchModel::setAsRead ( const Hash aMessage,
bool  aIsRead 
)

◆ setSearchHash()

void PrivateMessageSearchModel::setSearchHash ( const Hash aSearch)

Calling this method will populate the model with messages that are either sent by profile given in parameter, or destined to given profile.

Parameters
aSearchprofile fingerprint whose messages are the item of interest
Returns
no thing, always succeeds

◆ updateSenderAndSubjectOfMsg()

bool PrivateMessageSearchModel::updateSenderAndSubjectOfMsg ( PrivateMessageListItem aItem)
private

Updates single private message from database, e.g. tries to open encryption and everything

Returns
true on success

Member Data Documentation

◆ iController

MController& PrivateMessageSearchModel::iController
private

◆ iLeftIcon

QIcon PrivateMessageSearchModel::iLeftIcon
private

◆ iModel

Model& PrivateMessageSearchModel::iModel
private

◆ iPrivateMessages

QList<PrivateMessageListItem> PrivateMessageSearchModel::iPrivateMessages
private

◆ iRightIcon

QIcon PrivateMessageSearchModel::iRightIcon
private

◆ iSearchHash

Hash PrivateMessageSearchModel::iSearchHash
private

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