|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef QWEBOBJECTPLUGIN_P_H |
|
21 #define QWEBOBJECTPLUGIN_P_H |
|
22 |
|
23 #include <qglobal.h> |
|
24 #include <qwebobjectplugin.h> |
|
25 |
|
26 /* |
|
27 FIXME: This is copied from qfactoryloader_p.h. |
|
28 Remove this once we made qfactoryloader public in Qt |
|
29 */ |
|
30 class QFactoryLoaderPrivate; |
|
31 |
|
32 class Q_CORE_EXPORT QFactoryLoader : public QObject |
|
33 { |
|
34 Q_OBJECT_FAKE |
|
35 Q_DECLARE_PRIVATE(QFactoryLoader) |
|
36 |
|
37 public: |
|
38 QFactoryLoader(const char *iid, |
|
39 const QStringList &paths = QStringList(), |
|
40 const QString &suffix = QString(), |
|
41 Qt::CaseSensitivity = Qt::CaseSensitive); |
|
42 ~QFactoryLoader(); |
|
43 |
|
44 QStringList keys() const; |
|
45 QObject *instance(const QString &key) const; |
|
46 |
|
47 }; |
|
48 |
|
49 class QWebFrame; |
|
50 |
|
51 class QWebFactoryLoader : public QFactoryLoader |
|
52 { |
|
53 Q_OBJECT |
|
54 public: |
|
55 QWebFactoryLoader(const char *iid, |
|
56 const QStringList &paths = QStringList(), |
|
57 const QString &suffix = QString(), |
|
58 Qt::CaseSensitivity = Qt::CaseSensitive); |
|
59 |
|
60 static QWebFactoryLoader *self(); |
|
61 |
|
62 QStringList names() const { return keys(); } |
|
63 QStringList extensions() const; |
|
64 QString descriptionForName(const QString &key) const; |
|
65 QStringList mimetypesForName(const QString &key) const; |
|
66 QString nameForMimetype(const QString &mimeType) const; |
|
67 inline bool supportsMimeType(const QString &mimeType) const { |
|
68 return !nameForMimetype(mimeType).isEmpty(); |
|
69 } |
|
70 |
|
71 QString mimeTypeForExtension(const QString &extension); |
|
72 |
|
73 QObject *create(QWebFrame *frame, |
|
74 const QUrl &url, |
|
75 const QString &mimeType, |
|
76 const QStringList &argumentNames, |
|
77 const QStringList &argumentValues); |
|
78 |
|
79 struct MimeInfo { |
|
80 QString type; |
|
81 QStringList extensions; |
|
82 }; |
|
83 struct Info { |
|
84 QString name; |
|
85 QString description; |
|
86 QList<MimeInfo> mimes; |
|
87 }; |
|
88 QList<Info> m_pluginInfo; |
|
89 }; |
|
90 |
|
91 #endif |