File indexing completed on 2024-12-22 03:46:48

0001 /*
0002   This file is part of the KTextTemplate library
0003 
0004   SPDX-FileCopyrightText: 2009 Stephen Kelly <steveire@gmail.com>
0005 
0006   SPDX-License-Identifier: LGPL-2.1-or-later
0007 
0008 */
0009 
0010 #ifndef BOOK_WRAPPER_H
0011 #define BOOK_WRAPPER_H
0012 
0013 #include <QObject>
0014 
0015 class BookWrapper : public QObject
0016 {
0017     Q_OBJECT
0018     Q_PROPERTY(QString author READ author)
0019     Q_PROPERTY(QString title READ title)
0020     Q_PROPERTY(QString genre READ genre)
0021     Q_PROPERTY(int rating READ rating)
0022 public:
0023     BookWrapper(QString author, QString title, QString genre, int rating, QObject *parent = 0)
0024         : QObject(parent)
0025         , m_author(author)
0026         , m_title(title)
0027         , m_genre(genre)
0028         , m_rating(rating)
0029     {
0030     }
0031 
0032     QString author()
0033     {
0034         return m_author;
0035     }
0036     QString title()
0037     {
0038         return m_title;
0039     }
0040     QString genre()
0041     {
0042         return m_genre;
0043     }
0044     int rating()
0045     {
0046         return m_rating;
0047     }
0048 
0049 private:
0050     QString m_title;
0051     QString m_author;
0052     QString m_genre;
0053     int m_rating;
0054 };
0055 
0056 #endif