| 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 | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 6 * reserved. | 6 * reserved. |
| 7 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. | 7 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
| 23 * | 23 * |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef TextControlElement_h | 26 #ifndef TextControlElement_h |
| 27 #define TextControlElement_h | 27 #define TextControlElement_h |
| 28 | 28 |
| 29 #include "base/gtest_prod_util.h" | 29 #include "base/gtest_prod_util.h" |
| 30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
| 31 #include "core/editing/SelectionTemplate.h" |
| 31 #include "core/editing/VisiblePosition.h" | 32 #include "core/editing/VisiblePosition.h" |
| 32 #include "core/html/HTMLFormControlElementWithState.h" | 33 #include "core/html/HTMLFormControlElementWithState.h" |
| 33 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 | 36 |
| 36 class ExceptionState; | 37 class ExceptionState; |
| 37 class Range; | |
| 38 | 38 |
| 39 enum TextFieldSelectionDirection { | 39 enum TextFieldSelectionDirection { |
| 40 SelectionHasNoDirection, | 40 SelectionHasNoDirection, |
| 41 SelectionHasForwardDirection, | 41 SelectionHasForwardDirection, |
| 42 SelectionHasBackwardDirection | 42 SelectionHasBackwardDirection |
| 43 }; | 43 }; |
| 44 enum TextFieldEventBehavior { | 44 enum TextFieldEventBehavior { |
| 45 DispatchNoEvent, | 45 DispatchNoEvent, |
| 46 DispatchChangeEvent, | 46 DispatchChangeEvent, |
| 47 DispatchInputAndChangeEvent | 47 DispatchInputAndChangeEvent |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // 'select' event. | 93 // 'select' event. |
| 94 void setSelectionRangeForBinding(unsigned start, | 94 void setSelectionRangeForBinding(unsigned start, |
| 95 unsigned end, | 95 unsigned end, |
| 96 const String& direction = "none"); | 96 const String& direction = "none"); |
| 97 // Blink-internal version of setSelectionRange(). This translates "none" | 97 // Blink-internal version of setSelectionRange(). This translates "none" |
| 98 // direction to "forward" on platforms without "none" direction. | 98 // direction to "forward" on platforms without "none" direction. |
| 99 // This returns true if it updated cached selection and/or FrameSelection. | 99 // This returns true if it updated cached selection and/or FrameSelection. |
| 100 bool setSelectionRange(unsigned start, | 100 bool setSelectionRange(unsigned start, |
| 101 unsigned end, | 101 unsigned end, |
| 102 TextFieldSelectionDirection = SelectionHasNoDirection); | 102 TextFieldSelectionDirection = SelectionHasNoDirection); |
| 103 Range* selection() const; | 103 SelectionInDOMTree selection() const; |
| 104 | 104 |
| 105 virtual bool supportsAutocapitalize() const = 0; | 105 virtual bool supportsAutocapitalize() const = 0; |
| 106 virtual const AtomicString& defaultAutocapitalize() const = 0; | 106 virtual const AtomicString& defaultAutocapitalize() const = 0; |
| 107 const AtomicString& autocapitalize() const; | 107 const AtomicString& autocapitalize() const; |
| 108 void setAutocapitalize(const AtomicString&); | 108 void setAutocapitalize(const AtomicString&); |
| 109 | 109 |
| 110 int maxLength() const; | 110 int maxLength() const; |
| 111 int minLength() const; | 111 int minLength() const; |
| 112 void setMaxLength(int, ExceptionState&); | 112 void setMaxLength(int, ExceptionState&); |
| 113 void setMinLength(int, ExceptionState&); | 113 void setMinLength(int, ExceptionState&); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 213 } |
| 214 | 214 |
| 215 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(TextControlElement); | 215 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(TextControlElement); |
| 216 | 216 |
| 217 TextControlElement* enclosingTextControl(const Position&); | 217 TextControlElement* enclosingTextControl(const Position&); |
| 218 TextControlElement* enclosingTextControl(const Node*); | 218 TextControlElement* enclosingTextControl(const Node*); |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| 221 | 221 |
| 222 #endif | 222 #endif |
| OLD | NEW |