libquentier 0.5.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
Notebook.h
1/*
2 * Copyright 2016-2020 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_TYPES_NOTEBOOK_H
20#define LIB_QUENTIER_TYPES_NOTEBOOK_H
21
22#include "IFavoritableDataElement.h"
23
24#include <qt5qevercloud/QEverCloud.h>
25
26#include <QSharedDataPointer>
27
28namespace quentier {
29
30QT_FORWARD_DECLARE_CLASS(SharedNotebook)
31QT_FORWARD_DECLARE_CLASS(User)
32QT_FORWARD_DECLARE_CLASS(NotebookData)
33
34class QUENTIER_EXPORT Notebook : public IFavoritableDataElement
35{
36public:
37 QN_DECLARE_LOCAL_UID
38 QN_DECLARE_DIRTY
39 QN_DECLARE_LOCAL
40 QN_DECLARE_FAVORITED
41
42public:
43 explicit Notebook();
44 Notebook(const Notebook & other);
45 Notebook(Notebook && other);
46 Notebook & operator=(const Notebook & other);
47 Notebook & operator=(Notebook && other);
48
49 explicit Notebook(const qevercloud::Notebook & other);
50 explicit Notebook(qevercloud::Notebook && other);
51 Notebook & operator=(const qevercloud::Notebook & other);
52 Notebook & operator=(qevercloud::Notebook && other);
53
54 virtual ~Notebook() override;
55
56 bool operator==(const Notebook & other) const;
57 bool operator!=(const Notebook & other) const;
58
59 const qevercloud::Notebook & qevercloudNotebook() const;
60 qevercloud::Notebook & qevercloudNotebook();
61
62 virtual void clear() override;
63
64 static bool validateName(
65 const QString & name, ErrorString * pErrorDescription = nullptr);
66
67 virtual bool hasGuid() const override;
68 virtual const QString & guid() const override;
69 virtual void setGuid(const QString & guid) override;
70
71 virtual bool hasUpdateSequenceNumber() const override;
72 virtual qint32 updateSequenceNumber() const override;
73 virtual void setUpdateSequenceNumber(const qint32 usn) override;
74
75 virtual bool checkParameters(ErrorString & errorDescription) const override;
76
77 bool hasName() const;
78 const QString & name() const;
79 void setName(const QString & name);
80
81 bool isDefaultNotebook() const;
82 void setDefaultNotebook(const bool defaultNotebook);
83
84 bool hasLinkedNotebookGuid() const;
85 const QString & linkedNotebookGuid() const;
86 void setLinkedNotebookGuid(const QString & linkedNotebookGuid);
87
88 bool hasCreationTimestamp() const;
89 qint64 creationTimestamp() const;
90 void setCreationTimestamp(const qint64 timestamp);
91
92 bool hasModificationTimestamp() const;
93 qint64 modificationTimestamp() const;
94 void setModificationTimestamp(const qint64 timestamp);
95
96 bool hasPublishingUri() const;
97 const QString & publishingUri() const;
98 void setPublishingUri(const QString & uri);
99
100 bool hasPublishingOrder() const;
101 qint8 publishingOrder() const;
102 void setPublishingOrder(const qint8 order);
103
104 bool hasPublishingAscending() const;
105 bool isPublishingAscending() const;
106 void setPublishingAscending(const bool ascending);
107
108 bool hasPublishingPublicDescription() const;
109 const QString & publishingPublicDescription() const;
110 void setPublishingPublicDescription(
111 const QString & publishingPublicDescription);
112
113 bool hasPublished() const;
114 bool isPublished() const;
115 void setPublished(const bool published);
116
117 bool hasStack() const;
118 const QString & stack() const;
119 void setStack(const QString & stack);
120
121 bool hasSharedNotebooks();
122 QList<SharedNotebook> sharedNotebooks() const;
123 void setSharedNotebooks(QList<qevercloud::SharedNotebook> sharedNotebooks);
124 void setSharedNotebooks(QList<SharedNotebook> && notebooks);
125 void addSharedNotebook(const SharedNotebook & sharedNotebook);
126 void removeSharedNotebook(const SharedNotebook & sharedNotebook);
127
128 bool hasBusinessNotebookDescription() const;
129 const QString & businessNotebookDescription() const;
130
131 void setBusinessNotebookDescription(
132 const QString & businessNotebookDescription);
133
134 bool hasBusinessNotebookPrivilegeLevel() const;
135 qint8 businessNotebookPrivilegeLevel() const;
136 void setBusinessNotebookPrivilegeLevel(const qint8 privilegeLevel);
137
138 bool hasBusinessNotebookRecommended() const;
139 bool isBusinessNotebookRecommended() const;
140 void setBusinessNotebookRecommended(const bool recommended);
141
142 bool hasContact() const;
143 const User contact() const;
144 void setContact(const User & contact);
145
146 bool isLastUsed() const;
147 void setLastUsed(const bool lastUsed);
148
149 bool canReadNotes() const;
150 void setCanReadNotes(const bool canReadNotes);
151
152 bool canCreateNotes() const;
153 void setCanCreateNotes(const bool canCreateNotes);
154
155 bool canUpdateNotes() const;
156 void setCanUpdateNotes(const bool canUpdateNotes);
157
158 bool canExpungeNotes() const;
159 void setCanExpungeNotes(const bool canExpungeNotes);
160
161 bool canShareNotes() const;
162 void setCanShareNotes(const bool canShareNotes);
163
164 bool canEmailNotes() const;
165 void setCanEmailNotes(const bool canEmailNotes);
166
167 bool canSendMessageToRecipients() const;
168 void setCanSendMessageToRecipients(const bool canSendMessageToRecipients);
169
170 bool canUpdateNotebook() const;
171 void setCanUpdateNotebook(const bool canUpdateNotebook);
172
173 bool canExpungeNotebook() const;
174 void setCanExpungeNotebook(const bool canExpungeNotebook);
175
176 bool canSetDefaultNotebook() const;
177 void setCanSetDefaultNotebook(const bool canSetDefaultNotebook);
178
179 bool canSetNotebookStack() const;
180 void setCanSetNotebookStack(const bool canSetNotebookStack);
181
182 bool canPublishToPublic() const;
183 void setCanPublishToPublic(const bool canPublishToPublic);
184
185 bool canPublishToBusinessLibrary() const;
186 void setCanPublishToBusinessLibrary(const bool canPublishToBusinessLibrary);
187
188 bool canCreateTags() const;
189 void setCanCreateTags(const bool canCreateTags);
190
191 bool canUpdateTags() const;
192 void setCanUpdateTags(const bool canUpdateTags);
193
194 bool canExpungeTags() const;
195 void setCanExpungeTags(const bool canExpungeTags);
196
197 bool canSetParentTag() const;
198 void setCanSetParentTag(const bool canSetParentTag);
199
200 bool canCreateSharedNotebooks() const;
201 void setCanCreateSharedNotebooks(const bool canCreateSharedNotebooks);
202
203 bool canShareNotesWithBusiness() const;
204 void setCanShareNotesWithBusiness(const bool canShareNotesWithBusiness);
205
206 bool canRenameNotebook() const;
207 void setCanRenameNotebook(const bool canRenameNotebook);
208
209 bool hasUpdateWhichSharedNotebookRestrictions() const;
210 qint8 updateWhichSharedNotebookRestrictions() const;
211 void setUpdateWhichSharedNotebookRestrictions(const qint8 which);
212
213 bool hasExpungeWhichSharedNotebookRestrictions() const;
214 qint8 expungeWhichSharedNotebookRestrictions() const;
215 void setExpungeWhichSharedNotebookRestrictions(const qint8 which);
216
217 bool hasRestrictions() const;
218 const qevercloud::NotebookRestrictions & restrictions() const;
219
220 void setNotebookRestrictions(
221 qevercloud::NotebookRestrictions && restrictions);
222
223 bool hasRecipientReminderNotifyEmail() const;
224 bool recipientReminderNotifyEmail() const;
225 void setRecipientReminderNotifyEmail(const bool notifyEmail);
226
227 bool hasRecipientReminderNotifyInApp() const;
228 bool recipientReminderNotifyInApp() const;
229 void setRecipientReminderNotifyInApp(const bool notifyInApp);
230
231 bool hasRecipientInMyList() const;
232 bool recipientInMyList() const;
233 void setRecipientInMyList(const bool inMyList);
234
235 bool hasRecipientStack() const;
236 const QString & recipientStack() const;
237 void setRecipientStack(const QString & recipientString);
238
239 bool hasRecipientSettings() const;
240 const qevercloud::NotebookRecipientSettings & recipientSettings() const;
241 void setNotebookRecipientSettings(
242 qevercloud::NotebookRecipientSettings && settings);
243
244 virtual QTextStream & print(QTextStream & strm) const override;
245
246private:
247 QSharedDataPointer<NotebookData> d;
248};
249
250} // namespace quentier
251
252Q_DECLARE_METATYPE(quentier::Notebook)
253
254#endif // LIB_QUENTIER_TYPES_NOTEBOOK_H
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition ErrorString.h:44
Definition IFavoritableDataElement.h:33
Definition Notebook.h:35
Definition SharedNotebook.h:33
Definition User.h:34