libquentier  0.5.0
The library for rich desktop clients of Evernote service
IFavoritableDataElement.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_I_FAVORITABLE_DATA_ELEMENT_H
20 #define LIB_QUENTIER_TYPES_I_FAVORITABLE_DATA_ELEMENT_H
21 
22 #include "INoteStoreDataElement.h"
23 
24 namespace quentier {
25 
31 class QUENTIER_EXPORT IFavoritableDataElement :
32  public virtual INoteStoreDataElement
33 {
34 public:
35  virtual bool isFavorited() const = 0;
36  virtual void setFavorited(const bool favorited) = 0;
37 
38  virtual ~IFavoritableDataElement() {}
39 };
40 
41 #define DECLARE_IS_FAVORITED \
42  virtual bool isFavorited() const override; \
43 // DECLARE_IS_FAVORITED
44 
45 #define DECLARE_SET_FAVORITED \
46  virtual void setFavorited(const bool favorited) override; \
47 // DECLARE_SET_FAVORITED
48 
49 #define QN_DECLARE_FAVORITED \
50  DECLARE_IS_FAVORITED \
51  DECLARE_SET_FAVORITED \
52 // QN_DECLARE_FAVORITED
53 
54 #define DEFINE_IS_FAVORITED(type) \
55  bool type::isFavorited() const { \
56  return d->m_isFavorited; \
57  } \
58 // DEFINE_IS_FAVORITED
59 
60 #define DEFINE_SET_FAVORITED(type) \
61  void type::setFavorited(const bool favorited) { \
62  d->m_isFavorited = favorited; \
63  } \
64 // DEFINE_SET_FAVORITED
65 
66 #define QN_DEFINE_FAVORITED(type) \
67  DEFINE_IS_FAVORITED(type) \
68  DEFINE_SET_FAVORITED(type) \
69 // QN_DEFINE_FAVORITED
70 
71 } // namespace quentier
72 
73 #endif // LIB_QUENTIER_TYPES_I_FAVORITABLE_DATA_ELEMENT_H
Definition: INoteStoreDataElement.h:32
Definition: DecryptedTextManager.h:26
Definition: IFavoritableDataElement.h:31