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::CAListingModel ( const Hash aForumToList,
const MModelProtocolInterface aModel,
MController aController 
)

Constructor

Parameters
aForumToListspecifies the classification of the ads to include into model

◆ ~CAListingModel()

CAListingModel::~CAListingModel ( )

Destructor

Member Function Documentation

◆ error

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

◆ insertCaIntoModel()

bool CAListingModel::insertCaIntoModel ( const Hash aArticleFingerPrint)
private

◆ newCaReceived() [1/2]

virtual void CAListingModel::newCaReceived ( const CA aNewCa)
virtual

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

Implements ClassifiedAdsModel::CAObserver.

◆ newCaReceived() [2/2]

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

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

◆ setClassification()

void CAListingModel::setClassification ( const Hash aForumToList)

method for setting another forum to be listed

Parameters
aForumToListspecifies the forum

◆ theCaModel()

QStandardItemModel* CAListingModel::theCaModel ( )

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

Member Data Documentation

◆ iCaModel

QStandardItemModel CAListingModel::iCaModel
private

this model is exposed to UI

◆ iController

MController* CAListingModel::iController
private

◆ iForumToList

Hash CAListingModel::iForumToList
private

this model lists exactly one forum at time, given here

◆ iItemAndArticleHashRelation

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

◆ iListingHeaderDate

QStandardItem* CAListingModel::iListingHeaderDate
private

◆ iListingHeaderSubject

QStandardItem* CAListingModel::iListingHeaderSubject
private

◆ iModel

const MModelProtocolInterface& CAListingModel::iModel
private

datamodel reference


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