Classified ads
Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CAListingModel Class Reference

Model-class for helping display of classified ads. More...

#include <calistingmodel.h>

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

Signals

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

Public Member Functions

 CAListingModel (const Hash &aForumToList, const MModelProtocolInterface &aModel, MController *aController)
 
 ~CAListingModel ()
 
QStandardItemModel * theCaModel ()
 
void setClassification (const Hash &aForumToList)
 
virtual void newCaReceived (const CA &aNewCa)
 
virtual void newCaReceived (const Hash &aHashNewCa, const Hash &aHashOfClassification)
 

Private Member Functions

bool insertCaIntoModel (const Hash &aArticleFingerPrint)
 

Private Attributes

QStandardItemModel iCaModel
 
Hash iForumToList
 
const MModelProtocolInterfaceiModel
 
QHash< int, QStandardItem * > * iItemAndArticleHashRelation
 
MControlleriController
 
QStandardItem * iListingHeaderDate
 
QStandardItem * iListingHeaderSubject
 

Detailed Description

Model-class for helping display of classified ads.

Constructor & Destructor Documentation

CAListingModel::CAListingModel ( const Hash aForumToList,
const MModelProtocolInterface aModel,
MController aController 
)

Constructor

Parameters
aForumToListspecifies the classification of the ads to include into model
CAListingModel::~CAListingModel ( )

Destructor

Member Function Documentation

void CAListingModel::error ( MController::CAErrorSituation  aError,
const QString &  aExplanation 
)
signal
bool CAListingModel::insertCaIntoModel ( const Hash aArticleFingerPrint)
private
virtual void CAListingModel::newCaReceived ( const CA aNewCa)
virtual

notification method telling abuot newly-persisted classified ad. From CAObserver.

Implements ClassifiedAdsModel::CAObserver.

virtual void CAListingModel::newCaReceived ( const Hash aHashNewCa,
const Hash aHashOfClassification 
)
virtual

Notification method telling abuot newly-persisted classified ad. Called from via controller.

void CAListingModel::setClassification ( const Hash aForumToList)

method for setting another forum to be listed

Parameters
aForumToListspecifies the forum
QStandardItemModel* CAListingModel::theCaModel ( )

method for getting the actual model for view to consume. ownership of the pointer is not transferred.

Member Data Documentation

QStandardItemModel CAListingModel::iCaModel
private

this model is exposed to UI

MController* CAListingModel::iController
private
Hash CAListingModel::iForumToList
private

this model lists exactly one forum at time, given here

QHash<int, QStandardItem *>* CAListingModel::iItemAndArticleHashRelation
private

This qhash contains pointers to items inside iCaModel but the key in hash is the low-order bits of the fingerprints of the articles as there seems to be no convenient way of finding items from model based on fingerprint, only search seems to be text-based

QStandardItem* CAListingModel::iListingHeaderDate
private
QStandardItem* CAListingModel::iListingHeaderSubject
private
const MModelProtocolInterface& CAListingModel::iModel
private

datamodel reference


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