libquentier  0.8.0
The library for rich desktop clients of Evernote service
NoteSearchQuery.h
1 /*
2  * Copyright 2016-2025 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 #pragma once
20 
21 #include <quentier/types/ErrorString.h>
22 
23 #include <QList>
24 #include <QSharedDataPointer>
25 
26 namespace quentier::local_storage {
27 
28 class QUENTIER_EXPORT NoteSearchQuery : public utility::Printable
29 {
30 public:
31  explicit NoteSearchQuery();
32 
33  NoteSearchQuery(const NoteSearchQuery & other);
34  NoteSearchQuery(NoteSearchQuery && other) noexcept;
35 
36  NoteSearchQuery & operator=(const NoteSearchQuery & other);
37  NoteSearchQuery & operator=(NoteSearchQuery && other) noexcept;
38 
39  ~NoteSearchQuery() override;
40 
41  [[nodiscard]] bool isEmpty() const;
42 
43  void clear();
44 
48  [[nodiscard]] QString queryString() const;
49 
50  [[nodiscard]] bool setQueryString(
51  const QString & queryString, ErrorString & error);
52 
58  [[nodiscard]] QString notebookModifier() const;
59 
60  [[nodiscard]] bool hasAnyModifier() const;
61 
62  [[nodiscard]] const QStringList & tagNames() const;
63  [[nodiscard]] const QStringList & negatedTagNames() const;
64  [[nodiscard]] bool hasAnyTag() const;
65  [[nodiscard]] bool hasNegatedAnyTag() const;
66 
67  [[nodiscard]] const QStringList & titleNames() const;
68  [[nodiscard]] const QStringList & negatedTitleNames() const;
69  [[nodiscard]] bool hasAnyTitleName() const;
70  [[nodiscard]] bool hasNegatedAnyTitleName() const;
71 
72  [[nodiscard]] const QList<qint64> & creationTimestamps() const;
73  [[nodiscard]] const QList<qint64> & negatedCreationTimestamps() const;
74  [[nodiscard]] bool hasAnyCreationTimestamp() const;
75  [[nodiscard]] bool hasNegatedAnyCreationTimestamp() const;
76 
77  [[nodiscard]] const QList<qint64> & modificationTimestamps() const;
78  [[nodiscard]] const QList<qint64> & negatedModificationTimestamps() const;
79  [[nodiscard]] bool hasAnyModificationTimestamp() const;
80  [[nodiscard]] bool hasNegatedAnyModificationTimestamp() const;
81 
82  [[nodiscard]] const QStringList & resourceMimeTypes() const;
83  [[nodiscard]] const QStringList & negatedResourceMimeTypes() const;
84  [[nodiscard]] bool hasAnyResourceMimeType() const;
85  [[nodiscard]] bool hasNegatedAnyResourceMimeType() const;
86 
87  [[nodiscard]] const QList<qint64> & subjectDateTimestamps() const;
88  [[nodiscard]] const QList<qint64> & negatedSubjectDateTimestamps() const;
89  [[nodiscard]] bool hasAnySubjectDateTimestamp() const;
90  [[nodiscard]] bool hasNegatedAnySubjectDateTimestamp() const;
91 
92  [[nodiscard]] const QList<double> & latitudes() const;
93  [[nodiscard]] const QList<double> & negatedLatitudes() const;
94  [[nodiscard]] bool hasAnyLatitude() const;
95  [[nodiscard]] bool hasNegatedAnyLatitude() const;
96 
97  [[nodiscard]] const QList<double> & longitudes() const;
98  [[nodiscard]] const QList<double> & negatedLongitudes() const;
99  [[nodiscard]] bool hasAnyLongitude() const;
100  [[nodiscard]] bool hasNegatedAnyLongitude() const;
101 
102  [[nodiscard]] const QList<double> & altitudes() const;
103  [[nodiscard]] const QList<double> & negatedAltitudes() const;
104  [[nodiscard]] bool hasAnyAltitude() const;
105  [[nodiscard]] bool hasNegatedAnyAltitude() const;
106 
107  [[nodiscard]] const QStringList & authors() const;
108  [[nodiscard]] const QStringList & negatedAuthors() const;
109  [[nodiscard]] bool hasAnyAuthor() const;
110  [[nodiscard]] bool hasNegatedAnyAuthor() const;
111 
112  [[nodiscard]] const QStringList & sources() const;
113  [[nodiscard]] const QStringList & negatedSources() const;
114  [[nodiscard]] bool hasAnySource() const;
115  [[nodiscard]] bool hasNegatedAnySource() const;
116 
117  [[nodiscard]] const QStringList & sourceApplications() const;
118  [[nodiscard]] const QStringList & negatedSourceApplications() const;
119  [[nodiscard]] bool hasAnySourceApplication() const;
120  [[nodiscard]] bool hasNegatedAnySourceApplication() const;
121 
122  [[nodiscard]] const QStringList & contentClasses() const;
123  [[nodiscard]] const QStringList & negatedContentClasses() const;
124  [[nodiscard]] bool hasAnyContentClass() const;
125  [[nodiscard]] bool hasNegatedAnyContentClass() const;
126 
127  [[nodiscard]] const QStringList & placeNames() const;
128  [[nodiscard]] const QStringList & negatedPlaceNames() const;
129  [[nodiscard]] bool hasAnyPlaceName() const;
130  [[nodiscard]] bool hasNegatedAnyPlaceName() const;
131 
132  [[nodiscard]] const QStringList & applicationData() const;
133  [[nodiscard]] const QStringList & negatedApplicationData() const;
134  [[nodiscard]] bool hasAnyApplicationData() const;
135  [[nodiscard]] bool hasNegatedAnyApplicationData() const;
136 
137  [[nodiscard]] const QList<qint64> & reminderOrders() const;
138  [[nodiscard]] const QList<qint64> & negatedReminderOrders() const;
139  [[nodiscard]] bool hasAnyReminderOrder() const;
140  [[nodiscard]] bool hasNegatedAnyReminderOrder() const;
141 
142  [[nodiscard]] const QList<qint64> & reminderTimes() const;
143  [[nodiscard]] const QList<qint64> & negatedReminderTimes() const;
144  [[nodiscard]] bool hasAnyReminderTime() const;
145  [[nodiscard]] bool hasNegatedAnyReminderTime() const;
146 
147  [[nodiscard]] const QList<qint64> & reminderDoneTimes() const;
148  [[nodiscard]] const QList<qint64> & negatedReminderDoneTimes() const;
149  [[nodiscard]] bool hasAnyReminderDoneTime() const;
150  [[nodiscard]] bool hasNegatedAnyReminderDoneTime() const;
151 
152  [[nodiscard]] bool hasUnfinishedToDo() const;
153  [[nodiscard]] bool hasNegatedUnfinishedToDo() const;
154 
155  [[nodiscard]] bool hasFinishedToDo() const;
156  [[nodiscard]] bool hasNegatedFinishedToDo() const;
157 
158  [[nodiscard]] bool hasAnyToDo() const;
159  [[nodiscard]] bool hasNegatedAnyToDo() const;
160 
161  [[nodiscard]] bool hasEncryption() const;
162  [[nodiscard]] bool hasNegatedEncryption() const;
163 
164  [[nodiscard]] const QStringList & contentSearchTerms() const;
165  [[nodiscard]] const QStringList & negatedContentSearchTerms() const;
166  [[nodiscard]] bool hasAnyContentSearchTerms() const;
167 
168  [[nodiscard]] bool isMatcheable() const;
169 
170  // utility::Printable
171  QTextStream & print(QTextStream & strm) const override;
172 
173 private:
174  class Data;
175  QSharedDataPointer<Data> d;
176 };
177 
178 [[nodiscard]] QUENTIER_EXPORT bool operator==(
179  const NoteSearchQuery & lhs, const NoteSearchQuery & rhs) noexcept;
180 
181 [[nodiscard]] QUENTIER_EXPORT bool operator!=(
182  const NoteSearchQuery & lhs, const NoteSearchQuery & rhs) noexcept;
183 
184 } // namespace quentier::local_storage
Definition: local_storage/Factory.h:30
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:42
The Printable class is the interface for Quentier&#39;s internal classes which should be able to write th...
Definition: Printable.h:37
Definition: NoteSearchQuery.h:28