File indexing completed on 2024-05-05 17:09:09
0001 /* 0002 * This file is part of the KDE project 0003 * 0004 * Copyright (C) 2013 Shantanu Tushar <shantanu@kde.org> 0005 * Copyright (C) 2013 Sujith Haridasan <sujith.h@gmail.com> 0006 * 0007 * This library is free software; you can redistribute it and/or 0008 * modify it under the terms of the GNU Library General Public 0009 * License as published by the Free Software Foundation; either 0010 * version 2 of the License, or (at your option) any later version. 0011 * 0012 * This library is distributed in the hope that it will be useful, 0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 * Library General Public License for more details. 0016 * 0017 * You should have received a copy of the GNU Library General Public License 0018 * along with this library; see the file COPYING.LIB. If not, write to 0019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0020 * Boston, MA 02110-1301, USA. 0021 * 0022 */ 0023 0024 #ifndef CQTEXTDOCUMENTMODEL_H 0025 #define CQTEXTDOCUMENTMODEL_H 0026 0027 #include <QAbstractListModel> 0028 #include <KWDocument.h> 0029 0030 0031 class CQTextDocumentModel : public QAbstractListModel 0032 { 0033 Q_OBJECT 0034 Q_PROPERTY(QSize thumbnailSize READ thumbnailSize WRITE setThumbnailSize NOTIFY thumbnailSizeChanged) 0035 public: 0036 CQTextDocumentModel(QObject* parent, KWDocument* document, KoShapeManager *shapemanager); 0037 virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; 0038 Q_INVOKABLE virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; 0039 0040 QSize thumbnailSize() const; 0041 void setThumbnailSize(const QSize& newSize); 0042 Q_SIGNALS: 0043 void documentControllerChanged(); 0044 void thumbnailSizeChanged(); 0045 0046 private: 0047 KWDocument *kw_document; 0048 KoShapeManager *kw_shapemanager; 0049 QSize m_thumbnailSize; 0050 }; 0051 0052 #endif // CQTEXTDOCUMENTMODEL_H