~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 
3
 * Copyright (C) 2010 Apple Inc. All rights reserved.
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 *
 
20
 */
 
21
 
 
22
#ifndef WebPopupMenu_h
 
23
#define WebPopupMenu_h
 
24
 
 
25
#include "WebPopupItem.h"
 
26
#include <WebCore/PopupMenu.h>
 
27
#include <wtf/Forward.h>
 
28
#include <wtf/OwnPtr.h>
 
29
#include <wtf/Vector.h>
 
30
 
 
31
namespace WebCore {
 
32
class PopupMenuClient;
 
33
}
 
34
 
 
35
namespace WebKit {
 
36
 
 
37
class WebPage;
 
38
struct PlatformPopupMenuData;
 
39
struct WebPopupItem;
 
40
 
 
41
class WebPopupMenu : public WebCore::PopupMenu {
 
42
public:
 
43
    static PassRefPtr<WebPopupMenu> create(WebPage*, WebCore::PopupMenuClient*);
 
44
    ~WebPopupMenu();
 
45
 
 
46
    WebPage* page() { return m_page; }
 
47
 
 
48
    void disconnectFromPage() { m_page = 0; }
 
49
    void didChangeSelectedIndex(int newIndex);
 
50
    void setTextForIndex(int newIndex);
 
51
#if PLATFORM(GTK) || PLATFORM(QT)
 
52
    WebCore::PopupMenuClient* client() const { return m_popupClient; }
 
53
#endif
 
54
 
 
55
    virtual void show(const WebCore::IntRect&, WebCore::FrameView*, int index) OVERRIDE;
 
56
    virtual void hide() OVERRIDE;
 
57
    virtual void updateFromElement() OVERRIDE;
 
58
    virtual void disconnectClient() OVERRIDE;
 
59
 
 
60
private:
 
61
    WebPopupMenu(WebPage*, WebCore::PopupMenuClient*);
 
62
 
 
63
    Vector<WebPopupItem> populateItems();
 
64
    void setUpPlatformData(const WebCore::IntRect& pageCoordinates, PlatformPopupMenuData&);
 
65
 
 
66
    WebCore::PopupMenuClient* m_popupClient;
 
67
    WebPage* m_page;
 
68
};
 
69
 
 
70
} // namespace WebKit
 
71
 
 
72
#endif // WebPopupMenu_h