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 ( Model aModel,
MController aController 
)
PrivateMessageSearchModel::~PrivateMessageSearchModel ( )

Member Function Documentation

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

re-implemented from QAbstractTableModel

Returns
number of columns in view
virtual QVariant PrivateMessageSearchModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
virtual

re-implemented from QAbstractListModel

Returns
data to display in list
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

void PrivateMessageSearchModel::error ( MController::CAErrorSituation  aError,
const QString &  aExplanation 
)
signal
virtual QVariant PrivateMessageSearchModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual
void PrivateMessageSearchModel::newMsgReceived ( const Hash aMessage,
const Hash aRecipient 
)

notification method called when new private message is inserted into database

void PrivateMessageSearchModel::newMsgReceived ( const PrivMessage aMessage)

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

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

re-implemented from QAbstractTableModel

Returns
number of rows in list
void PrivateMessageSearchModel::setAsRead ( const Hash aMessage,
bool  aIsRead 
)
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
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

MController& PrivateMessageSearchModel::iController
private
QIcon PrivateMessageSearchModel::iLeftIcon
private
Model& PrivateMessageSearchModel::iModel
private
QList<PrivateMessageListItem> PrivateMessageSearchModel::iPrivateMessages
private
QIcon PrivateMessageSearchModel::iRightIcon
private
Hash PrivateMessageSearchModel::iSearchHash
private

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