libquentier  0.5.0
The library for rich desktop clients of Evernote service
LinkedNotebook.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_LINKED_NOTEBOOK_H
20 #define LIB_QUENTIER_TYPES_LINKED_NOTEBOOK_H
21 
22 #include "INoteStoreDataElement.h"
23 
24 #include <qt5qevercloud/QEverCloud.h>
25 
26 #include <QSharedDataPointer>
27 
28 namespace quentier {
29 
30 QT_FORWARD_DECLARE_CLASS(LinkedNotebookData)
31 
32 class QUENTIER_EXPORT LinkedNotebook: public INoteStoreDataElement
33 {
34 public:
35  QN_DECLARE_DIRTY
36 
37 public:
38  explicit LinkedNotebook();
39  LinkedNotebook(const LinkedNotebook & other);
41  LinkedNotebook & operator=(const LinkedNotebook & other);
42  LinkedNotebook & operator=(LinkedNotebook && other);
43 
44  explicit LinkedNotebook(const qevercloud::LinkedNotebook & linkedNotebook);
45  explicit LinkedNotebook(qevercloud::LinkedNotebook && linkedNotebook);
46 
47  virtual ~LinkedNotebook() override;
48 
49  const qevercloud::LinkedNotebook & qevercloudLinkedNotebook() const;
50  qevercloud::LinkedNotebook & qevercloudLinkedNotebook();
51 
52  bool operator==(const LinkedNotebook & other) const;
53  bool operator!=(const LinkedNotebook & other) const;
54 
55  virtual void clear() override;
56 
57  virtual bool hasGuid() const override;
58  virtual const QString & guid() const override;
59  virtual void setGuid(const QString & guid) override;
60 
61  virtual bool hasUpdateSequenceNumber() const override;
62  virtual qint32 updateSequenceNumber() const override;
63  virtual void setUpdateSequenceNumber(const qint32 usn) override;
64 
65  virtual bool checkParameters(ErrorString & errorDescription) const override;
66 
67  bool hasShareName() const;
68  const QString & shareName() const;
69  void setShareName(const QString & shareName);
70 
71  bool hasUsername() const;
72  const QString & username() const;
73  void setUsername(const QString & username);
74 
75  bool hasShardId() const;
76  const QString & shardId() const;
77  void setShardId(const QString & shardId);
78 
79  bool hasSharedNotebookGlobalId() const;
80  const QString & sharedNotebookGlobalId() const;
81  void setSharedNotebookGlobalId(const QString & sharedNotebookGlobalId);
82 
83  bool hasUri() const;
84  const QString & uri() const;
85  void setUri(const QString & uri);
86 
87  bool hasNoteStoreUrl() const;
88  const QString & noteStoreUrl() const;
89  void setNoteStoreUrl(const QString & noteStoreUrl);
90 
91  bool hasWebApiUrlPrefix() const;
92  const QString & webApiUrlPrefix() const;
93  void setWebApiUrlPrefix(const QString & webApiUrlPrefix);
94 
95  bool hasStack() const;
96  const QString & stack() const;
97  void setStack(const QString & stack);
98 
99  bool hasBusinessId() const;
100  qint32 businessId() const;
101  void setBusinessId(const qint32 businessId);
102 
103  virtual QTextStream & print(QTextStream & strm) const override;
104 
105 private:
106  // hide useless methods inherited from the base class from public interface
107  virtual const QString localUid() const override { return QString(); }
108  virtual void setLocalUid(const QString &) override {}
109  virtual void unsetLocalUid() override {}
110 
111  virtual bool isLocal() const override { return false; }
112  virtual void setLocal(const bool) override {}
113 
114 private:
115  QSharedDataPointer<LinkedNotebookData> d;
116 };
117 
118 } // namespace quentier
119 
120 Q_DECLARE_METATYPE(quentier::LinkedNotebook)
121 
122 #endif // LIB_QUENTIER_TYPES_LINKED_NOTEBOOK_H
quentier::INoteStoreDataElement
Definition: INoteStoreDataElement.h:32
quentier::ErrorString
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:43
quentier::LinkedNotebook
Definition: LinkedNotebook.h:32