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