OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "../platform/WebVector.h" | 34 #include "../platform/WebVector.h" |
35 #include "WebElement.h" | 35 #include "WebElement.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class HTMLFormElement; | 39 class HTMLFormElement; |
40 class WebInputElement; | 40 class WebInputElement; |
41 class WebFormControlElement; | 41 class WebFormControlElement; |
42 | 42 |
43 // A container for passing around a reference to a form element. Provides | 43 // A container for passing around a reference to a form element. Provides some |
44 // some information about the form. | 44 // information about the form. |
45 class WebFormElement : public WebElement { | 45 class WebFormElement : public WebElement { |
46 public: | 46 public: |
47 ~WebFormElement() { reset(); } | 47 ~WebFormElement() { reset(); } |
48 | 48 |
49 WebFormElement() : WebElement() { } | 49 WebFormElement() : WebElement() { } |
50 WebFormElement(const WebFormElement& element) : WebElement(element) { } | 50 WebFormElement(const WebFormElement& element) : WebElement(element) { } |
51 | 51 |
52 WebFormElement& operator=(const WebFormElement& element) | 52 WebFormElement& operator=(const WebFormElement& element) |
53 { | 53 { |
54 WebElement::assign(element); | 54 WebElement::assign(element); |
55 return *this; | 55 return *this; |
56 } | 56 } |
57 void assign(const WebFormElement& element) { WebElement::assign(element)
; } | 57 void assign(const WebFormElement& element) { WebElement::assign(element); } |
58 | 58 |
59 BLINK_EXPORT bool autoComplete() const; | 59 BLINK_EXPORT bool autoComplete() const; |
60 BLINK_EXPORT WebString action() const; | 60 BLINK_EXPORT WebString action() const; |
61 BLINK_EXPORT WebString name() const; | 61 BLINK_EXPORT WebString name() const; |
62 BLINK_EXPORT WebString method() const; | 62 BLINK_EXPORT WebString method() const; |
63 BLINK_EXPORT bool wasUserSubmitted() const; | 63 BLINK_EXPORT bool wasUserSubmitted() const; |
64 BLINK_EXPORT void submit(); | 64 BLINK_EXPORT void submit(); |
65 // FIXME: Deprecate and replace with WebVector<WebElement>. | 65 // FIXME: Deprecate and replace with WebVector<WebElement>. |
66 BLINK_EXPORT void getNamedElements(const WebString&, WebVector<WebNode>&
); | 66 BLINK_EXPORT void getNamedElements(const WebString&, WebVector<WebNode>&); |
67 BLINK_EXPORT void getFormControlElements(WebVector<WebFormControlElement
>&) const; | 67 BLINK_EXPORT void getFormControlElements(WebVector<WebFormControlElement>&)
const; |
68 | 68 |
69 // NOTE: This function dispatches "invalid" events. Only call this if re
quired by a specification (e.g. requestAutocomplete()). | 69 // NOTE: This function dispatches "invalid" events. Only call this if |
70 BLINK_EXPORT bool checkValidity(); | 70 // required by a specification (e.g. requestAutocomplete()). |
| 71 BLINK_EXPORT bool checkValidity(); |
71 | 72 |
72 enum AutocompleteResult { | 73 enum AutocompleteResult { |
73 AutocompleteResultSuccess, | 74 AutocompleteResultSuccess, |
74 AutocompleteResultErrorDisabled, | 75 AutocompleteResultErrorDisabled, |
75 AutocompleteResultErrorCancel, | 76 AutocompleteResultErrorCancel, |
76 AutocompleteResultErrorInvalid, | 77 AutocompleteResultErrorInvalid, |
77 }; | 78 }; |
78 BLINK_EXPORT void finishRequestAutocomplete(WebFormElement::Autocomplete
Result); | 79 BLINK_EXPORT void finishRequestAutocomplete(WebFormElement::AutocompleteResu
lt); |
79 | 80 |
80 #if BLINK_IMPLEMENTATION | 81 #if BLINK_IMPLEMENTATION |
81 WebFormElement(const PassRefPtrWillBeRawPtr<HTMLFormElement>&); | 82 WebFormElement(const PassRefPtrWillBeRawPtr<HTMLFormElement>&); |
82 WebFormElement& operator=(const PassRefPtrWillBeRawPtr<HTMLFormElement>&
); | 83 WebFormElement& operator=(const PassRefPtrWillBeRawPtr<HTMLFormElement>&); |
83 operator PassRefPtrWillBeRawPtr<HTMLFormElement>() const; | 84 operator PassRefPtrWillBeRawPtr<HTMLFormElement>() const; |
84 #endif | 85 #endif |
85 }; | 86 }; |
86 | 87 |
87 } // namespace blink | 88 } // namespace blink |
88 | 89 |
89 #endif | 90 #endif |
OLD | NEW |