WebKit/qt/Api/qwebkitplatformplugin.h
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     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 QWEBKITPLATFORMPLUGIN_H
       
    22 #define QWEBKITPLATFORMPLUGIN_H
       
    23 
       
    24 /*
       
    25  *  Warning: The contents of this file is not  part of the public QtWebKit API
       
    26  *  and may be changed from version to version or even be completely removed.
       
    27 */
       
    28 
       
    29 #include <QObject>
       
    30 
       
    31 class QWebSelectData
       
    32 {
       
    33 public:
       
    34     virtual ~QWebSelectData() {}
       
    35 
       
    36     enum ItemType { Option, Group, Separator };
       
    37 
       
    38     virtual ItemType itemType(int) const = 0;
       
    39     virtual QString itemText(int index) const = 0;
       
    40     virtual QString itemToolTip(int index) const = 0;
       
    41     virtual bool itemIsEnabled(int index) const = 0;
       
    42     virtual bool itemIsSelected(int index) const = 0;
       
    43     virtual int itemCount() const = 0;
       
    44     virtual bool multiple() const = 0;
       
    45 };
       
    46 
       
    47 class QWebSelectMethod : public QObject
       
    48 {
       
    49     Q_OBJECT
       
    50 public:
       
    51     virtual ~QWebSelectMethod() {}
       
    52 
       
    53     virtual void show(const QWebSelectData&) = 0;
       
    54     virtual void hide() = 0;
       
    55 
       
    56 Q_SIGNALS:
       
    57     void selectItem(int index, bool allowMultiplySelections, bool shift);
       
    58     void didHide();
       
    59 };
       
    60 
       
    61 class QWebNotificationData
       
    62 {
       
    63 public:
       
    64     virtual ~QWebNotificationData() {}
       
    65 
       
    66     virtual const QString title() const = 0;
       
    67     virtual const QString message() const = 0;
       
    68     virtual const QByteArray iconData() const = 0;
       
    69 };
       
    70 
       
    71 class QWebNotificationPresenter : public QObject
       
    72 {
       
    73     Q_OBJECT
       
    74 public:
       
    75     QWebNotificationPresenter() {}
       
    76     virtual ~QWebNotificationPresenter() {}
       
    77 
       
    78     virtual void showNotification(const QWebNotificationData*) = 0;
       
    79     
       
    80 Q_SIGNALS:
       
    81     void notificationClosed();
       
    82 };
       
    83 
       
    84 class QWebHapticFeedbackPlayer
       
    85 {
       
    86 public:
       
    87     enum HapticStrength {
       
    88         None, Weak, Medium, Strong
       
    89     };
       
    90 
       
    91     enum HapticEvent {
       
    92         Press, Release
       
    93     };
       
    94 
       
    95     virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0;
       
    96 };
       
    97 
       
    98 class QWebKitPlatformPlugin
       
    99 {
       
   100 public:
       
   101     virtual ~QWebKitPlatformPlugin() {}
       
   102 
       
   103     enum Extension {
       
   104         MultipleSelections,
       
   105         Notifications,
       
   106         Haptics
       
   107     };
       
   108 
       
   109     virtual bool supportsExtension(Extension extension) const = 0;
       
   110     virtual QWebSelectMethod* createSelectInputMethod() const = 0;
       
   111     virtual QWebNotificationPresenter* createNotificationPresenter() const = 0;
       
   112     virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0;
       
   113 
       
   114 };
       
   115 
       
   116 Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.3");
       
   117 
       
   118 #endif // QWEBKITPLATFORMPLUGIN_H