libquentier  0.5.0
The library for rich desktop clients of Evernote service
SharedNote.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_SHARED_NOTE_H
20 #define LIB_QUENTIER_TYPES_SHARED_NOTE_H
21 
22 #include <quentier/utility/Printable.h>
23 #include <quentier/utility/Linkage.h>
24 
25 #include <qt5qevercloud/QEverCloud.h>
26 
27 #include <QSharedDataPointer>
28 
29 namespace quentier {
30 
31 QT_FORWARD_DECLARE_CLASS(SharedNoteData)
32 
33 class QUENTIER_EXPORT SharedNote: public Printable
34 {
35 public:
36  using SharedNotePrivilegeLevel = qevercloud::SharedNotePrivilegeLevel;
37  using ContactType = qevercloud::ContactType;
38 
39 public:
40  explicit SharedNote();
41  SharedNote(const SharedNote & other);
42  SharedNote(SharedNote && other);
43  explicit SharedNote(const qevercloud::SharedNote & sharedNote);
44  SharedNote & operator=(const SharedNote & other);
45  SharedNote & operator=(SharedNote && other);
46  virtual ~SharedNote() override;
47 
48  bool operator==(const SharedNote & other) const;
49  bool operator!=(const SharedNote & other) const;
50 
51  const qevercloud::SharedNote & qevercloudSharedNote() const;
52  qevercloud::SharedNote & qevercloudSharedNote();
53 
54  const QString & noteGuid() const;
55  void setNoteGuid(const QString & noteGuid);
56 
57  int indexInNote() const;
58  void setIndexInNote(const int index);
59 
60  bool hasSharerUserId() const;
61  qint32 sharerUserId() const;
62  void setSharerUserId(const qint32 id);
63 
64  bool hasRecipientIdentityId() const;
65  qint64 recipientIdentityId() const;
66  void setRecipientIdentityId(const qint64 identityId);
67 
68  bool hasRecipientIdentityContactName() const;
69  const QString & recipientIdentityContactName() const;
70 
71  void setRecipientIdentityContactName(
72  const QString & recipientIdentityContactName);
73 
74  bool hasRecipientIdentityContactId() const;
75  const QString & recipientIdentityContactId() const;
76 
77  void setRecipientIdentityContactId(
78  const QString & recipientIdentityContactId);
79 
80  bool hasRecipientIdentityContactType() const;
81  ContactType recipientIdentityContactType() const;
82 
83  void setRecipientIdentityContactType(
84  const ContactType recipientIdentityContactType);
85 
86  void setRecipientIdentityContactType(
87  const qint32 recipientIdentityContactType);
88 
89  bool hasRecipientIdentityContactPhotoUrl() const;
90  const QString & recipientIdentityContactPhotoUrl() const;
91 
92  void setRecipientIdentityContactPhotoUrl(
93  const QString & recipientIdentityPhotoUrl);
94 
95  bool hasRecipientIdentityContactPhotoLastUpdated() const;
96  qint64 recipientIdentityContactPhotoLastUpdated() const;
97 
98  void setRecipientIdentityContactPhotoLastUpdated(
99  const qint64 recipientIdentityPhotoLastUpdated);
100 
101  bool hasRecipientIdentityContactMessagingPermit() const;
102  const QByteArray & recipientIdentityContactMessagingPermit() const;
103 
104  void setRecipientIdentityContactMessagingPermit(
105  const QByteArray & messagingPermit);
106 
107  bool hasRecipientIdentityContactMessagingPermitExpires() const;
108  qint64 recipientIdentityContactMessagingPermitExpires() const;
109 
110  void setRecipientIdentityContactMessagingPermitExpires(
111  const qint64 timestamp);
112 
113  bool hasRecipientIdentityUserId() const;
114  qint32 recipientIdentityUserId() const;
115  void setRecipientIdentityUserId(const qint32 userId);
116 
117  bool hasRecipientIdentityDeactivated() const;
118  bool recipientIdentityDeactivated() const;
119  void setRecipientIdentityDeactivated(const bool deactivated);
120 
121  bool hasRecipientIdentitySameBusiness() const;
122  bool recipientIdentitySameBusiness() const;
123  void setRecipientIdentitySameBusiness(const bool sameBusiness);
124 
125  bool hasRecipientIdentityBlocked() const;
126  bool recipientIdentityBlocked() const;
127  void setRecipientIdentityBlocked(const bool blocked);
128 
129  bool hasRecipientIdentityUserConnected() const;
130  bool recipientIdentityUserConnected() const;
131  void setRecipientIdentityUserConnected(const bool userConnected);
132 
133  bool hasRecipientIdentityEventId() const;
134  qint64 recipientIdentityEventId() const;
135  void setRecipientIdentityEventId(const qint64 eventId);
136 
137  bool hasRecipientIdentity() const;
138  const qevercloud::Identity & recipientIdentity() const;
139  void setRecipientIdentity(qevercloud::Identity && identity);
140 
141  bool hasPrivilegeLevel() const;
142  SharedNotePrivilegeLevel privilegeLevel() const;
143  void setPrivilegeLevel(const SharedNotePrivilegeLevel level);
144  void setPrivilegeLevel(const qint8 level);
145 
146  bool hasCreationTimestamp() const;
147  qint64 creationTimestamp() const;
148  void setCreationTimestamp(const qint64 timestamp);
149 
150  bool hasModificationTimestamp() const;
151  qint64 modificationTimestamp() const;
152  void setModificationTimestamp(const qint64 timestamp);
153 
154  bool hasAssignmentTimestamp() const;
155  qint64 assignmentTimestamp() const;
156  void setAssignmentTimestamp(const qint64 timestamp);
157 
158  virtual QTextStream & print(QTextStream & strm) const override;
159 
160 private:
161  QSharedDataPointer<SharedNoteData> d;
162 };
163 
164 } // namespace quentier
165 
166 #endif // LIB_QUENTIER_TYPES_SHARED_NOTE_H
Definition: DecryptedTextManager.h:26
The Printable class is the interface for Quentier&#39;s internal classes which should be able to write th...
Definition: Printable.h:38
Definition: SharedNote.h:33