Remove "virtual" from all lines that have both "virtual" and "override".
[WebKit-https.git] / Source / WebKit2 / UIProcess / gtk / WebPopupMenuProxyGtk.h
1 /*
2  * Copyright (C) 2011 Igalia S.L.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef WebPopupMenuProxyGtk_h
21 #define WebPopupMenuProxyGtk_h
22
23 #include "WebPopupMenuProxy.h"
24 #include <wtf/RunLoop.h>
25 #include <wtf/glib/GRefPtr.h>
26 #include <wtf/text/WTFString.h>
27
28 typedef struct _GMainLoop GMainLoop;
29 typedef struct _GdkEventKey GdkEventKey;
30
31 namespace WebCore {
32 class IntRect;
33 }
34
35 namespace WebKit {
36
37 class WebPageProxy;
38
39 class WebPopupMenuProxyGtk : public WebPopupMenuProxy {
40 public:
41     static Ref<WebPopupMenuProxyGtk> create(GtkWidget* webView, WebPopupMenuProxy::Client& client)
42     {
43         return adoptRef(*new WebPopupMenuProxyGtk(webView, client));
44     }
45     ~WebPopupMenuProxyGtk();
46
47     void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex) override;
48     void hidePopupMenu() override;
49     void cancelTracking() override;
50
51 private:
52     WebPopupMenuProxyGtk(GtkWidget*, WebPopupMenuProxy::Client&);
53
54     void setCurrentlySelectedMenuItem(GtkWidget* item) { m_currentlySelectedMenuItem = item; }
55     GtkAction* createGtkActionForMenuItem(const WebPopupItem&, int itemIndex);
56     void populatePopupMenu(const Vector<WebPopupItem>&);
57     void dismissMenuTimerFired();
58
59     bool typeAheadFind(GdkEventKey*);
60     void resetTypeAheadFindState();
61
62     static void menuItemActivated(GtkAction*, WebPopupMenuProxyGtk*);
63     static void selectItemCallback(GtkWidget*, WebPopupMenuProxyGtk*);
64     static gboolean keyPressEventCallback(GtkWidget*, GdkEventKey*, WebPopupMenuProxyGtk*);
65     static void menuUnmappedCallback(GtkWidget*, WebPopupMenuProxyGtk*);
66
67     GtkWidget* m_webView { nullptr };
68     GtkWidget* m_popup { nullptr };
69
70     RunLoop::Timer<WebPopupMenuProxyGtk> m_dismissMenuTimer;
71
72     // Typeahead find.
73     unsigned m_previousKeyEventCharacter { 0 };
74     uint32_t m_previousKeyEventTimestamp { 0 };
75     GtkWidget* m_currentlySelectedMenuItem { nullptr };
76     String m_currentSearchString;
77 };
78
79 } // namespace WebKit
80
81
82 #endif // WebPopupMenuProxyGtk_h