libquentier  0.4.0
The library for rich desktop clients of Evernote service
IFavoritableDataElement.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_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 : public virtual INoteStoreDataElement
32 {
33 public:
34  virtual bool isFavorited() const = 0;
35  virtual void setFavorited(const bool favorited) = 0;
36 
37  virtual ~IFavoritableDataElement() {}
38 };
39 
40 #define DECLARE_IS_FAVORITED \
41  virtual bool isFavorited() const Q_DECL_OVERRIDE;
42 
43 #define DECLARE_SET_FAVORITED \
44  virtual void setFavorited(const bool favorited) Q_DECL_OVERRIDE;
45 
46 #define QN_DECLARE_FAVORITED \
47  DECLARE_IS_FAVORITED \
48  DECLARE_SET_FAVORITED
49 
50 #define DEFINE_IS_FAVORITED(type) \
51  bool type::isFavorited() const { \
52  return d->m_isFavorited; \
53  }
54 
55 #define DEFINE_SET_FAVORITED(type) \
56  void type::setFavorited(const bool favorited) { \
57  d->m_isFavorited = favorited; \
58  }
59 
60 #define QN_DEFINE_FAVORITED(type) \
61  DEFINE_IS_FAVORITED(type) \
62  DEFINE_SET_FAVORITED(type)
63 
64 } // namespace quentier
65 
66 #endif // LIB_QUENTIER_TYPES_I_FAVORITABLE_DATA_ELEMENT_H
Definition: INoteStoreDataElement.h:30
Definition: IFavoritableDataElement.h:31