2 Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef QWEBPLUGINDATABASE_H
21 #define QWEBPLUGINDATABASE_H
23 #include "qwebkitglobal.h"
24 #include "qwebpluginfactory.h"
26 #include <QtCore/qobject.h>
27 #include <QtCore/qstringlist.h>
34 class QWebPluginInfoPrivate;
35 class QWEBKIT_EXPORT QWebPluginInfo {
38 QWebPluginInfo(const QWebPluginInfo& other);
39 QWebPluginInfo &operator=(const QWebPluginInfo& other);
43 QWebPluginInfo(WebCore::PluginPackage* package);
46 typedef QWebPluginFactory::MimeType MimeType;
49 QString description() const;
50 QList<MimeType> mimeTypes() const;
51 bool supportsMimeType(const QString& mimeType) const;
56 void setEnabled(bool enabled);
57 bool isEnabled() const;
59 bool operator==(const QWebPluginInfo& other) const;
60 bool operator!=(const QWebPluginInfo& other) const;
62 friend class QWebPluginDatabase;
65 QWebPluginInfoPrivate* d;
66 WebCore::PluginPackage* m_package;
67 mutable QList<MimeType> m_mimeTypes;
70 class QWebPluginDatabasePrivate;
71 class QWEBKIT_EXPORT QWebPluginDatabase : public QObject {
75 QWebPluginDatabase(QObject* parent = 0);
76 ~QWebPluginDatabase();
79 QList<QWebPluginInfo> plugins() const;
81 static QStringList defaultSearchPaths();
82 QStringList searchPaths() const;
83 void setSearchPaths(const QStringList& paths);
84 void addSearchPath(const QString& path);
88 QWebPluginInfo pluginForMimeType(const QString& mimeType);
89 void setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin);
91 friend class QWebSettings;
94 QWebPluginDatabasePrivate* d;
95 WebCore::PluginDatabase* m_database;
98 #endif // QWEBPLUGINDATABASE_H