1/*
2 * Copyright (C) 2012 Research In Motion Limited. 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 Lesser 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 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18
19#ifndef SelectPopupClient_h
20#define SelectPopupClient_h
21
22#include "IntSize.h"
23#include "PagePopupClient.h"
24#include "ScopePointer.h"
25#include "Timer.h"
26#include <wtf/text/WTFString.h>
27
28namespace WebCore {
29class HTMLSelectElement;
30}
31
32namespace BlackBerry {
33namespace Platform {
34class String;
35}
36
37namespace WebKit {
38
39class SelectPopupClient : public PagePopupClient {
40public:
41    SelectPopupClient(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds, WebPagePrivate*, WebCore::HTMLSelectElement*);
42    ~SelectPopupClient();
43
44    virtual void setValueAndClosePopup(const String&);
45    virtual void didClosePopup();
46
47private:
48    void generateHTML(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds);
49    void notifySelectionChange(WebCore::Timer<SelectPopupClient> *);
50
51    bool m_multiple;
52    unsigned m_size;
53    RefPtr<WebCore::HTMLSelectElement> m_element;
54    WebCore::Timer<SelectPopupClient> m_notifyChangeTimer;
55};
56
57}
58}
59#endif
60