1 /*
2  * This file is part of the KDE project
3  *
4  * Copyright (C) 2013 Shantanu Tushar <shantanu@kde.org>
5  * Copyright (C) 2013 Sujith Haridasan <sujith.h@gmail.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  */
23 
24 #ifndef CQTEXTDOCUMENTMODEL_H
25 #define CQTEXTDOCUMENTMODEL_H
26 
27 #include <QAbstractListModel>
28 #include <KWDocument.h>
29 
30 
31 class CQTextDocumentModel : public QAbstractListModel
32 {
33     Q_OBJECT
34     Q_PROPERTY(QSize thumbnailSize READ thumbnailSize WRITE setThumbnailSize NOTIFY thumbnailSizeChanged)
35 public:
36     CQTextDocumentModel(QObject* parent, KWDocument* document, KoShapeManager *shapemanager);
37     virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
38     Q_INVOKABLE virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
39 
40     QSize thumbnailSize() const;
41     void setThumbnailSize(const QSize& newSize);
42 Q_SIGNALS:
43     void documentControllerChanged();
44     void thumbnailSizeChanged();
45 
46 private:
47     KWDocument *kw_document;
48     KoShapeManager *kw_shapemanager;
49     QSize m_thumbnailSize;
50 };
51 
52 #endif // CQTEXTDOCUMENTMODEL_H
53