libquentier  0.8.0
The library for rich desktop clients of Evernote service
ISendStatus.h
1 /*
2  * Copyright 2022-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/synchronization/types/Errors.h>
22 #include <quentier/utility/Linkage.h>
23 #include <quentier/utility/Printable.h>
24 
25 #include <qevercloud/types/Note.h>
26 #include <qevercloud/types/Notebook.h>
27 #include <qevercloud/types/SavedSearch.h>
28 #include <qevercloud/types/Tag.h>
29 #include <qevercloud/types/TypeAliases.h>
30 
31 #include <QException>
32 #include <QList>
33 
34 #include <memory>
35 #include <utility>
36 
37 namespace quentier::synchronization {
38 
44 class QUENTIER_EXPORT ISendStatus : public utility::Printable
45 {
46 public:
47  using QExceptionPtr = std::shared_ptr<QException>;
48 
49  using NoteWithException = std::pair<qevercloud::Note, QExceptionPtr>;
50 
51  using NotebookWithException =
52  std::pair<qevercloud::Notebook, QExceptionPtr>;
53 
54  using SavedSearchWithException =
55  std::pair<qevercloud::SavedSearch, QExceptionPtr>;
56 
57  using TagWithException = std::pair<qevercloud::Tag, QExceptionPtr>;
58 
59 public:
60  // Total
61 
65  [[nodiscard]] virtual quint64 totalAttemptedToSendNotes() const = 0;
66 
70  [[nodiscard]] virtual quint64 totalAttemptedToSendNotebooks() const = 0;
71 
75  [[nodiscard]] virtual quint64 totalAttemptedToSendSavedSearches() const = 0;
76 
80  [[nodiscard]] virtual quint64 totalAttemptedToSendTags() const = 0;
81 
82  // Notes
83 
87  [[nodiscard]] virtual quint64 totalSuccessfullySentNotes() const = 0;
88 
93  [[nodiscard]] virtual QList<NoteWithException> failedToSendNotes()
94  const = 0;
95 
96  // Notebooks
97 
101  [[nodiscard]] virtual quint64 totalSuccessfullySentNotebooks() const = 0;
102 
107  [[nodiscard]] virtual QList<NotebookWithException> failedToSendNotebooks()
108  const = 0;
109 
110  // Saved searches
111 
115  [[nodiscard]] virtual quint64 totalSuccessfullySentSavedSearches()
116  const = 0;
117 
122  [[nodiscard]] virtual QList<SavedSearchWithException>
123  failedToSendSavedSearches() const = 0;
124 
125  // Tags
126 
130  [[nodiscard]] virtual quint64 totalSuccessfullySentTags() const = 0;
131 
136  [[nodiscard]] virtual QList<TagWithException> failedToSendTags() const = 0;
137 
138  // General
139 
145  [[nodiscard]] virtual StopSynchronizationError stopSynchronizationError()
146  const = 0;
147 
154  [[nodiscard]] virtual bool needToRepeatIncrementalSync() const = 0;
155 };
156 
157 } // namespace quentier::synchronization
Definition: synchronization/Factory.h:35
The Printable class is the interface for Quentier&#39;s internal classes which should be able to write th...
Definition: Printable.h:37
The ISendStatus interface represents the information about the attempt to send information either fro...
Definition: ISendStatus.h:44