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