source: terepaima/terepaima-0.4.16/sources/pluginhandler.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: 1.7 KB
Line 
1/*
2
3Copyright 2012-2013 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 PLUGINHANDLER_H
23#define PLUGINHANDLER_H
24
25#include <QObject>
26#include <QMap>
27
28class QString;
29class QWidget;
30
31namespace qpdfview
32{
33
34namespace Model
35{
36class Document;
37}
38
39class SettingsWidget;
40class Plugin;
41
42class PluginHandler : public QObject
43{
44    Q_OBJECT
45
46public:
47    static PluginHandler* instance();
48    ~PluginHandler();
49
50    enum FileType
51    {
52        Unknown = 0,
53        PDF = 1,
54        PS = 2,
55        DjVu = 3,
56        Image = 4
57    };
58
59    static QString fileTypeName(FileType fileType);
60
61    static QStringList openFilter();
62
63    Model::Document* loadDocument(const QString& filePath);
64
65    SettingsWidget* createSettingsWidget(FileType fileType, QWidget* parent = 0);
66
67private:
68    Q_DISABLE_COPY(PluginHandler)
69
70    static PluginHandler* s_instance;
71    PluginHandler(QObject* parent = 0);
72
73    QMap< FileType, Plugin* > m_plugins;
74
75    QMultiMap< FileType, QString > m_objectNames;
76    QMultiMap< FileType, QString > m_fileNames;
77
78    bool loadPlugin(FileType fileType);
79
80};
81
82} // qpdfview
83
84#endif // PLUGINHANDLER_H
Note: See TracBrowser for help on using the repository browser.