1a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)/*
2a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * Copyright (C) 2010 Google Inc. All rights reserved.
3a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) *
4a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without
5a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * modification, are permitted provided that the following conditions are
6a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * met:
7a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) *
8a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) *     * Redistributions of source code must retain the above copyright
9a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * notice, this list of conditions and the following disclaimer.
10a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) *     * Redistributions in binary form must reproduce the above
11a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer
12a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * in the documentation and/or other materials provided with the
13a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * distribution.
14a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) *     * Neither the name of Google Inc. nor the names of its
15a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * contributors may be used to endorse or promote products derived from
16a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * this software without specific prior written permission.
17a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) *
18a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) */
30a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
31a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#ifndef WebOptionElement_h
32a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#define WebOptionElement_h
33a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
34a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "../platform/WebVector.h"
35a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "WebElement.h"
36a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
37a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)namespace blink {
38a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
39a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)class HTMLOptionElement;
40a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
41a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Provides readonly access to some properties of a DOM option element node.
42a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)class WebOptionElement : public WebElement {
43a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)public:
44a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    WebOptionElement() : WebElement() { }
45a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    WebOptionElement(const WebOptionElement& element) : WebElement(element) { }
46a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
47a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    WebOptionElement& operator=(const WebOptionElement& element)
48a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    {
49a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)        WebElement::assign(element);
50a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)        return *this;
51a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    }
52a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    void assign(const WebOptionElement& element) { WebElement::assign(element); }
53a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
54a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    BLINK_EXPORT void setValue(const WebString&);
55a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    BLINK_EXPORT WebString value() const;
56a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
57a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    BLINK_EXPORT int index() const;
58a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    BLINK_EXPORT WebString text() const;
59a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    BLINK_EXPORT WebString label() const;
60a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    BLINK_EXPORT bool isEnabled() const;
61a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
62a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#if BLINK_IMPLEMENTATION
63a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    WebOptionElement(const PassRefPtrWillBeRawPtr<HTMLOptionElement>&);
64a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    WebOptionElement& operator=(const PassRefPtrWillBeRawPtr<HTMLOptionElement>&);
65a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    operator PassRefPtrWillBeRawPtr<HTMLOptionElement>() const;
66a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#endif
67a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)};
68a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
69a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)} // namespace blink
70a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
71a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#endif
72a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)