1/*
2 * Copyright (C) 2010 Apple Inc. All rights reserved.
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
21#ifndef WebContextMenu_h
22#define WebContextMenu_h
23
24#if ENABLE(CONTEXT_MENUS)
25
26#include "WebContextMenuItemData.h"
27
28#include <wtf/RefCounted.h>
29#include <wtf/RefPtr.h>
30
31namespace WebCore {
32class Image;
33}
34
35namespace WebKit {
36
37class ShareableBitmap;
38class WebPage;
39
40class WebContextMenu : public RefCounted<WebContextMenu> {
41public:
42 static Ref<WebContextMenu> create(WebPage* page)
43 {
44 return adoptRef(*new WebContextMenu(page));
45 }
46
47 ~WebContextMenu();
48
49 void show();
50 void itemSelected(const WebContextMenuItemData&);
51 Vector<WebContextMenuItemData> items() const;
52
53private:
54 WebContextMenu(WebPage*);
55 void menuItemsWithUserData(Vector<WebContextMenuItemData>&, RefPtr<API::Object>&) const;
56
57 WebPage* m_page;
58};
59
60} // namespace WebKit
61
62#endif // ENABLE(CONTEXT_MENUS)
63#endif // WebPopupMenu_h
64