libquentier  0.5.0
The library for rich desktop clients of Evernote service
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 
28 namespace quentier {
29 
30 QT_FORWARD_DECLARE_CLASS(SharedNotebook)
31 QT_FORWARD_DECLARE_CLASS(User)
32 QT_FORWARD_DECLARE_CLASS(NotebookData)
33 
34 class QUENTIER_EXPORT Notebook: public IFavoritableDataElement
35 {
36 public:
37  QN_DECLARE_LOCAL_UID
38  QN_DECLARE_DIRTY
39  QN_DECLARE_LOCAL
40  QN_DECLARE_FAVORITED
41 
42 public:
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(const QString & publishingPublicDescription);
111 
112  bool hasPublished() const;
113  bool isPublished() const;
114  void setPublished(const bool published);
115 
116  bool hasStack() const;
117  const QString & stack() const;
118  void setStack(const QString & stack);
119 
120  bool hasSharedNotebooks();
121  QList<SharedNotebook> sharedNotebooks() const;
122  void setSharedNotebooks(QList<qevercloud::SharedNotebook> sharedNotebooks);
123  void setSharedNotebooks(QList<SharedNotebook> && notebooks);
124  void addSharedNotebook(const SharedNotebook & sharedNotebook);
125  void removeSharedNotebook(const SharedNotebook & sharedNotebook);
126 
127  bool hasBusinessNotebookDescription() const;
128  const QString & businessNotebookDescription() const;
129 
130  void setBusinessNotebookDescription(
131  const QString & businessNotebookDescription);
132 
133  bool hasBusinessNotebookPrivilegeLevel() const;
134  qint8 businessNotebookPrivilegeLevel() const;
135  void setBusinessNotebookPrivilegeLevel(const qint8 privilegeLevel);
136 
137  bool hasBusinessNotebookRecommended() const;
138  bool isBusinessNotebookRecommended() const;
139  void setBusinessNotebookRecommended(const bool recommended);
140 
141  bool hasContact() const;
142  const User contact() const;
143  void setContact(const User & contact);
144 
145  bool isLastUsed() const;
146  void setLastUsed(const bool lastUsed);
147 
148  bool canReadNotes() const;
149  void setCanReadNotes(const bool canReadNotes);
150 
151  bool canCreateNotes() const;
152  void setCanCreateNotes(const bool canCreateNotes);
153 
154  bool canUpdateNotes() const;
155  void setCanUpdateNotes(const bool canUpdateNotes);
156 
157  bool canExpungeNotes() const;
158  void setCanExpungeNotes(const bool canExpungeNotes);
159 
160  bool canShareNotes() const;
161  void setCanShareNotes(const bool canShareNotes);
162 
163  bool canEmailNotes() const;
164  void setCanEmailNotes(const bool canEmailNotes);
165 
166  bool canSendMessageToRecipients() const;
167  void setCanSendMessageToRecipients(const bool canSendMessageToRecipients);
168 
169  bool canUpdateNotebook() const;
170  void setCanUpdateNotebook(const bool canUpdateNotebook);
171 
172  bool canExpungeNotebook() const;
173  void setCanExpungeNotebook(const bool canExpungeNotebook);
174 
175  bool canSetDefaultNotebook() const;
176  void setCanSetDefaultNotebook(const bool canSetDefaultNotebook);
177 
178  bool canSetNotebookStack() const;
179  void setCanSetNotebookStack(const bool canSetNotebookStack);
180 
181  bool canPublishToPublic() const;
182  void setCanPublishToPublic(const bool canPublishToPublic);
183 
184  bool canPublishToBusinessLibrary() const;
185  void setCanPublishToBusinessLibrary(const bool canPublishToBusinessLibrary);
186 
187  bool canCreateTags() const;
188  void setCanCreateTags(const bool canCreateTags);
189 
190  bool canUpdateTags() const;
191  void setCanUpdateTags(const bool canUpdateTags);
192 
193  bool canExpungeTags() const;
194  void setCanExpungeTags(const bool canExpungeTags);
195 
196  bool canSetParentTag() const;
197  void setCanSetParentTag(const bool canSetParentTag);
198 
199  bool canCreateSharedNotebooks() const;
200  void setCanCreateSharedNotebooks(const bool canCreateSharedNotebooks);
201 
202  bool canShareNotesWithBusiness() const;
203  void setCanShareNotesWithBusiness(const bool canShareNotesWithBusiness);
204 
205  bool canRenameNotebook() const;
206  void setCanRenameNotebook(const bool canRenameNotebook);
207 
208  bool hasUpdateWhichSharedNotebookRestrictions() const;
209  qint8 updateWhichSharedNotebookRestrictions() const;
210  void setUpdateWhichSharedNotebookRestrictions(const qint8 which);
211 
212  bool hasExpungeWhichSharedNotebookRestrictions() const;
213  qint8 expungeWhichSharedNotebookRestrictions() const;
214  void setExpungeWhichSharedNotebookRestrictions(const qint8 which);
215 
216  bool hasRestrictions() const;
217  const qevercloud::NotebookRestrictions & restrictions() const;
218 
219  void setNotebookRestrictions(
220  qevercloud::NotebookRestrictions && restrictions);
221 
222  bool hasRecipientReminderNotifyEmail() const;
223  bool recipientReminderNotifyEmail() const;
224  void setRecipientReminderNotifyEmail(const bool notifyEmail);
225 
226  bool hasRecipientReminderNotifyInApp() const;
227  bool recipientReminderNotifyInApp() const;
228  void setRecipientReminderNotifyInApp(const bool notifyInApp);
229 
230  bool hasRecipientInMyList() const;
231  bool recipientInMyList() const;
232  void setRecipientInMyList(const bool inMyList);
233 
234  bool hasRecipientStack() const;
235  const QString & recipientStack() const;
236  void setRecipientStack(const QString & recipientString);
237 
238  bool hasRecipientSettings() const;
239  const qevercloud::NotebookRecipientSettings & recipientSettings() const;
240  void setNotebookRecipientSettings(qevercloud::NotebookRecipientSettings && settings);
241 
242  virtual QTextStream & print(QTextStream & strm) const override;
243 
244 private:
245  QSharedDataPointer<NotebookData> d;
246 };
247 
248 } // namespace quentier
249 
250 Q_DECLARE_METATYPE(quentier::Notebook)
251 
252 #endif // LIB_QUENTIER_TYPES_NOTEBOOK_H
quentier::SharedNotebook
Definition: SharedNotebook.h:32
quentier::ErrorString
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:43
quentier::Notebook
Definition: Notebook.h:34
quentier::User
Definition: User.h:33
quentier::IFavoritableDataElement
Definition: IFavoritableDataElement.h:31