20 #ifndef FULLTEXTSEARCHMODEL_H
21 #define FULLTEXTSEARCHMODEL_H
23 #include <QAbstractListModel>
24 #include "../util/hash.h"
25 #include "../net/protocol.h"
26 #include "../mcontroller.h"
27 #include <QVariantMap>
79 bool aNetworkSeacrh =
false ) ;
84 virtual int rowCount(
const QModelIndex & parent = QModelIndex())
const ;
89 virtual QVariant
data(
const QModelIndex & index,
int role = Qt::DisplayRole)
const ;
94 QList<SearchModel::SearchResultItem>
performSearch(
const QString& aForString,
97 bool aSearchComments) ;
106 const Hash& aFromPeer) ;
121 quint32 aSearchId ) ;
133 QList<SearchModel::SearchResultItem>* aResults,
134 quint32* aSearchId ) ;
165 bool aWasUpdate =
false ) ;
171 bool* aSearchProfilesPtr,
172 bool* aSearchCommentsPtr,
173 Hash* aSearchIdPtr )
const ;
176 const QString& aExplanation) ;
static void createFTSTables()
void setSearchString(const QString &aSearch, bool aSearchAds, bool aSearchProfiles, bool aSearchComments, bool aNetworkSeacrh=false)
static bool deSerializeSearchResults(const QVariantMap &aResultJson, QList< SearchModel::SearchResultItem > *aResults, quint32 *aSearchId)
Model-class for performing text-based searches on objects in db This datamodel part is dual-use ; it ...
Definition: searchmodel.h:44
void appendNetworkSearchResults(const QList< SearchModel::SearchResultItem > &aResults, quint32 aSearchId, const Hash &aFromPeer)
static bool queryIfFTSSupported()
bool iSearchProfiles
Definition: searchmodel.h:186
ProtocolItemType iItemType
Definition: searchmodel.h:51
SearchModel(MModelProtocolInterface &aModel, MController &aController)
Hash iFoundFromNode
Definition: searchmodel.h:53
bool iSearchAds
Definition: searchmodel.h:185
Hash is class that carries 160-bit digest.
Definition: hash.h:37
CAErrorSituation
Definition: mcontroller.h:48
QString iSearchString
Definition: searchmodel.h:179
void indexClassifiedAd(const CA &aCa)
void indexProfile(const Profile &aProfile, bool aWasUpdate=false)
QString iDisplayName
Definition: searchmodel.h:54
ProtocolItemType
Definition: protocol.h:124
struct SearchModel::SearchResultItemStruct SearchResultItem
QTextDocument * iHtmlParser
Definition: searchmodel.h:181
void indexProfileComment(const ProfileComment &aProfileComment)
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
const bool iIsFTSSupported
Definition: searchmodel.h:180
void error(MController::CAErrorSituation aError, const QString &aExplanation)
Carrier-class for classified ad.
Definition: ca.h:34
Pure-virtual interface of datamodel for message parser to use.
Definition: mmodelprotocolinterface.h:44
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:39
bool operator==(const struct SearchResultItemStruct &a) const
QList< SearchResultItem > iDisplayedResults
Definition: searchmodel.h:182
Definition: searchmodel.h:50
MController & iController
Definition: searchmodel.h:183
void getSearchCriteria(QString *aSearchStrPtr, bool *aSearchAdsPtr, bool *aSearchProfilesPtr, bool *aSearchCommentsPtr, Hash *aSearchIdPtr) const
Hash iSearchId
Definition: searchmodel.h:184
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
QList< SearchModel::SearchResultItem > performSearch(const QString &aForString, bool aSearchAds, bool aSearchProfiles, bool aSearchComments)
Carrier-class for user-profile data.
Definition: profile.h:36
Hash iItemHash
Definition: searchmodel.h:52
MModelProtocolInterface & iModel
Definition: searchmodel.h:178
static QVariant serializeSearchResults(const QList< SearchModel::SearchResultItem > &aResults, quint32 aSearchId)
bool iSearchComments
Definition: searchmodel.h:187
bool isFTSSupported() const
Definition: searchmodel.h:139