Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: public/webview/WebInputElement.h

Issue 16623002: mv public/webview to public/webpage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « public/webview/WebInbandTextTrackClient.h ('k') | public/webview/WebInputEvent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef WebInputElement_h
32 #define WebInputElement_h
33
34 #include "WebFormControlElement.h"
35
36 #if WEBKIT_IMPLEMENTATION
37 namespace WebCore { class HTMLInputElement; }
38 #endif
39
40 namespace WebKit {
41
42 class WebNodeCollection;
43 class WebTextFieldDecoratorClient;
44
45 // Provides readonly access to some properties of a DOM input element node.
46 class WebInputElement : public WebFormControlElement {
47 public:
48 enum SpeechInputState {
49 Idle,
50 Recording,
51 Recognizing,
52 };
53
54 WebInputElement() : WebFormControlElement() { }
55 WebInputElement(const WebInputElement& element) : WebFormControlElement( element) { }
56
57 WebInputElement& operator=(const WebInputElement& element)
58 {
59 WebFormControlElement::assign(element);
60 return *this;
61 }
62 void assign(const WebInputElement& element) { WebFormControlElement::ass ign(element); }
63
64 // This returns true for all of textfield-looking types such as text,
65 // password, search, email, url, and number.
66 WEBKIT_EXPORT bool isTextField() const;
67 // This returns true only for type=text.
68 WEBKIT_EXPORT bool isText() const;
69 WEBKIT_EXPORT bool isPasswordField() const;
70 WEBKIT_EXPORT bool isImageButton() const;
71 WEBKIT_EXPORT bool isRadioButton() const;
72 WEBKIT_EXPORT bool isCheckbox() const;
73 WEBKIT_EXPORT bool autoComplete() const;
74 WEBKIT_EXPORT int maxLength() const;
75 WEBKIT_EXPORT bool isActivatedSubmit() const;
76 WEBKIT_EXPORT void setActivatedSubmit(bool);
77 WEBKIT_EXPORT int size() const;
78 WEBKIT_EXPORT void setValue(const WebString&, bool sendChangeEvent = fal se);
79 WEBKIT_EXPORT void setChecked(bool, bool sendChangeEvent = false);
80 WEBKIT_EXPORT WebString value() const;
81 // This returns the non-sanitized, exact value inside the text field.
82 WEBKIT_EXPORT WebString editingValue() const;
83 // Sets the value inside the text field without being sanitized.
84 // Can't be used if a renderer doesn't exist or on a non text field type .
85 // Caret will be moved to the end.
86 WEBKIT_EXPORT void setEditingValue(const WebString&);
87 WEBKIT_EXPORT void setSuggestedValue(const WebString&);
88 WEBKIT_EXPORT WebString suggestedValue() const;
89 WEBKIT_EXPORT void setPlaceholder(const WebString&);
90 WEBKIT_EXPORT WebString placeholder() const;
91 WEBKIT_EXPORT bool isAutofilled() const;
92 WEBKIT_EXPORT void setAutofilled(bool);
93 WEBKIT_EXPORT void setSelectionRange(int, int);
94 WEBKIT_EXPORT int selectionStart() const;
95 WEBKIT_EXPORT int selectionEnd() const;
96 WEBKIT_EXPORT bool isValidValue(const WebString&) const;
97 WEBKIT_EXPORT bool isChecked() const;
98 WEBKIT_EXPORT bool isMultiple() const;
99
100 WEBKIT_EXPORT WebNodeCollection dataListOptions() const;
101
102 // Return the localized value for this input type.
103 WEBKIT_EXPORT WebString localizeValue(const WebString&) const;
104
105 WEBKIT_EXPORT bool isSpeechInputEnabled() const;
106 WEBKIT_EXPORT SpeechInputState getSpeechInputState() const;
107 WEBKIT_EXPORT void startSpeechInput();
108 WEBKIT_EXPORT void stopSpeechInput();
109
110 // Exposes the default value of the maxLength attribute.
111 WEBKIT_EXPORT static int defaultMaxLength();
112
113 // Returns the direction of the text in this element.
114 WEBKIT_EXPORT WebString directionForFormData() const;
115
116 // Return the decoration added by the specified decorator if one exists.
117 WEBKIT_EXPORT WebElement decorationElementFor(WebTextFieldDecoratorClien t*);
118
119 #if WEBKIT_IMPLEMENTATION
120 WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
121 WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputEleme nt>&);
122 operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const;
123 #endif
124 };
125
126 WEBKIT_EXPORT WebInputElement* toWebInputElement(WebElement*);
127
128 inline const WebInputElement* toWebInputElement(const WebElement* element)
129 {
130 return toWebInputElement(const_cast<WebElement*>(element));
131 }
132
133 } // namespace WebKit
134
135 #endif
OLDNEW
« no previous file with comments | « public/webview/WebInbandTextTrackClient.h ('k') | public/webview/WebInputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698