1/*
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
3 *
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.
8 *
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.
13 *
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.
18 *
19 */
20
21#ifndef QtPlatformPlugin_h
22#define QtPlatformPlugin_h
23
24#include <QPluginLoader>
25#include <wtf/PassOwnPtr.h>
26
27class QWebSelectMethod;
28class QWebKitPlatformPlugin;
29class QWebNotificationPresenter;
30class QWebHapticFeedbackPlayer;
31class QWebSelectData;
32class QWebTouchModifier;
33#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA)
34class QWebFullScreenVideoHandler;
35#endif
36class QWebSpellChecker;
37
38namespace WebCore {
39
40class QtPlatformPlugin {
41public:
42    QtPlatformPlugin()
43        : m_loaded(false)
44        , m_plugin(0)
45    {
46    }
47
48    ~QtPlatformPlugin();
49
50    PassOwnPtr<QWebSelectMethod> createSelectInputMethod();
51    PassOwnPtr<QWebNotificationPresenter> createNotificationPresenter();
52    PassOwnPtr<QWebHapticFeedbackPlayer> createHapticFeedbackPlayer();
53    PassOwnPtr<QWebTouchModifier> createTouchModifier();
54#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA)
55    PassOwnPtr<QWebFullScreenVideoHandler> createFullScreenVideoHandler();
56#endif
57    PassOwnPtr<QWebSpellChecker> createSpellChecker();
58
59    QWebKitPlatformPlugin* plugin();
60
61private:
62    bool m_loaded;
63    QWebKitPlatformPlugin* m_plugin;
64    QPluginLoader m_loader;
65    bool load();
66    bool load(const QString& file);
67    bool loadStaticallyLinkedPlugin();
68};
69
70}
71
72#endif // QtPlatformPlugin_h
73