21 #ifndef FULLTEXTSEARCHMODEL_H 22 #define FULLTEXTSEARCHMODEL_H 24 #include <QAbstractListModel> 25 #include "../util/hash.h" 26 #include "../net/protocol.h" 27 #include "../mcontroller.h" 28 #include <QVariantMap> 80 bool aNetworkSeacrh =
false ) ;
85 virtual int rowCount(
const QModelIndex & parent = QModelIndex())
const ;
90 virtual QVariant
data(
const QModelIndex & index,
int role = Qt::DisplayRole)
const ;
95 QList<SearchModel::SearchResultItem>
performSearch(
const QString& aForString,
98 bool aSearchComments) ;
107 const Hash& aFromPeer) ;
122 quint32 aSearchId ) ;
134 QList<SearchModel::SearchResultItem>* aResults,
135 quint32* aSearchId ) ;
168 bool aWasUpdate =
false ) ;
174 bool* aSearchProfilesPtr,
175 bool* aSearchCommentsPtr,
176 Hash* aSearchIdPtr )
const ;
179 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:45
void appendNetworkSearchResults(const QList< SearchModel::SearchResultItem > &aResults, quint32 aSearchId, const Hash &aFromPeer)
static bool queryIfFTSSupported()
bool iSearchProfiles
Definition: searchmodel.h:188
ProtocolItemType iItemType
Definition: searchmodel.h:52
SearchModel(MModelProtocolInterface &aModel, MController &aController)
Hash iFoundFromNode
Definition: searchmodel.h:54
bool iSearchAds
Definition: searchmodel.h:187
Hash is class that carries 160-bit digest.
Definition: hash.h:38
CAErrorSituation
Definition: mcontroller.h:52
QString iSearchString
Definition: searchmodel.h:182
void indexClassifiedAd(const CA &aCa)
void indexProfile(const Profile &aProfile, bool aWasUpdate=false)
QString iDisplayName
Definition: searchmodel.h:55
ProtocolItemType
Definition: protocol.h:150
struct SearchModel::SearchResultItemStruct SearchResultItem
void indexProfileComment(const ProfileComment &aProfileComment)
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
const bool iIsFTSSupported
Definition: searchmodel.h:183
void error(MController::CAErrorSituation aError, const QString &aExplanation)
Carrier-class for classified ad.
Definition: ca.h:35
Pure-virtual interface of datamodel for message parser to use.
Definition: mmodelprotocolinterface.h:45
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:43
bool operator==(const struct SearchResultItemStruct &a) const
QList< SearchResultItem > iDisplayedResults
Definition: searchmodel.h:184
Definition: searchmodel.h:51
MController & iController
Definition: searchmodel.h:185
void getSearchCriteria(QString *aSearchStrPtr, bool *aSearchAdsPtr, bool *aSearchProfilesPtr, bool *aSearchCommentsPtr, Hash *aSearchIdPtr) const
Hash iSearchId
Definition: searchmodel.h:186
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:37
Hash iItemHash
Definition: searchmodel.h:53
MModelProtocolInterface & iModel
Definition: searchmodel.h:181
static QVariant serializeSearchResults(const QList< SearchModel::SearchResultItem > &aResults, quint32 aSearchId)
bool iSearchComments
Definition: searchmodel.h:189
bool isFTSSupported() const
Definition: searchmodel.h:140