2 Copyright (C) 2011 ProFUSION embedded systems
3 Copyright (C) 2011 Samsung Electronics
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef DumpRenderTreeSupportEfl_h
22 #define DumpRenderTreeSupportEfl_h
25 #include <FindOptions.h>
27 #include <JavaScriptCore/APICast.h>
28 #include <JavaScriptCore/JSStringRef.h>
29 #include <wtf/Vector.h>
30 #include <wtf/text/WTFString.h>
32 typedef struct _Evas_Object Evas_Object;
33 typedef struct _Ewk_History_Item Ewk_History_Item;
35 typedef Vector<Ewk_History_Item*> HistoryItemChildrenVector;
41 class EAPI DumpRenderTreeSupportEfl {
43 DumpRenderTreeSupportEfl() { }
45 ~DumpRenderTreeSupportEfl() { }
47 static unsigned activeAnimationsCount(const Evas_Object* ewkFrame);
48 static bool callShouldCloseOnWebView(Evas_Object* ewkFrame);
49 static void clearFrameName(Evas_Object* ewkFrame);
50 static void clearOpener(Evas_Object* ewkFrame);
51 static String counterValueByElementId(const Evas_Object* ewkFrame, const char* elementId);
52 static bool elementDoesAutoCompleteForElementWithId(const Evas_Object* ewkFrame, const String& elementId);
53 static Eina_List* frameChildren(const Evas_Object* ewkFrame);
54 static WebCore::Frame* frameParent(const Evas_Object* ewkFrame);
55 static void layoutFrame(Evas_Object* ewkFrame);
56 static int numberOfPages(const Evas_Object* ewkFrame, float pageWidth, float pageHeight);
57 static int numberOfPagesForElementId(const Evas_Object* ewkFrame, const char* elementId, float pageWidth, float pageHeight);
58 static String pageProperty(const Evas_Object* ewkFrame, const char* propertyName, int pageNumber);
59 static String pageSizeAndMarginsInPixels(const Evas_Object* ewkFrame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
60 static bool pauseAnimation(Evas_Object* ewkFrame, const char* name, const char* elementId, double time);
61 static bool pauseTransition(Evas_Object* ewkFrame, const char* name, const char* elementId, double time);
62 static unsigned pendingUnloadEventCount(const Evas_Object* ewkFrame);
63 static String renderTreeDump(Evas_Object* ewkFrame);
64 static String responseMimeType(const Evas_Object* ewkFrame);
65 static void resumeAnimations(Evas_Object* ewkFrame);
66 static WebCore::IntRect selectionRectangle(const Evas_Object* ewkFrame);
67 static String suitableDRTFrameName(const Evas_Object* ewkFrame);
68 static void suspendAnimations(Evas_Object* ewkFrame);
69 static void setValueForUser(JSContextRef, JSValueRef nodeObject, const String& value);
70 static void setAutofilled(JSContextRef, JSValueRef nodeObject, bool autofilled);
71 static void setDefersLoading(Evas_Object* ewkView, bool defers);
72 static void setLoadsSiteIconsIgnoringImageLoadingSetting(Evas_Object* ewkView, bool loadsSiteIconsIgnoringImageLoadingPreferences);
74 static void addUserStyleSheet(const Evas_Object* ewkView, const String& sourceCode, bool allFrames);
75 static void executeCoreCommandByName(const Evas_Object* ewkView, const char* name, const char* value);
76 static bool findString(const Evas_Object* ewkView, const String& text, WebCore::FindOptions);
77 static bool isCommandEnabled(const Evas_Object* ewkView, const char* name);
78 static void setJavaScriptProfilingEnabled(const Evas_Object* ewkView, bool enabled);
79 static void setSmartInsertDeleteEnabled(Evas_Object* ewkView, bool enabled);
80 static void setSelectTrailingWhitespaceEnabled(Evas_Object* ewkView, bool enabled);
82 static void garbageCollectorCollect();
83 static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone);
84 static size_t javaScriptObjectsCount();
85 static unsigned workerThreadCount();
87 static HistoryItemChildrenVector childHistoryItems(const Ewk_History_Item*);
88 static String historyItemTarget(const Ewk_History_Item*);
89 static bool isTargetItem(const Ewk_History_Item*);
91 static void setMockScrollbarsEnabled(bool);
93 static void dumpConfigurationForViewport(Evas_Object* ewkView, int deviceDPI, const WebCore::IntSize& deviceSize, const WebCore::IntSize& availableSize);
95 static void deliverAllMutationsIfNecessary();
96 static void setEditingBehavior(Evas_Object* ewkView, const char* editingBehavior);
97 static String markerTextForListItem(JSContextRef, JSValueRef nodeObject);
98 static void setInteractiveFormValidationEnabled(Evas_Object* ewkView, bool enabled);
99 static JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
100 static void setAuthorAndUserStylesEnabled(Evas_Object* ewkView, bool);
103 #endif // DumpRenderTreeSupportEfl_h