Changeset 55981 in webkit


Ignore:
Timestamp:
Mar 14, 2010 6:28:02 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-14 Chang Shu <chang.shu@nokia.com>

Reviewed by Simon Hausmann.

[Qt] [Symbian] Added block for ENABLE_SYMBIAN_DIALOG_PROVIDERS
on Symbian platform.
https://bugs.webkit.org/show_bug.cgi?id=35919

  • WebCore.pro:

2010-03-14 Chang Shu <chang.shu@nokia.com>

Reviewed by Simon Hausmann.

[Qt] [Symbian] Use Symbian native dialog providers for combo pupups.
https://bugs.webkit.org/show_bug.cgi?id=35919

  • WebCoreSupport/QtFallbackWebPopup.cpp: (WebCore::QtFallbackWebPopup::show): (WebCore::ResetAndDestroy): (WebCore::QtFallbackWebPopup::showS60BrowserDialog):
  • WebCoreSupport/QtFallbackWebPopup.h:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55980 r55981  
     12010-03-14  Chang Shu  <chang.shu@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] [Symbian] Added block for ENABLE_SYMBIAN_DIALOG_PROVIDERS
     6        on Symbian platform.
     7        https://bugs.webkit.org/show_bug.cgi?id=35919
     8
     9        * WebCore.pro:
     10
    1112010-03-14  Yael Aharon  <yael.aharon@nokia.com>
    212
  • trunk/WebCore/WebCore.pro

    r55980 r55981  
    28082808}
    28092809
     2810contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
     2811    # this feature requires the S60 platform private BrowserDialogsProvider.h header file
     2812    # and is therefore not enabled by default but only meant for platform builds.
     2813    symbian {
     2814        LIBS += -lbrowserdialogsprovider
     2815    }
     2816}
    28102817
    28112818include($$PWD/../WebKit/qt/Api/headers.pri)
  • trunk/WebKit/qt/ChangeLog

    r55978 r55981  
     12010-03-14  Chang Shu  <chang.shu@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] [Symbian] Use Symbian native dialog providers for combo pupups.
     6        https://bugs.webkit.org/show_bug.cgi?id=35919
     7
     8        * WebCoreSupport/QtFallbackWebPopup.cpp:
     9        (WebCore::QtFallbackWebPopup::show):
     10        (WebCore::ResetAndDestroy):
     11        (WebCore::QtFallbackWebPopup::showS60BrowserDialog):
     12        * WebCoreSupport/QtFallbackWebPopup.h:
     13
    1142010-03-14  Antti Koivisto  <koivisto@iki.fi>
    215
  • trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp

    r54241 r55981  
    2424#include "HostWindow.h"
    2525#include "PopupMenuClient.h"
     26#include "QWebPageClient.h"
    2627#include "qgraphicswebview.h"
    27 #include "QWebPageClient.h"
    2828#include <QAbstractItemView>
    2929#include <QApplication>
     
    3535#include <QStandardItemModel>
    3636
     37#if ENABLE(SYMBIAN_DIALOG_PROVIDERS)
     38#include <BrCtlDialogsProvider.h>
     39#include <BrowserDialogsProvider.h> // S60 platform private header file
     40#include <e32base.h>
     41#endif
     42
    3743namespace WebCore {
    3844
     
    94100void QtFallbackWebPopup::show()
    95101{
     102#if ENABLE(SYMBIAN_DIALOG_PROVIDERS)
     103    TRAP_IGNORE(showS60BrowserDialog());
     104#else
    96105    populate();
    97106    m_combo->setCurrentIndex(currentIndex());
     
    125134                      Qt::LeftButton, Qt::NoModifier);
    126135    QCoreApplication::sendEvent(m_combo, &event);
    127 }
     136#endif
     137}
     138
     139#if ENABLE(SYMBIAN_DIALOG_PROVIDERS)
     140
     141static void ResetAndDestroy(TAny* aPtr)
     142{
     143    RPointerArray<HBufC>* items = reinterpret_cast<RPointerArray<HBufC>* >(aPtr);
     144    items->ResetAndDestroy();
     145}
     146
     147void QtFallbackWebPopup::showS60BrowserDialog()
     148{
     149    static MBrCtlDialogsProvider* dialogs = CBrowserDialogsProvider::NewL(0);
     150    if (!dialogs)
     151        return;
     152
     153    int size = itemCount();
     154    CArrayFix<TBrCtlSelectOptionData>* options = new CArrayFixFlat<TBrCtlSelectOptionData>(qMax(1, size));
     155    RPointerArray<HBufC> items(qMax(1, size));
     156    CleanupStack::PushL(TCleanupItem(&ResetAndDestroy, &items));
     157
     158    for (int i = 0; i < size; i++) {
     159        if (itemType(i) == Separator) {
     160            TBrCtlSelectOptionData data(_L("----------"), false, false, false);
     161            options->AppendL(data);
     162        } else {
     163            HBufC16* itemStr = HBufC16::NewL(itemText(i).length());
     164            itemStr->Des().Copy((const TUint16*)itemText(i).utf16(), itemText(i).length());
     165            CleanupStack::PushL(itemStr);
     166            TBrCtlSelectOptionData data(*itemStr, i == currentIndex(), false, itemIsEnabled(i));
     167            options->AppendL(data);
     168            items.AppendL(itemStr);
     169            CleanupStack::Pop();
     170        }
     171    }
     172
     173    dialogs->DialogSelectOptionL(KNullDesC(), (TBrCtlSelectOptionType)(ESelectTypeSingle | ESelectTypeWithFindPane), *options);
     174
     175    CleanupStack::PopAndDestroy(&items);
     176
     177    int newIndex;
     178    for (newIndex = 0; newIndex < options->Count() && !options->At(newIndex).IsSelected(); newIndex++) {}
     179    if (newIndex == options->Count())
     180        newIndex = currentIndex();
     181   
     182    m_popupVisible = false;
     183    popupDidHide();
     184
     185    if (currentIndex() != newIndex && newIndex >= 0)
     186        valueChanged(newIndex);
     187
     188    delete options;
     189}
     190#endif
    128191
    129192void QtFallbackWebPopup::hide()
  • trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h

    r53769 r55981  
    4949
    5050    void populate();
     51#if ENABLE(SYMBIAN_DIALOG_PROVIDERS)
     52    void showS60BrowserDialog();
     53#endif
    5154};
    5255
Note: See TracChangeset for help on using the changeset viewer.