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