WebPopupMenuProxy.h [plain text]
#ifndef WebPopupMenuProxy_h
#define WebPopupMenuProxy_h
#include <WebCore/TextDirection.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
namespace WebCore {
class IntRect;
}
namespace WebKit {
struct PlatformPopupMenuData;
struct WebPopupItem;
class NativeWebMouseEvent;
class WebPopupMenuProxy : public RefCounted<WebPopupMenuProxy> {
public:
class Client {
protected:
virtual ~Client()
{
}
public:
virtual void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) = 0;
virtual void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) = 0;
virtual NativeWebMouseEvent* currentlyProcessedMouseDownEvent() = 0;
#if PLATFORM(GTK)
virtual void failedToShowPopupMenu() = 0;
#endif
#if PLATFORM(QT)
virtual void changeSelectedIndex(int32_t newSelectedIndex) = 0;
virtual void closePopupMenu() = 0;
#endif
};
virtual ~WebPopupMenuProxy()
{
}
#if !PLATFORM(EFL)
virtual void showPopupMenu(const WebCore::IntRect& rect, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData&, int32_t selectedIndex) = 0;
virtual void hidePopupMenu() = 0;
#endif
void invalidate() { m_client = 0; }
protected:
explicit WebPopupMenuProxy(Client* client)
: m_client(client)
{
}
Client* m_client;
};
}
#endif // WebPopupMenuProxy_h