Create string tightly when retrive string from cbhm callback event
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_settings.cpp
1 /*
2  * Copyright (C) 2012 Samsung Electronics
3  * Copyright (C) 2012 Intel Corporation. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24  * THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 #include "config.h"
28 #include "ewk_settings.h"
29
30 #include "EwkViewImpl.h"
31 #include "ewk_settings_private.h"
32 #include <WebKit2/WebPageGroup.h>
33 #include <WebKit2/WebPageProxy.h>
34 #include <WebKit2/WebPreferences.h>
35
36 #if OS(TIZEN)
37 #include "WKAPICast.h"
38 #include "WKPreferences.h"
39 #include "WKPreferencesTizen.h"
40 #include "WKRetainPtr.h"
41 #include "WKString.h"
42 #include <Eina.h>
43 #include <wtf/OwnArrayPtr.h>
44 #endif
45
46 #if ENABLE(SPELLCHECK)
47 #include "WKTextChecker.h"
48 #include "ewk_text_checker_private.h"
49 #include <Ecore.h>
50 #include <wtf/Vector.h>
51 #include <wtf/text/CString.h>
52 #endif
53
54 using namespace WebKit;
55
56 const WebKit::WebPreferences* Ewk_Settings::preferences() const
57 {
58     return m_viewImpl->pageProxy->pageGroup()->preferences();
59 }
60
61 WebKit::WebPreferences* Ewk_Settings::preferences()
62 {
63     return m_viewImpl->pageProxy->pageGroup()->preferences();
64 }
65
66 #if OS(TIZEN)
67 void Ewk_Settings::setDefaultTextEncoding(const char* defaultTextEncoding)
68 {
69     m_defaultTextEncoding = defaultTextEncoding;
70 }
71
72 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
73 void Ewk_Settings::setAutofillPasswordForm(bool enable)
74 {
75     m_autofillPasswordForm = enable;
76 }
77
78 void Ewk_Settings::setFormCandidateData(bool enable)
79 {
80     m_formCandidateData = enable;
81 }
82 #endif
83 #endif
84
85 #if ENABLE(SPELLCHECK)
86 static struct {
87     bool isContinuousSpellCheckingEnabled : 1;
88     Vector<String> spellCheckingLanguages;
89     Ewk_Settings_Continuous_Spell_Checking_Change_Cb onContinuousSpellChecking;
90 } ewkTextCheckerSettings = { false, Vector<String>(), 0 };
91
92 static Eina_Bool onContinuousSpellCheckingIdler(void*)
93 {
94     if (ewkTextCheckerSettings.onContinuousSpellChecking)
95         ewkTextCheckerSettings.onContinuousSpellChecking(ewkTextCheckerSettings.isContinuousSpellCheckingEnabled);
96
97     return ECORE_CALLBACK_CANCEL;
98 }
99
100 static Eina_Bool spellCheckingLanguagesSetUpdate(void*)
101 {
102     // FIXME: Consider to delegate calling of this method in WebProcess to do not delay/block UIProcess.
103     Ewk_Text_Checker::updateSpellCheckingLanguages(ewkTextCheckerSettings.spellCheckingLanguages);
104     return ECORE_CALLBACK_CANCEL;
105 }
106
107 static void spellCheckingLanguagesSet(const Vector<String>& newLanguages)
108 {
109     ewkTextCheckerSettings.spellCheckingLanguages = newLanguages;
110     ecore_idler_add(spellCheckingLanguagesSetUpdate, 0);
111 }
112 #endif // ENABLE(SPELLCHECK)
113
114 Eina_Bool ewk_settings_fullscreen_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
115 {
116 #if ENABLE(FULLSCREEN_API)
117     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
118     settings->preferences()->setFullScreenEnabled(enable);
119     return true;
120 #else
121     return false;
122 #endif
123 }
124
125 Eina_Bool ewk_settings_fullscreen_enabled_get(const Ewk_Settings* settings)
126 {
127 #if ENABLE(FULLSCREEN_API)
128     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
129     return settings->preferences()->fullScreenEnabled();
130 #else
131     return false;
132 #endif
133 }
134
135 Eina_Bool ewk_settings_javascript_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
136 {
137     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
138
139     settings->preferences()->setJavaScriptEnabled(enable);
140
141     return true;
142 }
143
144 Eina_Bool ewk_settings_javascript_enabled_get(const Ewk_Settings* settings)
145 {
146     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
147
148     return settings->preferences()->javaScriptEnabled();
149 }
150
151 Eina_Bool ewk_settings_loads_images_automatically_set(Ewk_Settings* settings, Eina_Bool automatic)
152 {
153     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
154
155     settings->preferences()->setLoadsImagesAutomatically(automatic);
156
157     return true;
158 }
159
160 Eina_Bool ewk_settings_loads_images_automatically_get(const Ewk_Settings* settings)
161 {
162     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
163
164     return settings->preferences()->loadsImagesAutomatically();
165 }
166
167 #if OS(TIZEN)
168 Eina_Bool ewk_settings_plugins_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
169 {
170     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
171
172     settings->preferences()->setPluginsEnabled(enable);
173
174     return true;
175 }
176
177 Eina_Bool ewk_settings_plugins_enabled_get(const Ewk_Settings* settings)
178 {
179     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
180
181     return settings->preferences()->pluginsEnabled();
182 }
183
184 Eina_Bool ewk_settings_auto_fitting_set(Ewk_Settings* settings, Eina_Bool enable)
185 {
186     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
187
188     settings->preferences()->setAutoFittingEnabled(enable);
189
190     return true;
191 }
192
193 Eina_Bool ewk_settings_auto_fitting_get(const Ewk_Settings* settings)
194 {
195     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
196
197     return settings->preferences()->autoFittingEnabled();
198 }
199
200 Eina_Bool ewk_settings_font_default_size_set(Ewk_Settings* settings, int size)
201 {
202     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
203
204     settings->preferences()->setDefaultFontSize(size);
205
206     return true;
207 }
208
209 int ewk_settings_font_default_size_get(const Ewk_Settings* settings)
210 {
211     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, 0);
212
213     return settings->preferences()->defaultFontSize();
214 }
215
216 Eina_Bool ewk_settings_scripts_window_open_set(Ewk_Settings* settings, Eina_Bool allow)
217 {
218     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
219
220     settings->preferences()->setJavaScriptCanOpenWindowsAutomatically(allow);
221
222     return true;
223 }
224
225 Eina_Bool ewk_settings_scripts_window_open_get(const Ewk_Settings* settings)
226 {
227     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
228
229     return settings->preferences()->javaScriptCanOpenWindowsAutomatically();
230 }
231
232 Eina_Bool ewk_settings_compositing_borders_visible_set(Ewk_Settings* settings, Eina_Bool enable)
233 {
234     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
235
236     settings->preferences()->setCompositingBordersVisible(enable);
237
238     return true;
239 }
240
241 Eina_Bool ewk_settings_default_encoding_set(Ewk_Settings* settings, const char* encoding)
242 {
243     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
244
245     settings->preferences()->setDefaultTextEncodingName(String::fromUTF8(encoding));
246
247     return true;
248 }
249
250 const char* ewk_settings_default_encoding_get(const Ewk_Settings* settings)
251 {
252     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, 0);
253
254     const String& encodingString(settings->preferences()->defaultTextEncodingName());
255     const_cast<Ewk_Settings*>(settings)->setDefaultTextEncoding(encodingString.utf8().data());
256
257     return settings->defaultTextEncoding();
258 }
259
260 Eina_Bool ewk_settings_private_browsing_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
261 {
262     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
263
264     settings->preferences()->setPrivateBrowsingEnabled(enable);
265
266     return true;
267 }
268
269 Eina_Bool ewk_settings_private_browsing_enabled_get(const Ewk_Settings* settings)
270 {
271     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
272
273     return settings->preferences()->privateBrowsingEnabled();
274 }
275
276 Eina_Bool ewk_settings_editable_link_behavior_set(Ewk_Settings* settings, Ewk_Editable_Link_Behavior behavior)
277 {
278     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
279
280     settings->preferences()->setEditableLinkBehavior(static_cast<WKEditableLinkBehavior>(behavior));
281
282     return true;
283 }
284
285 #if ENABLE(TIZEN_LOAD_REMOTE_IMAGES)
286 Eina_Bool ewk_settings_load_remote_images_set(Ewk_Settings* settings, Eina_Bool loadRemoteImages)
287 {
288     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
289
290     settings->preferences()->setLoadRemoteImages(loadRemoteImages);
291
292     return true;
293 }
294
295 Eina_Bool ewk_settings_load_remote_images_get(const Ewk_Settings* settings)
296 {
297     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
298
299     return settings->preferences()->loadRemoteImages();
300 }
301 #endif
302
303 Eina_Bool ewk_settings_link_effect_enabled_set(Ewk_Settings* settings, Eina_Bool linkEffectEnabled)
304 {
305 #if ENABLE(TIZEN_LINK_EFFECT)
306     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
307
308     settings->preferences()->setLinkEffectEnabled(linkEffectEnabled);
309
310     return true;
311 #else
312     return false;
313 #endif
314 }
315
316 Eina_Bool ewk_settings_link_effect_enabled_get(const Ewk_Settings* settings)
317 {
318 #if ENABLE(TIZEN_LINK_EFFECT)
319     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
320
321     return settings->preferences()->linkEffectEnabled();
322 #else
323     return false;
324 #endif
325 }
326
327 Eina_Bool ewk_settings_uses_encoding_detector_set(Ewk_Settings* settings, Eina_Bool use)
328 {
329     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
330
331     settings->preferences()->setUsesEncodingDetector(use);
332
333     return true;
334 }
335
336 Eina_Bool ewk_settings_uses_encoding_detector_get(const Ewk_Settings* settings)
337 {
338     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
339
340     return settings->preferences()->usesEncodingDetector();
341 }
342
343 #if ENABLE(TIZEN_ISF_PORT)
344 Eina_Bool ewk_settings_show_ime_on_autofocus_set(Ewk_Settings* settings, Eina_Bool enable)
345 {
346     return false;
347 }
348
349 Eina_Bool ewk_settings_show_ime_on_autofocus_get(const Ewk_Settings* settings)
350 {
351     return false;
352 }
353
354 Eina_Bool ewk_settings_default_keypad_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
355 {
356     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
357
358     settings->preferences()->setEnableDefaultKeypad(enable);
359
360     return true;
361 }
362
363 Eina_Bool ewk_settings_default_keypad_enabled_get(const Ewk_Settings* settings)
364 {
365     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
366
367     return settings->preferences()->defaultKeypadEnabled();
368 }
369
370 Eina_Bool ewk_settings_uses_keypad_without_user_action_set(Ewk_Settings* settings, Eina_Bool use)
371 {
372     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
373
374     settings->preferences()->setUsesKeypadWithoutUserAction(use);
375
376     return true;
377 }
378
379 Eina_Bool ewk_settings_uses_keypad_without_user_action_get(const Ewk_Settings* settings)
380 {
381     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, true);
382
383     return settings->preferences()->usesKeypadWithoutUserAction();
384 }
385 #endif
386
387 Eina_Bool ewk_settings_frame_flattening_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
388 {
389     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
390
391     settings->preferences()->setFrameFlatteningEnabled(enable);
392
393     return true;
394 }
395
396 Eina_Bool ewk_settings_frame_flattening_enabled_get(const Ewk_Settings* settings)
397 {
398     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
399
400     return settings->preferences()->frameFlatteningEnabled();
401 }
402
403 #if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
404 Eina_Bool ewk_settings_text_zoom_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
405 {
406     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
407
408     settings->preferences()->setTextZoomEnabled(enable);
409
410     return true;
411 }
412
413 Eina_Bool ewk_settings_text_zoom_enabled_get(const Ewk_Settings* settings)
414 {
415     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
416
417     return settings->preferences()->textZoomEnabled();
418 }
419 #endif
420
421 Eina_Bool ewk_settings_style_scoped_set(Ewk_Settings* settings, Eina_Bool enable)
422 {
423 #if ENABLE(TIZEN_STYLE_SCOPED)
424     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
425     TIZEN_LOGI("enable (%d)", enable);
426
427     settings->preferences()->setStyleScopedEnabled(enable);
428     return true;
429 #endif
430 }
431
432 Eina_Bool ewk_settings_style_scoped_get(Ewk_Settings* settings)
433 {
434 #if ENABLE(TIZEN_STYLE_SCOPED)
435     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
436     TIZEN_LOGI("settings (%p), settings");
437
438     return settings->preferences()->styleScopedEnabled();
439 #endif
440 }
441
442 Eina_Bool ewk_settings_autofill_password_form_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
443 {
444 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
445     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
446     settings->setAutofillPasswordForm(enable);
447     return true;
448 #endif
449     return false;
450 }
451
452 Eina_Bool ewk_settings_autofill_password_form_enabled_get(Ewk_Settings* settings)
453 {
454 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
455     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
456     return settings->autofillPasswordForm();
457 #endif
458     return false;
459 }
460
461 Eina_Bool ewk_settings_form_candidate_data_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
462 {
463 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
464     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
465     settings->setFormCandidateData(enable);
466     return true;
467 #endif
468     return false;
469 }
470
471 Eina_Bool ewk_settings_form_candidate_data_enabled_get(Ewk_Settings* settings)
472 {
473 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
474     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
475     return settings->formCandidateData();
476 #endif
477     return false;
478 }
479 #endif // if OS(TIZEN)
480
481 void ewk_settings_continuous_spell_checking_change_cb_set(Ewk_Settings_Continuous_Spell_Checking_Change_Cb callback)
482 {
483 #if ENABLE(SPELLCHECK)
484     ewkTextCheckerSettings.onContinuousSpellChecking = callback;
485 #endif
486 }
487
488 Eina_Bool ewk_settings_continuous_spell_checking_enabled_get()
489 {
490 #if ENABLE(SPELLCHECK)
491     return ewkTextCheckerSettings.isContinuousSpellCheckingEnabled;
492 #else
493     return false;
494 #endif
495 }
496
497 void ewk_settings_continuous_spell_checking_enabled_set(Eina_Bool enable)
498 {
499 #if ENABLE(SPELLCHECK)
500     enable = !!enable;
501     if (ewkTextCheckerSettings.isContinuousSpellCheckingEnabled != enable) {
502         ewkTextCheckerSettings.isContinuousSpellCheckingEnabled = enable;
503
504         WKTextCheckerContinuousSpellCheckingEnabledStateChanged(enable);
505
506         // Sets the default language if user didn't specify any.
507         if (enable && !Ewk_Text_Checker::hasDictionary())
508             spellCheckingLanguagesSet(Vector<String>());
509
510         if (ewkTextCheckerSettings.onContinuousSpellChecking)
511             ecore_idler_add(onContinuousSpellCheckingIdler, 0);
512     }
513 #endif
514 }
515
516 Eina_List* ewk_settings_spell_checking_available_languages_get()
517 {
518     Eina_List* listOflanguages = 0;
519 #if ENABLE(SPELLCHECK)
520     const Vector<String>& languages = Ewk_Text_Checker::availableSpellCheckingLanguages();
521     size_t numberOfLanuages = languages.size();
522
523     for (size_t i = 0; i < numberOfLanuages; ++i)
524         listOflanguages = eina_list_append(listOflanguages, eina_stringshare_add(languages[i].utf8().data()));
525 #endif
526     return listOflanguages;
527 }
528
529 void ewk_settings_spell_checking_languages_set(const char* languages)
530 {
531 #if ENABLE(SPELLCHECK)
532     Vector<String> newLanguages;
533     String::fromUTF8(languages).split(',', newLanguages);
534
535     spellCheckingLanguagesSet(newLanguages);
536 #endif
537 }
538
539 Eina_List* ewk_settings_spell_checking_languages_get()
540 {
541     Eina_List* listOflanguages = 0;
542 #if ENABLE(SPELLCHECK)
543     Vector<String> languages = Ewk_Text_Checker::loadedSpellCheckingLanguages();
544     size_t numberOfLanuages = languages.size();
545
546     for (size_t i = 0; i < numberOfLanuages; ++i)
547         listOflanguages = eina_list_append(listOflanguages, eina_stringshare_add(languages[i].utf8().data()));
548
549 #endif
550     return listOflanguages;
551 }
552
553 void ewk_settings_link_magnifier_enabled_set(Ewk_Settings* settings, Eina_Bool enabled)
554 {
555     EINA_SAFETY_ON_NULL_RETURN(settings);
556     // settings->preferences()->setLinkMagnifierEnabled(enabled);
557 }
558
559 Eina_Bool ewk_settings_link_magnifier_enabled_get(const Ewk_Settings* settings)
560 {
561     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
562     return settings->preferences()->linkMagnifierEnabled();
563 }
564
565 Eina_Bool ewk_settings_text_selection_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
566 {
567     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
568
569 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
570     settings->setTextSelectionEnabled(enable);
571     return true;
572 #else
573     return false;
574 #endif
575 }
576
577 Eina_Bool ewk_settings_text_selection_enabled_get(const Ewk_Settings* settings)
578 {
579     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
580
581 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
582     return settings->textSelectionEnabled();
583 #else
584     return false;
585 #endif
586 }
587
588 Eina_Bool ewk_settings_clear_text_selection_automatically_set(Ewk_Settings* settings, Eina_Bool enable)
589 {
590     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
591
592 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
593     settings->setAutoClearTextSelection(enable);
594     return true;
595 #else
596     return false;
597 #endif
598 }
599
600 Eina_Bool ewk_settings_clear_text_selection_automatically_get(const Ewk_Settings* settings)
601 {
602     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
603
604 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
605     return settings->autoClearTextSelection();
606 #else
607     return false;
608 #endif
609 }
610
611 Eina_Bool ewk_settings_text_autosizing_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
612 {
613 #if ENABLE(TEXT_AUTOSIZING)
614     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
615
616     settings->preferences()->setTextAutosizingEnabled(enable);
617     
618     return true;
619 #else
620     UNUSED_PARAM(settings);
621     UNUSED_PARAM(enable);
622     return false;
623 #endif
624 }
625
626 Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings* settings)
627 {
628 #if ENABLE(TEXT_AUTOSIZING)
629     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
630
631     return settings->preferences()->textAutosizingEnabled();
632 #else
633     UNUSED_PARAM(settings);
634     return false;
635 #endif
636 }
637