NepomukDaemons
query.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _NEPOMUK_SEARCH_QUERY_H_
00021 #define _NEPOMUK_SEARCH_QUERY_H_
00022
00023 #include <QtCore/QSharedDataPointer>
00024 #include <QtCore/QList>
00025 #include <QtCore/QPair>
00026 #include <QtCore/QDebug>
00027
00028 #include <nepomuk/nepomuk_export.h>
00029
00030 class QUrl;
00031
00032 namespace Nepomuk {
00033 namespace Search {
00034
00035 class Term;
00036
00047 class NEPOMUK_EXPORT Query
00048 {
00049 public:
00050 enum Type {
00051 InvalidQuery,
00052 PlainQuery,
00053 SPARQLQuery
00054 };
00055
00059 Query();
00060
00065 Query( const Term& term );
00066
00070 explicit Query( const QString& sparqlQuery );
00071
00075 Query( const Query& );
00076
00080 ~Query();
00081
00085 Query& operator=( const Query& );
00086
00087 Type type() const;
00088 Term term() const;
00089 QString sparqlQuery() const;
00090 int limit() const;
00091
00092 void setTerm( const Term& );
00093 void setSparqlQuery( const QString& );
00094 void setLimit( int );
00095
00102 void addRequestProperty( const QUrl& property, bool optional = true );
00103 void clearRequestProperties();
00104
00105 typedef QPair<QUrl, bool> RequestProperty;
00106
00107 QList<RequestProperty> requestProperties() const;
00108
00109 bool operator==( const Query& ) const;
00110
00111 private:
00112 class Private;
00113 QSharedDataPointer<Private> d;
00114 };
00115
00116 NEPOMUK_EXPORT uint qHash( const Nepomuk::Search::Query& );
00117 }
00118 }
00119
00120 NEPOMUK_EXPORT QDebug operator<<( QDebug, const Nepomuk::Search::Query& );
00121
00122 #endif