2011-04-22 Yi Shen <yi.4.shen@nokia.com>
authoryi.4.shen@nokia.com <yi.4.shen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 14:43:07 +0000 (14:43 +0000)
committeryi.4.shen@nokia.com <yi.4.shen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 14:43:07 +0000 (14:43 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Upstream Symbian platform plugin
        https://bugs.webkit.org/show_bug.cgi?id=58435

        Upstream Symbian platform plugin.

        * Source/WebKit.pro: Add platformplugin path to the SUBDIRS.
2011-04-22  Yi Shen  <yi.4.shen@nokia.com>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Upstream Symbian platform plugin
        https://bugs.webkit.org/show_bug.cgi?id=58435

        Upstream Symbian platform plugin.

        * QtWebKit.pro: Add platformplugin.dll to the QtWebKit.sis.
        * symbian/platformplugin: Added.
        * symbian/platformplugin/WebPlugin.cpp: Added.
        (ItemListDelegate::ItemListDelegate):
        (ItemListDelegate::paint):
        (Popup::Popup):
        (Popup::resizeEvent):
        (Popup::populateList):
        (Popup::onItemSelected):
        (Popup::updateSelectionsBeforeDialogClosing):
        (Popup::updateAndClose):
        (WebPopup::WebPopup):
        (WebPopup::~WebPopup):
        (WebPopup::createSingleSelectionPopup):
        (WebPopup::createMultipleSelectionPopup):
        (WebPopup::createPopup):
        (WebPopup::show):
        (WebPopup::hide):
        (WebPopup::popupClosed):
        (WebPopup::itemClicked):
        (SingleSelectionPopup::SingleSelectionPopup):
        (MultipleSelectionPopup::MultipleSelectionPopup):
        (WebNotificationPresenter::showNotification):
        (WebPlugin::supportsExtension):
        (WebPlugin::createExtension):
        * symbian/platformplugin/WebPlugin.h: Added.
        (Popup::preSelectedIndices):
        (Popup::listWidget):
        (WebNotificationPresenter::WebNotificationPresenter):
        (WebNotificationPresenter::~WebNotificationPresenter):
        * symbian/platformplugin/platformplugin.pro: Added.
        * symbian/platformplugin/qwebkitplatformplugin.h: Copied from WebKit/qt/Api/qwebkitplatformplugin.h.
        (QWebSelectData::~QWebSelectData):
        (QWebSelectMethod::~QWebSelectMethod):
        (QWebNotificationData::~QWebNotificationData):
        (QWebNotificationPresenter::QWebNotificationPresenter):
        (QWebNotificationPresenter::~QWebNotificationPresenter):
        (QWebTouchModifier::~QWebTouchModifier):
        (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler):
        (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler):
        (QWebKitPlatformPlugin::~QWebKitPlatformPlugin):
2011-04-22  Yi Shen  <yi.4.shen@nokia.com>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Upstream Symbian platform plugin
        https://bugs.webkit.org/show_bug.cgi?id=58435

        Exempting directory WebKit/qt/symbian/platformplugin from style guide.

        * Scripts/webkitpy/style/checker.py:
        * Scripts/webkitpy/style/checker_unittest.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84627 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebKit.pro
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/QtWebKit.pro
Source/WebKit/qt/symbian/platformplugin/WebPlugin.cpp [new file with mode: 0644]
Source/WebKit/qt/symbian/platformplugin/WebPlugin.h [new file with mode: 0644]
Source/WebKit/qt/symbian/platformplugin/platformplugin.pro [new file with mode: 0644]
Source/WebKit/qt/symbian/platformplugin/qwebkitplatformplugin.h [new file with mode: 0644]
Tools/ChangeLog
Tools/Scripts/webkitpy/style/checker.py
Tools/Scripts/webkitpy/style/checker_unittest.py

index b1c0b9c..07e6fbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-04-22  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Upstream Symbian platform plugin
+        https://bugs.webkit.org/show_bug.cgi?id=58435
+
+        Upstream Symbian platform plugin.
+
+        * Source/WebKit.pro: Add platformplugin path to the SUBDIRS.
+
 2011-04-21  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Adam Roben.
index 063ded7..9be0f4a 100644 (file)
@@ -32,6 +32,8 @@ build-qtscript {
 }
 
 symbian {
+    exists($$PWD/WebKit/qt/symbian/platformplugin): SUBDIRS += WebKit/qt/symbian/platformplugin
+
     # Forward the install target to WebCore. A workaround since INSTALLS is not implemented for symbian
     install.commands = $(MAKE) -C WebCore install
     QMAKE_EXTRA_TARGETS += install
index 07a65cb..fd57a06 100644 (file)
@@ -1,3 +1,54 @@
+2011-04-22  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Upstream Symbian platform plugin
+        https://bugs.webkit.org/show_bug.cgi?id=58435
+
+        Upstream Symbian platform plugin.
+
+        * QtWebKit.pro: Add platformplugin.dll to the QtWebKit.sis.
+        * symbian/platformplugin: Added.
+        * symbian/platformplugin/WebPlugin.cpp: Added.
+        (ItemListDelegate::ItemListDelegate):
+        (ItemListDelegate::paint):
+        (Popup::Popup):
+        (Popup::resizeEvent):
+        (Popup::populateList):
+        (Popup::onItemSelected):
+        (Popup::updateSelectionsBeforeDialogClosing):
+        (Popup::updateAndClose):
+        (WebPopup::WebPopup):
+        (WebPopup::~WebPopup):
+        (WebPopup::createSingleSelectionPopup):
+        (WebPopup::createMultipleSelectionPopup):
+        (WebPopup::createPopup):
+        (WebPopup::show):
+        (WebPopup::hide):
+        (WebPopup::popupClosed):
+        (WebPopup::itemClicked):
+        (SingleSelectionPopup::SingleSelectionPopup):
+        (MultipleSelectionPopup::MultipleSelectionPopup):
+        (WebNotificationPresenter::showNotification):
+        (WebPlugin::supportsExtension):
+        (WebPlugin::createExtension):
+        * symbian/platformplugin/WebPlugin.h: Added.
+        (Popup::preSelectedIndices):
+        (Popup::listWidget):
+        (WebNotificationPresenter::WebNotificationPresenter):
+        (WebNotificationPresenter::~WebNotificationPresenter):
+        * symbian/platformplugin/platformplugin.pro: Added.
+        * symbian/platformplugin/qwebkitplatformplugin.h: Copied from WebKit/qt/Api/qwebkitplatformplugin.h.
+        (QWebSelectData::~QWebSelectData):
+        (QWebSelectMethod::~QWebSelectMethod):
+        (QWebNotificationData::~QWebNotificationData):
+        (QWebNotificationPresenter::QWebNotificationPresenter):
+        (QWebNotificationPresenter::~QWebNotificationPresenter):
+        (QWebTouchModifier::~QWebTouchModifier):
+        (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler):
+        (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler):
+        (QWebKitPlatformPlugin::~QWebKitPlatformPlugin):
+
 2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
 
         Reviewed by Sam Weinig.
index f17368f..f747b1c 100644 (file)
@@ -123,7 +123,10 @@ symbian {
          DEPLOYMENT += declarativeImport
     }
 
-    DEPLOYMENT += webkitsisheader webkitlibs webkitbackup
+    platformplugin.sources = $$OUTPUT_DIR/plugins/QtWebKit/platformplugin$${QT_LIBINFIX}.dll
+    platformplugin.path = c:$$QT_PLUGINS_BASE_DIR/QtWebKit
+
+    DEPLOYMENT += webkitsisheader webkitlibs webkitbackup platformplugin
     !CONFIG(production):CONFIG-=def_files
 
     # Need to build these sources here because of exported symbols
diff --git a/Source/WebKit/qt/symbian/platformplugin/WebPlugin.cpp b/Source/WebKit/qt/symbian/platformplugin/WebPlugin.cpp
new file mode 100644 (file)
index 0000000..0cac686
--- /dev/null
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "WebPlugin.h"
+
+#include <QtGui>
+#include <QtPlugin>
+#include <akndiscreetpopup.h>
+
+class ItemListDelegate : public QStyledItemDelegate {
+public:
+    ItemListDelegate(QObject* parent = 0)
+        : QStyledItemDelegate(parent)
+    {
+    }
+
+    void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
+    {
+        Q_ASSERT(index.isValid());
+
+        QStyleOptionViewItemV4 opt = option;
+        opt.state = opt.state & (~QStyle::State_HasFocus);
+        opt.text = index.data().toString();
+        initStyleOption(&opt, index);
+
+        const QWidget* widget = 0;
+        Popup* selectPopup = qobject_cast<Popup*>(parent());
+        if (selectPopup)
+            widget = selectPopup->listWidget();
+
+        QStyle* style = widget ? widget->style() : QApplication::style();
+        style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget);
+    }
+};
+
+Popup::Popup(const QWebSelectData& data)
+    : m_data(data)
+{
+    setModal(true);
+    m_list = new QListWidget(this);
+    int width = QApplication::desktop()->size().width();
+    QVBoxLayout* vLayout = new QVBoxLayout(this);
+    vLayout->setContentsMargins(width / 20, 5, 5, 5);
+    if (data.multiple())
+        m_list->setSelectionMode(QAbstractItemView::MultiSelection);
+    populateList();
+    vLayout->addWidget(m_list);
+   
+    ItemListDelegate* itemDelegate = new ItemListDelegate(this);
+    m_list->setItemDelegate(itemDelegate);
+}
+
+void Popup::resizeEvent(QResizeEvent* e)
+{
+    QDialog::resizeEvent(e);
+    m_list->setGeometry(m_list->geometry().x(), m_list->geometry().y(), m_list->width(), m_list->height());
+}
+
+void Popup::populateList()
+{
+    QListWidgetItem* listItem;
+    m_preSelectedIndices.clear();
+    for (int i = 0; i < m_data.itemCount(); ++i) {
+        if (m_data.itemType(i) == QWebSelectData::Option) {
+            listItem = new QListWidgetItem(m_data.itemText(i));
+            m_list->addItem(listItem);
+            listItem->setSelected(m_data.itemIsSelected(i));
+            if (m_data.itemIsSelected(i)) {
+                m_preSelectedIndices.append(i);
+                m_list->setCurrentItem(listItem);
+            }
+        } else if (m_data.itemType(i) == QWebSelectData::Group) {
+            listItem = new QListWidgetItem(m_data.itemText(i));
+            m_list->addItem(listItem);
+            listItem->setSelected(false);
+            listItem->setFlags(Qt::NoItemFlags);
+        }
+    }
+    connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onItemSelected(QListWidgetItem*)));
+}
+
+void Popup::onItemSelected(QListWidgetItem* item)
+{
+    if (item->flags() != Qt::NoItemFlags) {
+        if (!m_data.multiple())
+            updateAndClose();
+    }
+}
+
+void Popup::updateSelectionsBeforeDialogClosing()
+{
+    QList<QListWidgetItem*> selected = m_list->selectedItems();
+    if (m_data.multiple()) {
+        QList<int> selectedIndices;
+        Q_FOREACH(QListWidgetItem* item, selected)
+            selectedIndices.append(m_list->row(item));
+
+        for (int i = 0; i < m_data.itemCount(); ++i) {
+            if ((m_preSelectedIndices.contains(i) && !selectedIndices.contains(i)) || (!m_preSelectedIndices.contains(i) && selectedIndices.contains(i)))
+                emit itemClicked(i);
+        }
+    } else {
+        Q_FOREACH(QListWidgetItem* item, selected)
+            emit itemClicked(m_list->row(item));
+    }
+}
+
+void Popup::updateAndClose()
+{
+    updateSelectionsBeforeDialogClosing();
+    accept();
+}
+
+WebPopup::WebPopup()
+    : m_popup(0)
+{
+}
+
+WebPopup::~WebPopup()
+{
+    if (m_popup)
+        m_popup->deleteLater();
+}
+
+Popup* WebPopup::createSingleSelectionPopup(const QWebSelectData& data)
+{
+    return new SingleSelectionPopup(data);
+}
+
+Popup* WebPopup::createMultipleSelectionPopup(const QWebSelectData& data)
+{
+    return new MultipleSelectionPopup(data);
+}
+
+Popup* WebPopup::createPopup(const QWebSelectData& data)
+{
+    Popup* result = data.multiple() ? createMultipleSelectionPopup(data) : createSingleSelectionPopup(data);
+    connect(result, SIGNAL(finished(int)), this, SLOT(popupClosed()));
+    connect(result, SIGNAL(itemClicked(int)), this, SLOT(itemClicked(int)));
+    return result;
+}
+
+void WebPopup::show(const QWebSelectData& data)
+{
+    if (m_popup)
+        return;
+
+    m_popup = createPopup(data);
+    m_popup->showMaximized();
+}
+
+void WebPopup::hide()
+{
+    if (!m_popup)
+        return;
+
+    m_popup->accept();
+}
+
+void WebPopup::popupClosed()
+{
+    if (!m_popup)
+        return;
+
+    m_popup->deleteLater();
+    m_popup = 0;
+    emit didHide();
+}
+
+void WebPopup::itemClicked(int idx)
+{
+    emit selectItem(idx, true, false);
+}
+
+SingleSelectionPopup::SingleSelectionPopup(const QWebSelectData& data)
+    : Popup(data)
+{
+    setWindowTitle("Select item");
+
+    QAction* cancelAction = new QAction("Cancel", this);
+    cancelAction->setSoftKeyRole(QAction::NegativeSoftKey);
+    addAction(cancelAction);
+    connect(cancelAction, SIGNAL(triggered(bool)), this, SLOT(reject()));
+}
+
+MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data)
+    : Popup(data)
+{
+    setWindowTitle("Select items");
+
+    QAction* cancelAction = new QAction("Cancel", this);
+    cancelAction->setSoftKeyRole(QAction::NegativeSoftKey);
+    addAction(cancelAction);
+    connect(cancelAction, SIGNAL(triggered(bool)), this, SLOT(reject()));
+
+    QAction* okAction = new QAction("Ok", this);
+    okAction->setSoftKeyRole(QAction::PositiveSoftKey);
+    addAction(okAction);
+    connect(okAction, SIGNAL(triggered(bool)), this, SLOT(updateAndClose()));
+}
+
+void WebNotificationPresenter::showNotification(const QWebNotificationData* data)
+{
+    HBufC* title = HBufC::New(data->title().size());
+    *title = TPtrC(data->title().utf16(), data->title().size());
+    HBufC* message = HBufC::New(data->message().size());
+    *message = TPtrC(data->message().utf16(), data->message().size());
+    TRAP_IGNORE(CAknDiscreetPopup::ShowGlobalPopupL(*title, *message, KAknsIIDNone, KNullDesC));
+    emit notificationClosed();
+    deleteLater();
+    delete title;
+    delete message;
+}
+
+bool WebPlugin::supportsExtension(Extension extension) const
+{
+    if (extension == MultipleSelections)
+        return true;
+    if (extension == Notifications)
+        return true;
+    if (extension == FullScreenVideoPlayer)
+        return true;        
+    return false;
+}
+
+QObject* WebPlugin::createExtension(Extension extension) const
+{
+    switch (extension) {
+    case MultipleSelections:
+        return new WebPopup();
+    case Notifications:
+        return new WebNotificationPresenter();
+    default:
+        return 0;
+    }
+}
+
+Q_EXPORT_PLUGIN2(qwebselectim, WebPlugin)
diff --git a/Source/WebKit/qt/symbian/platformplugin/WebPlugin.h b/Source/WebKit/qt/symbian/platformplugin/WebPlugin.h
new file mode 100644 (file)
index 0000000..3c0e76b
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+#ifndef WebPlugin_h
+#define WebPlugin_h
+
+#include "qwebkitplatformplugin.h"
+#include <QDialog>
+
+class QListWidgetItem;
+class QListWidget;
+class QScrollArea;
+
+class PopupScrollingHandler;
+
+class Popup : public QDialog {
+    Q_OBJECT
+public:
+    Popup(const QWebSelectData&);
+    void updateSelectionsBeforeDialogClosing();
+    QList<int> preSelectedIndices() const { return m_preSelectedIndices; }
+    QListWidget* listWidget() { return m_list; }
+
+signals:
+    void itemClicked(int idx);
+
+protected slots:
+    void onItemSelected(QListWidgetItem*);
+    void updateAndClose();
+
+protected:
+    void populateList();
+    void resizeEvent(QResizeEvent*);
+    const QWebSelectData& m_data;
+    QListWidget* m_list;
+    QList<int> m_preSelectedIndices;
+    PopupScrollingHandler* m_scrollingHandler;
+};
+
+
+class SingleSelectionPopup : public Popup {
+    Q_OBJECT
+public:
+    SingleSelectionPopup(const QWebSelectData&);
+};
+
+
+class MultipleSelectionPopup : public Popup {
+    Q_OBJECT
+public:
+    MultipleSelectionPopup(const QWebSelectData&);
+};
+
+
+class WebPopup : public QWebSelectMethod {
+    Q_OBJECT
+public:
+    WebPopup();
+    ~WebPopup();
+
+    virtual void show(const QWebSelectData&);
+    virtual void hide();
+
+private slots:
+    void popupClosed();
+    void itemClicked(int idx);
+
+private:
+    Popup* m_popup;
+
+    Popup* createPopup(const QWebSelectData&);
+    Popup* createSingleSelectionPopup(const QWebSelectData&);
+    Popup* createMultipleSelectionPopup(const QWebSelectData&);
+};
+
+class WebNotificationPresenter : public QWebNotificationPresenter {
+    Q_OBJECT
+public:
+    WebNotificationPresenter() { }
+    ~WebNotificationPresenter() { }
+    void showNotification(const QWebNotificationData*);
+};
+
+class WebPlugin : public QObject, public QWebKitPlatformPlugin {
+    Q_OBJECT
+    Q_INTERFACES(QWebKitPlatformPlugin)
+public:
+    virtual bool supportsExtension(Extension) const;
+    virtual QObject* createExtension(Extension) const;
+};
+
+#endif // WebPlugin_h
diff --git a/Source/WebKit/qt/symbian/platformplugin/platformplugin.pro b/Source/WebKit/qt/symbian/platformplugin/platformplugin.pro
new file mode 100644 (file)
index 0000000..5370d84
--- /dev/null
@@ -0,0 +1,38 @@
+TEMPLATE = lib
+CONFIG += plugin \
+          mobility
+
+MOBILITY = multimedia
+
+TARGET = $$qtLibraryTarget(platformplugin)
+TARGETPATH = QtWebKit
+QT       += core gui \
+            network \
+            xml
+
+## load mobilityconfig if mobility is available
+load(mobilityconfig, true)
+
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
+
+SOURCES += \
+    WebPlugin.cpp
+
+HEADERS += \
+    WebPlugin.h \
+    qwebkitplatformplugin.h
+
+DESTDIR = $$OUTPUT_DIR/plugins/$$TARGETPATH
+
+symbian: {
+# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data
+    TARGET.EPOCALLOWDLLDATA=1
+    TARGET.CAPABILITY = All -Tcb
+    TARGET.UID3 = 0x2002E674
+    TARGET.VID = VID_DEFAULT
+    TARGET = $$TARGET$${QT_LIBINFIX}
+
+    LIBS += -lcone -leikcore -lavkon
+}
+target.path += $$[QT_INSTALL_PLUGINS]/$$TARGETPATH
+INSTALLS += target
diff --git a/Source/WebKit/qt/symbian/platformplugin/qwebkitplatformplugin.h b/Source/WebKit/qt/symbian/platformplugin/qwebkitplatformplugin.h
new file mode 100644 (file)
index 0000000..4db0c10
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef QWEBKITPLATFORMPLUGIN_H
+#define QWEBKITPLATFORMPLUGIN_H
+
+/*
+ *  Warning: The contents of this file is not  part of the public QtWebKit API
+ *  and may be changed from version to version or even be completely removed.
+*/
+
+#include <QColor>
+#include <QObject>
+#include <QUrl>
+#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA
+#include <QMediaPlayer>
+#endif
+
+class QWebSelectData {
+public:
+    virtual ~QWebSelectData() {}
+
+    enum ItemType { Option, Group, Separator };
+
+    virtual ItemType itemType(int) const = 0;
+    virtual QString itemText(int index) const = 0;
+    virtual QString itemToolTip(int index) const = 0;
+    virtual bool itemIsEnabled(int index) const = 0;
+    virtual bool itemIsSelected(int index) const = 0;
+    virtual int itemCount() const = 0;
+    virtual bool multiple() const = 0;
+    virtual QColor backgroundColor() const = 0;
+    virtual QColor foregroundColor() const = 0;
+    virtual QColor itemBackgroundColor(int index) const = 0;
+    virtual QColor itemForegroundColor(int index) const = 0;
+};
+
+class QWebSelectMethod : public QObject {
+    Q_OBJECT
+public:
+    virtual ~QWebSelectMethod() {}
+
+    virtual void show(const QWebSelectData&) = 0;
+    virtual void hide() = 0;
+
+Q_SIGNALS:
+    void selectItem(int index, bool allowMultiplySelections, bool shift);
+    void didHide();
+};
+
+class QWebNotificationData {
+public:
+    virtual ~QWebNotificationData() {}
+
+    virtual const QString title() const = 0;
+    virtual const QString message() const = 0;
+    virtual const QByteArray iconData() const = 0;
+    virtual const QUrl openerPageUrl() const = 0;
+};
+
+class QWebNotificationPresenter : public QObject {
+    Q_OBJECT
+public:
+    QWebNotificationPresenter() {}
+    virtual ~QWebNotificationPresenter() {}
+
+    virtual void showNotification(const QWebNotificationData*) = 0;
+    
+Q_SIGNALS:
+    void notificationClosed();
+    void notificationClicked();
+};
+
+class QWebHapticFeedbackPlayer: public QObject {
+    Q_OBJECT
+public:
+    QWebHapticFeedbackPlayer() {}
+    virtual ~QWebHapticFeedbackPlayer() {}
+
+    enum HapticStrength {
+        None, Weak, Medium, Strong
+    };
+
+    enum HapticEvent {
+        Press, Release
+    };
+
+    virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0;
+};
+
+class QWebTouchModifier : public QObject {
+    Q_OBJECT
+public:
+    virtual ~QWebTouchModifier() {}
+
+    enum PaddingDirection {
+        Up, Right, Down, Left
+    };
+
+    virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0;
+};
+
+#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA
+class QWebFullScreenVideoHandler : public QObject {
+    Q_OBJECT
+public:
+    QWebFullScreenVideoHandler() {}
+    virtual ~QWebFullScreenVideoHandler() {}
+    virtual bool requiresFullScreenForVideoPlayback() const = 0;
+
+Q_SIGNALS:
+    void fullScreenClosed();
+
+public Q_SLOTS:
+    virtual void enterFullScreen(QMediaPlayer*) = 0;
+    virtual void exitFullScreen() = 0;
+};
+#endif
+
+class QWebKitPlatformPlugin {
+public:
+    virtual ~QWebKitPlatformPlugin() {}
+
+    enum Extension {
+        MultipleSelections,
+        Notifications,
+        Haptics,
+        TouchInteraction,
+        FullScreenVideoPlayer
+    };
+
+    virtual bool supportsExtension(Extension) const = 0;
+    virtual QObject* createExtension(Extension) const = 0;
+};
+
+QT_BEGIN_NAMESPACE
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.7");
+QT_END_NAMESPACE
+
+#endif // QWEBKITPLATFORMPLUGIN_H
index acc966e..3058092 100644 (file)
@@ -1,3 +1,15 @@
+2011-04-22  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Upstream Symbian platform plugin
+        https://bugs.webkit.org/show_bug.cgi?id=58435
+
+        Exempting directory WebKit/qt/symbian/platformplugin from style guide.
+
+        * Scripts/webkitpy/style/checker.py:
+        * Scripts/webkitpy/style/checker_unittest.py:
+
 2011-04-22  Balazs Kelemen  <kbalazs@webkit.org>
 
         Reviewed by Csaba Osztrogon√°c.
