• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2007 Holger Hans Peter Freyther
3  * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
4  * Copyright (C) 2009-2010 ProFUSION embedded systems
5  * Copyright (C) 2009-2010 Samsung Electronics
6  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public License
19  * along with this library; see the file COPYING.LIB.  If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef ChromeClientEfl_h
25 #define ChromeClientEfl_h
26 
27 #include "ChromeClient.h"
28 #include "KURL.h"
29 #include "PopupMenu.h"
30 
31 typedef struct _Evas_Object Evas_Object;
32 
33 namespace WebCore {
34 
35 class ChromeClientEfl : public ChromeClient {
36 public:
37     explicit ChromeClientEfl(Evas_Object* view);
38     virtual ~ChromeClientEfl();
39 
40     virtual void chromeDestroyed();
41 
42     virtual void setWindowRect(const FloatRect&);
43     virtual FloatRect windowRect();
44 
45     virtual FloatRect pageRect();
46 
47     virtual float scaleFactor();
48 
49     virtual void focus();
50     virtual void unfocus();
51 
52     virtual bool canTakeFocus(FocusDirection);
53     virtual void takeFocus(FocusDirection);
54 
55     virtual void focusedNodeChanged(Node*);
56     virtual void focusedFrameChanged(Frame*);
57 
58     virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&);
59     virtual void show();
60 
61     virtual bool canRunModal();
62     virtual void runModal();
63 
64     virtual void setToolbarsVisible(bool);
65     virtual bool toolbarsVisible();
66 
67     virtual void setStatusbarVisible(bool);
68     virtual bool statusbarVisible();
69 
70     virtual void setScrollbarsVisible(bool);
71     virtual bool scrollbarsVisible();
72 
73     virtual void setMenubarVisible(bool);
74     virtual bool menubarVisible();
75 
76     virtual void createSelectPopup(PopupMenuClient*, int selected, const IntRect& rect);
77     virtual bool destroySelectPopup();
78 
79     virtual void setResizable(bool);
80 
81     virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
82                                      unsigned int lineNumber, const String& sourceID);
83 
84     virtual bool canRunBeforeUnloadConfirmPanel();
85     virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
86 
87     virtual void closeWindowSoon();
88 
89     virtual void runJavaScriptAlert(Frame*, const String&);
90     virtual bool runJavaScriptConfirm(Frame*, const String&);
91     virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
92     virtual void setStatusbarText(const String&);
93     virtual bool shouldInterruptJavaScript();
94     virtual WebCore::KeyboardUIMode keyboardUIMode();
95 
96     virtual IntRect windowResizerRect() const;
97 
98     virtual void contentsSizeChanged(Frame*, const IntSize&) const;
99     virtual IntPoint screenToWindow(const IntPoint&) const;
100     virtual IntRect windowToScreen(const IntRect&) const;
101     virtual PlatformPageClient platformPageClient() const;
102 
103     virtual void scrollbarsModeDidChange() const;
104     virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
105 
106     virtual void setToolTip(const String&, TextDirection);
107 
108     virtual void print(Frame*);
109 
110 #if ENABLE(DATABASE)
111     virtual void exceededDatabaseQuota(Frame*, const String&);
112 #endif
113 
114 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
115     virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
116     virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*);
117 #endif
118 
119 #if ENABLE(CONTEXT_MENUS)
showContextMenu()120     virtual void showContextMenu() { }
121 #endif
122 
123 #if ENABLE(TOUCH_EVENTS)
124     virtual void needTouchEvents(bool);
125 #endif
126 
127     virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
128     virtual void chooseIconForFiles(const Vector<String>&, FileChooser*);
129     virtual void formStateDidChange(const Node*);
130 
131     virtual void setCursor(const Cursor&);
132 
scrollRectIntoView(const IntRect &,const ScrollView *)133     virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {}
134 
135     virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
136     virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*);
137     virtual void cancelGeolocationPermissionForFrame(Frame*, Geolocation*);
138 
139     virtual void invalidateContents(const IntRect&, bool);
140     virtual void invalidateWindow(const IntRect&, bool);
141     virtual void invalidateContentsAndWindow(const IntRect&, bool);
142     virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
143     virtual void scroll(const IntSize&, const IntRect&, const IntRect&);
144     virtual void cancelGeolocationPermissionRequestForFrame(Frame*);
145     virtual void iconForFiles(const Vector<String, 0u>&, PassRefPtr<FileChooser>);
146 
147     virtual void dispatchViewportDataDidChange(const ViewportArguments&) const;
148 
149     virtual bool selectItemWritingDirectionIsNatural();
150     virtual bool selectItemAlignmentFollowsMenuWritingDirection();
151     virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
152     virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
153 
154     Evas_Object* m_view;
155     KURL m_hoveredLinkURL;
156 };
157 }
158 
159 #endif // ChromeClientEfl_h
160