Changeset 79997 in webkit


Ignore:
Timestamp:
Mar 1, 2011 6:13:04 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-03-01 Juha Savolainen <juha.savolainen@weego.fi>

Reviewed by Andreas Kling.

[Qt] WebKit2 needs to support font size changing and getting default font size
https://bugs.webkit.org/show_bug.cgi?id=53671

Added new enum for font size type and added methods to set and get default font sizes.

  • UIProcess/API/qt/qwkpreferences.cpp: (QWKPreferences::setFontSize): Added. (QWKPreferences::fontSize): Added.
  • UIProcess/API/qt/qwkpreferences.h:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r79966 r79997  
     12011-03-01  Juha Savolainen  <juha.savolainen@weego.fi>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] WebKit2 needs to support font size changing and getting default font size
     6        https://bugs.webkit.org/show_bug.cgi?id=53671
     7
     8        Added new enum for font size type and added methods to set and get default font sizes.
     9
     10        * UIProcess/API/qt/qwkpreferences.cpp:
     11        (QWKPreferences::setFontSize): Added.
     12        (QWKPreferences::fontSize): Added.
     13        * UIProcess/API/qt/qwkpreferences.h:
     14
    1152011-02-28  Alice Liu  <alice.liu@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/qt/qwkpreferences.cpp

    r76916 r79997  
    185185    }
    186186}
     187
     188void QWKPreferences::setFontSize(FontSize type, int size)
     189{
     190    switch (type) {
     191    case MinimumFontSize:
     192         WKPreferencesSetMinimumFontSize(d->ref, size);
     193         break;
     194    case DefaultFontSize:
     195         WKPreferencesSetDefaultFontSize(d->ref, size);
     196         break;
     197    case DefaultFixedFontSize:
     198         WKPreferencesSetDefaultFixedFontSize(d->ref, size);
     199         break;
     200    default:
     201        ASSERT_NOT_REACHED();
     202    }
     203}
     204
     205int QWKPreferences::fontSize(FontSize type) const
     206{
     207    switch (type) {
     208    case MinimumFontSize:
     209         return WKPreferencesGetMinimumFontSize(d->ref);
     210    case DefaultFontSize:
     211         return WKPreferencesGetDefaultFontSize(d->ref);
     212    case DefaultFixedFontSize:
     213         return WKPreferencesGetDefaultFixedFontSize(d->ref);
     214    default:
     215        ASSERT_NOT_REACHED();
     216        return false;
     217    }
     218}
     219
  • trunk/Source/WebKit2/UIProcess/API/qt/qwkpreferences.h

    r74738 r79997  
    5050    };
    5151
     52    enum FontSize {
     53        MinimumFontSize,
     54        DefaultFontSize,
     55        DefaultFixedFontSize
     56    };
     57
    5258    static QWKPreferences* sharedPreferences();
    5359
     
    5763    void setAttribute(WebAttribute attr, bool on);
    5864    bool testAttribute(WebAttribute attr) const;
     65
     66    void setFontSize(FontSize type, int size);
     67    int fontSize(FontSize type) const;
    5968
    6069private:
Note: See TracChangeset for help on using the changeset viewer.