index 48abcf9..a36ec67 100644 (file)
@@ -198,6 +198,14 @@ _PATH_RULES_SPECIFIER = [
       "+pep8/W191",  # Tabs
       "+pep8/W291",  # Trailing white space
       "+whitespace/carriage_return"]),
+
+    ([# Qt Symbian platform plugin has no config.h or header guard.
+      # Qt code uses '_' in some places (such as private slots
+      # and on test xxx_data methos on tests).
+      "Source/WebKit/qt/symbian/platformplugin/"],
+     ["-readability/naming",
+      "-build/header_guard",
+      "-build/include_order"]),
 ]
 
 
index 144d40a..4959577 100755 (executable)
@@ -237,6 +237,8 @@ class GlobalVariablesTest(unittest.TestCase):
                     "readability/braces")
         assertCheck("Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp",
                     "readability/braces")
+        assertCheck("Source/WebKit/qt/symbian/platformplugin/WebPlugin.cpp",
+                    "readability/braces")
         assertNoCheck("Source/JavaScriptCore/qt/api/qscriptengine.cpp",
                       "readability/naming")
         assertNoCheck("Source/JavaScriptCore/qt/benchmarks"
@@ -250,6 +252,8 @@ class GlobalVariablesTest(unittest.TestCase):
                       "readability/naming")
         assertNoCheck("Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp",
                       "readability/naming")
+        assertNoCheck("Source/WebKit/qt/symbian/platformplugin/WebPlugin.cpp",
+                      "build/header_guard")
 
         assertNoCheck("Tools/MiniBrowser/qt/UrlLoader.cpp",
                     "build/include")