libquentier  0.4.0
The library for rich desktop clients of Evernote service
Tag.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_TAG_H
20 #define LIB_QUENTIER_TYPES_TAG_H
21 
22 #include "IFavoritableDataElement.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(TagData)
35 
36 class QUENTIER_EXPORT Tag: public IFavoritableDataElement
37 {
38 public:
39  QN_DECLARE_LOCAL_UID
40  QN_DECLARE_DIRTY
41  QN_DECLARE_LOCAL
42  QN_DECLARE_FAVORITED
43 
44 public:
45  explicit Tag();
46  Tag(const Tag & other);
47  Tag(Tag && other);
48  Tag & operator=(const Tag & other);
49  Tag & operator=(Tag && other);
50 
51  explicit Tag(const qevercloud::Tag & other);
52  explicit Tag(qevercloud::Tag && other);
53 
54  virtual ~Tag();
55 
56  bool operator==(const Tag & other) const;
57  bool operator!=(const Tag & other) const;
58 
59  const qevercloud::Tag & qevercloudTag() const;
60  qevercloud::Tag & qevercloudTag();
61 
62  virtual void clear() Q_DECL_OVERRIDE;
63 
64  static bool validateName(const QString & name, ErrorString * pErrorDescription = Q_NULLPTR);
65 
66  virtual bool hasGuid() const Q_DECL_OVERRIDE;
67  virtual const QString & guid() const Q_DECL_OVERRIDE;
68  virtual void setGuid(const QString & guid) Q_DECL_OVERRIDE;
69 
70  virtual bool hasUpdateSequenceNumber() const Q_DECL_OVERRIDE;
71  virtual qint32 updateSequenceNumber() const Q_DECL_OVERRIDE;
72  virtual void setUpdateSequenceNumber(const qint32 usn) Q_DECL_OVERRIDE;
73 
74  virtual bool checkParameters(ErrorString & errorDescription) const Q_DECL_OVERRIDE;
75 
76  bool hasName() const;
77  const QString & name() const;
78  void setName(const QString & name);
79 
80  bool hasParentGuid() const;
81  const QString & parentGuid() const;
82  void setParentGuid(const QString & parentGuid);
83 
84  bool hasParentLocalUid() const;
85  const QString & parentLocalUid() const;
86  void setParentLocalUid(const QString & parentLocalUid);
87 
88  bool hasLinkedNotebookGuid() const;
89  const QString & linkedNotebookGuid() const;
90  void setLinkedNotebookGuid(const QString & linkedNotebookGuid);
91 
92  virtual QTextStream & print(QTextStream & strm) const Q_DECL_OVERRIDE;
93 
94 private:
95  QSharedDataPointer<TagData> d;
96 };
97 
98 } // namespace quentier
99 
100 Q_DECLARE_METATYPE(quentier::Tag)
101 
102 #endif // LIB_QUENTIER_TYPES_TAG_H
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:38
Definition: Tag.h:36
Definition: IFavoritableDataElement.h:31