libquentier  0.4.0
The library for rich desktop clients of Evernote service
NoteSearchQuery.h
1 /*
2  * Copyright 2016 Dmitry Ivanov
3  *
4  * This file is part of libquentier
5  *
6  * libquentier is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, version 3 of the License.
9  *
10  * libquentier is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef LIB_QUENTIER_LOCAL_STORAGE_NOTE_SEARCH_QUERY_H
20 #define LIB_QUENTIER_LOCAL_STORAGE_NOTE_SEARCH_QUERY_H
21 
22 #include <quentier/types/ErrorString.h>
23 #include <QSharedDataPointer>
24 
25 namespace quentier {
26 
27 QT_FORWARD_DECLARE_CLASS(NoteSearchQueryData)
28 
29 class QUENTIER_EXPORT NoteSearchQuery: public Printable
30 {
31 public:
33  NoteSearchQuery(const NoteSearchQuery & other);
35  NoteSearchQuery & operator=(const NoteSearchQuery & other);
36  NoteSearchQuery & operator=(NoteSearchQuery && other);
37  virtual ~NoteSearchQuery();
38 
39  bool isEmpty() const;
40 
41  void clear();
42 
46  const QString queryString() const;
47 
48  bool setQueryString(const QString & queryString, ErrorString & error);
49 
55  const QString notebookModifier() const;
56 
57  bool hasAnyModifier() const;
58 
59  const QStringList & tagNames() const;
60  const QStringList & negatedTagNames() const;
61  bool hasAnyTag() const;
62  bool hasNegatedAnyTag() const;
63 
64  const QStringList & titleNames() const;
65  const QStringList & negatedTitleNames() const;
66  bool hasAnyTitleName() const;
67  bool hasNegatedAnyTitleName() const;
68 
69  const QVector<qint64> & creationTimestamps() const;
70  const QVector<qint64> & negatedCreationTimestamps() const;
71  bool hasAnyCreationTimestamp() const;
72  bool hasNegatedAnyCreationTimestamp() const;
73 
74  const QVector<qint64> & modificationTimestamps() const;
75  const QVector<qint64> & negatedModificationTimestamps() const;
76  bool hasAnyModificationTimestamp() const;
77  bool hasNegatedAnyModificationTimestamp() const;
78 
79  const QStringList & resourceMimeTypes() const;
80  const QStringList & negatedResourceMimeTypes() const;
81  bool hasAnyResourceMimeType() const;
82  bool hasNegatedAnyResourceMimeType() const;
83 
84  const QVector<qint64> & subjectDateTimestamps() const;
85  const QVector<qint64> & negatedSubjectDateTimestamps() const;
86  bool hasAnySubjectDateTimestamp() const;
87  bool hasNegatedAnySubjectDateTimestamp() const;
88 
89  const QVector<double> & latitudes() const;
90  const QVector<double> & negatedLatitudes() const;
91  bool hasAnyLatitude() const;
92  bool hasNegatedAnyLatitude() const;
93 
94  const QVector<double> & longitudes() const;
95  const QVector<double> & negatedLongitudes() const;
96  bool hasAnyLongitude() const;
97  bool hasNegatedAnyLongitude() const;
98 
99  const QVector<double> & altitudes() const;
100  const QVector<double> & negatedAltitudes() const;
101  bool hasAnyAltitude() const;
102  bool hasNegatedAnyAltitude() const;
103 
104  const QStringList & authors() const;
105  const QStringList & negatedAuthors() const;
106  bool hasAnyAuthor() const;
107  bool hasNegatedAnyAuthor() const;
108 
109  const QStringList & sources() const;
110  const QStringList & negatedSources() const;
111  bool hasAnySource() const;
112  bool hasNegatedAnySource() const;
113 
114  const QStringList & sourceApplications() const;
115  const QStringList & negatedSourceApplications() const;
116  bool hasAnySourceApplication() const;
117  bool hasNegatedAnySourceApplication() const;
118 
119  const QStringList & contentClasses() const;
120  const QStringList & negatedContentClasses() const;
121  bool hasAnyContentClass() const;
122  bool hasNegatedAnyContentClass() const;
123 
124  const QStringList & placeNames() const;
125  const QStringList & negatedPlaceNames() const;
126  bool hasAnyPlaceName() const;
127  bool hasNegatedAnyPlaceName() const;
128 
129  const QStringList & applicationData() const;
130  const QStringList & negatedApplicationData() const;
131  bool hasAnyApplicationData() const;
132  bool hasNegatedAnyApplicationData() const;
133 
134  const QVector<qint64> & reminderOrders() const;
135  const QVector<qint64> & negatedReminderOrders() const;
136  bool hasAnyReminderOrder() const;
137  bool hasNegatedAnyReminderOrder() const;
138 
139  const QVector<qint64> & reminderTimes() const;
140  const QVector<qint64> & negatedReminderTimes() const;
141  bool hasAnyReminderTime() const;
142  bool hasNegatedAnyReminderTime() const;
143 
144  const QVector<qint64> & reminderDoneTimes() const;
145  const QVector<qint64> & negatedReminderDoneTimes() const;
146  bool hasAnyReminderDoneTime() const;
147  bool hasNegatedAnyReminderDoneTime() const;
148 
149  bool hasUnfinishedToDo() const;
150  bool hasNegatedUnfinishedToDo() const;
151 
152  bool hasFinishedToDo() const;
153  bool hasNegatedFinishedToDo() const;
154 
155  bool hasAnyToDo() const;
156  bool hasNegatedAnyToDo() const;
157 
158  bool hasEncryption() const;
159  bool hasNegatedEncryption() const;
160 
161  const QStringList & contentSearchTerms() const;
162  const QStringList & negatedContentSearchTerms() const;
163  bool hasAnyContentSearchTerms() const;
164 
165  bool isMatcheable() const;
166 
167  virtual QTextStream & print(QTextStream & strm) const Q_DECL_OVERRIDE;
168 
169 private:
170  QSharedDataPointer<NoteSearchQueryData> d;
171 };
172 
173 } // namespace quentier
174 
175 #endif // LIB_QUENTIER_LOCAL_STORAGE_NOTE_SEARCH_QUERY_H
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:38
The Printable class is the interface for Quentier's internal classes which should be able to write th...
Definition: Printable.h:54
Definition: NoteSearchQuery.h:29