SelectPopupClient.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef SelectPopupClient_h
  19. #define SelectPopupClient_h
  20. #include "IntSize.h"
  21. #include "PagePopupClient.h"
  22. #include "ScopePointer.h"
  23. #include "Timer.h"
  24. #include <wtf/text/WTFString.h>
  25. namespace WebCore {
  26. class HTMLSelectElement;
  27. }
  28. namespace BlackBerry {
  29. namespace Platform {
  30. class String;
  31. }
  32. namespace WebKit {
  33. class SelectPopupClient : public PagePopupClient {
  34. public:
  35. SelectPopupClient(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds, WebPagePrivate*, WebCore::HTMLSelectElement*);
  36. ~SelectPopupClient();
  37. virtual void setValueAndClosePopup(const String&);
  38. virtual void didClosePopup();
  39. private:
  40. void generateHTML(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds);
  41. void notifySelectionChange(WebCore::Timer<SelectPopupClient> *);
  42. bool m_multiple;
  43. unsigned m_size;
  44. RefPtr<WebCore::HTMLSelectElement> m_element;
  45. WebCore::Timer<SelectPopupClient> m_notifyChangeTimer;
  46. };
  47. }
  48. }
  49. #endif