OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
6 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. | 6 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void setSelectionRange(int start, int end, const String& direction); | 80 void setSelectionRange(int start, int end, const String& direction); |
81 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel
ectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, Selection
Option = ChangeSelection); | 81 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel
ectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, Selection
Option = ChangeSelection); |
82 Range* selection() const; | 82 Range* selection() const; |
83 | 83 |
84 virtual bool supportsAutocapitalize() const = 0; | 84 virtual bool supportsAutocapitalize() const = 0; |
85 virtual const AtomicString& defaultAutocapitalize() const = 0; | 85 virtual const AtomicString& defaultAutocapitalize() const = 0; |
86 const AtomicString& autocapitalize() const; | 86 const AtomicString& autocapitalize() const; |
87 void setAutocapitalize(const AtomicString&); | 87 void setAutocapitalize(const AtomicString&); |
88 | 88 |
89 void dispatchFormControlChangeEvent() final; | 89 void dispatchFormControlChangeEvent() final; |
| 90 void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType, InputDevic
eCapabilities* sourceCapabilities) final; |
| 91 void dispatchBlurEvent(Element* newFocusedElement, WebFocusType, InputDevice
Capabilities* sourceCapabilities) final; |
90 | 92 |
91 virtual String value() const = 0; | 93 virtual String value() const = 0; |
92 virtual void setValue(const String&, TextFieldEventBehavior = DispatchNoEven
t) = 0; | 94 virtual void setValue(const String&, TextFieldEventBehavior = DispatchNoEven
t) = 0; |
93 | 95 |
94 HTMLElement* innerEditorElement() const; | 96 HTMLElement* innerEditorElement() const; |
95 | 97 |
96 void selectionChanged(bool userTriggered); | 98 void selectionChanged(bool userTriggered); |
97 bool lastChangeWasUserEdit() const; | 99 bool lastChangeWasUserEdit() const; |
98 virtual void setInnerEditorValue(const String&); | 100 virtual void setInnerEditorValue(const String&); |
99 String innerEditorValue() const; | 101 String innerEditorValue() const; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 String valueWithHardLineBreaks() const; | 138 String valueWithHardLineBreaks() const; |
137 | 139 |
138 virtual bool shouldDispatchFormControlChangeEvent(String&, String&); | 140 virtual bool shouldDispatchFormControlChangeEvent(String&, String&); |
139 void copyNonAttributePropertiesFromElement(const Element&) override; | 141 void copyNonAttributePropertiesFromElement(const Element&) override; |
140 | 142 |
141 private: | 143 private: |
142 int computeSelectionStart() const; | 144 int computeSelectionStart() const; |
143 int computeSelectionEnd() const; | 145 int computeSelectionEnd() const; |
144 TextFieldSelectionDirection computeSelectionDirection() const; | 146 TextFieldSelectionDirection computeSelectionDirection() const; |
145 | 147 |
146 void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType, InputDevic
eCapabilities* sourceCapabilities) final; | |
147 void dispatchBlurEvent(Element* newFocusedElement, WebFocusType, InputDevice
Capabilities* sourceCapabilities) final; | |
148 void scheduleSelectEvent(); | 148 void scheduleSelectEvent(); |
149 | 149 |
150 // Returns true if user-editable value is empty. Used to check placeholder v
isibility. | 150 // Returns true if user-editable value is empty. Used to check placeholder v
isibility. |
151 virtual bool isEmptyValue() const = 0; | 151 virtual bool isEmptyValue() const = 0; |
152 // Returns true if suggested value is empty. Used to check placeholder visib
ility. | 152 // Returns true if suggested value is empty. Used to check placeholder visib
ility. |
153 virtual bool isEmptySuggestedValue() const { return true; } | 153 virtual bool isEmptySuggestedValue() const { return true; } |
154 // Called in dispatchFocusEvent(), after placeholder process, before calling
parent's dispatchFocusEvent(). | 154 // Called in dispatchFocusEvent(), after placeholder process, before calling
parent's dispatchFocusEvent(). |
155 virtual void handleFocusEvent(Element* /* oldFocusedNode */, WebFocusType) {
} | 155 virtual void handleFocusEvent(Element* /* oldFocusedNode */, WebFocusType) {
} |
156 // Called in dispatchBlurEvent(), after placeholder process, before calling
parent's dispatchBlurEvent(). | 156 // Called in dispatchBlurEvent(), after placeholder process, before calling
parent's dispatchBlurEvent(). |
157 virtual void handleBlurEvent() { } | 157 virtual void handleBlurEvent() { } |
(...skipping 14 matching lines...) Expand all Loading... |
172 } | 172 } |
173 | 173 |
174 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); | 174 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); |
175 | 175 |
176 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); | 176 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); |
177 HTMLTextFormControlElement* enclosingTextFormControl(Node*); | 177 HTMLTextFormControlElement* enclosingTextFormControl(Node*); |
178 | 178 |
179 } // namespace blink | 179 } // namespace blink |
180 | 180 |
181 #endif | 181 #endif |
OLD | NEW |