qwebpluginfactory.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef QWEBPLUGINFACTORY_H
00021 #define QWEBPLUGINFACTORY_H
00022 
00023 #include "qwebkitglobal.h"
00024 
00025 #include <QtCore/qobject.h>
00026 #include <QtCore/qstringlist.h>
00027 
00028 QT_BEGIN_NAMESPACE
00029 class QUrl;
00030 class QString;
00031 QT_END_NAMESPACE
00032 class QWebPluginFactoryPrivate;
00033 
00034 class QWEBKIT_EXPORT QWebPluginFactory : public QObject {
00035     Q_OBJECT
00036 public:
00037     struct QWEBKIT_EXPORT MimeType {
00038         QString name;
00039         QString description;
00040         QStringList fileExtensions;
00041         bool operator==(const MimeType& other) const;
00042         inline bool operator!=(const MimeType& other) const { return !operator==(other); }
00043     };
00044 
00045     struct Plugin {
00046         QString name;
00047         QString description;
00048         QList<MimeType> mimeTypes;
00049     };
00050 
00051     explicit QWebPluginFactory(QObject* parent = 0);
00052     virtual ~QWebPluginFactory();
00053 
00054     virtual QList<Plugin> plugins() const = 0;
00055     virtual void refreshPlugins();
00056 
00057     virtual QObject *create(const QString& mimeType,
00058                             const QUrl&,
00059                             const QStringList& argumentNames,
00060                             const QStringList& argumentValues) const = 0;
00061 
00062     enum Extension {
00063     };
00064     class ExtensionOption
00065     {};
00066     class ExtensionReturn
00067     {};
00068     virtual bool extension(Extension extension, const ExtensionOption* option = 0, ExtensionReturn* output = 0);
00069     virtual bool supportsExtension(Extension extension) const;
00070 
00071 private:
00072     QWebPluginFactoryPrivate* d;
00073 };
00074 
00075 #endif