source: terepaima/terepaima-0.4.16/sources/imagemodel.h

desarrollostretch
Last change on this file was 1f4adec, checked in by aosorio <aosorio@…>, 8 years ago

Agregado proyecto base, esto luego del dh_make -f

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2
3Copyright 2015 Adam Reichold
4
5This file is part of qpdfview.
6
7qpdfview is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12qpdfview is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with qpdfview.  If not, see <http://www.gnu.org/licenses/>.
19
20*/
21
22#ifndef IMAGEMODEL_H
23#define IMAGEMODEL_H
24
25#include <QCoreApplication>
26
27#include "model.h"
28
29namespace qpdfview
30{
31
32class ImagePlugin;
33
34namespace Model
35{
36    class ImagePage : public Page
37    {
38        friend class ImageDocument;
39
40    public:
41        QSizeF size() const;
42
43        QImage render(qreal horizontalResolution, qreal verticalResolution, Rotation rotation, const QRect& boundingRect) const;
44
45    private:
46        Q_DISABLE_COPY(ImagePage)
47
48        ImagePage(QImage image);
49
50        QImage m_image;
51
52    };
53
54    class ImageDocument : public Document
55    {
56        Q_DECLARE_TR_FUNCTIONS(Model::ImageDocument)
57
58        friend class qpdfview::ImagePlugin;
59
60    public:
61        int numberOfPages() const;
62
63        Page* page(int index) const;
64
65        QStringList saveFilter() const;
66
67        bool canSave() const;
68        bool save(const QString& filePath, bool withChanges) const;
69
70        void loadProperties(QStandardItemModel* propertiesModel) const;
71
72    private:
73        Q_DISABLE_COPY(ImageDocument)
74
75        ImageDocument(QImage image);
76
77        QImage m_image;
78
79    };
80}
81
82class ImagePlugin : public QObject, Plugin
83{
84    Q_OBJECT
85    Q_INTERFACES(qpdfview::Plugin)
86
87#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
88
89    Q_PLUGIN_METADATA(IID "local.qpdfview.Plugin")
90
91#endif // QT_VERSION
92
93public:
94    ImagePlugin(QObject* parent = 0);
95
96    Model::Document* loadDocument(const QString& filePath) const;
97
98private:
99    Q_DISABLE_COPY(ImagePlugin)
100
101};
102
103} // qpdfview
104
105#endif // IMAGEMODEL_H
Note: See TracBrowser for help on using the repository browser.