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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void setSelectionEnd(int); | 65 void setSelectionEnd(int); |
66 void setSelectionDirection(const String&); | 66 void setSelectionDirection(const String&); |
67 void select(); | 67 void select(); |
68 virtual void setRangeText(const String& replacement, ExceptionState&); | 68 virtual void setRangeText(const String& replacement, ExceptionState&); |
69 virtual void setRangeText(const String& replacement, unsigned start, unsigne
d end, const String& selectionMode, ExceptionState&); | 69 virtual void setRangeText(const String& replacement, unsigned start, unsigne
d end, const String& selectionMode, ExceptionState&); |
70 void setSelectionRange(int start, int end, const String& direction); | 70 void setSelectionRange(int start, int end, const String& direction); |
71 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel
ectionHasNoDirection); | 71 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel
ectionHasNoDirection); |
72 PassRefPtr<Range> selection() const; | 72 PassRefPtr<Range> selection() const; |
73 String selectedText() const; | 73 String selectedText() const; |
74 | 74 |
75 virtual void dispatchFormControlChangeEvent(); | 75 virtual void dispatchFormControlChangeEvent() OVERRIDE FINAL; |
76 | 76 |
77 virtual int maxLength() const = 0; | 77 virtual int maxLength() const = 0; |
78 virtual String value() const = 0; | 78 virtual String value() const = 0; |
79 | 79 |
80 HTMLElement* innerTextElement() const; | 80 HTMLElement* innerTextElement() const; |
81 | 81 |
82 void selectionChanged(bool userTriggered); | 82 void selectionChanged(bool userTriggered); |
83 bool lastChangeWasUserEdit() const; | 83 bool lastChangeWasUserEdit() const; |
84 void setInnerTextValue(const String&); | 84 void setInnerTextValue(const String&); |
85 String innerTextValue() const; | 85 String innerTextValue() const; |
(...skipping 12 matching lines...) Expand all Loading... |
98 void cacheSelection(int start, int end, TextFieldSelectionDirection directio
n) | 98 void cacheSelection(int start, int end, TextFieldSelectionDirection directio
n) |
99 { | 99 { |
100 m_cachedSelectionStart = start; | 100 m_cachedSelectionStart = start; |
101 m_cachedSelectionEnd = end; | 101 m_cachedSelectionEnd = end; |
102 m_cachedSelectionDirection = direction; | 102 m_cachedSelectionDirection = direction; |
103 } | 103 } |
104 | 104 |
105 void restoreCachedSelection(); | 105 void restoreCachedSelection(); |
106 bool hasCachedSelection() const { return m_cachedSelectionStart >= 0; } | 106 bool hasCachedSelection() const { return m_cachedSelectionStart >= 0; } |
107 | 107 |
108 virtual void defaultEventHandler(Event*); | 108 virtual void defaultEventHandler(Event*) OVERRIDE; |
109 virtual void subtreeHasChanged() = 0; | 109 virtual void subtreeHasChanged() = 0; |
110 | 110 |
111 void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; } | 111 void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; } |
112 | 112 |
113 String valueWithHardLineBreaks() const; | 113 String valueWithHardLineBreaks() const; |
114 | 114 |
115 private: | 115 private: |
116 int computeSelectionStart() const; | 116 int computeSelectionStart() const; |
117 int computeSelectionEnd() const; | 117 int computeSelectionEnd() const; |
118 TextFieldSelectionDirection computeSelectionDirection() const; | 118 TextFieldSelectionDirection computeSelectionDirection() const; |
119 | 119 |
120 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusDirection)
OVERRIDE; | 120 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusDirection)
OVERRIDE FINAL; |
121 virtual void dispatchBlurEvent(Element* newFocusedElement) OVERRIDE; | 121 virtual void dispatchBlurEvent(Element* newFocusedElement) OVERRIDE FINAL; |
122 | 122 |
123 // Returns true if user-editable value is empty. Used to check placeholder v
isibility. | 123 // Returns true if user-editable value is empty. Used to check placeholder v
isibility. |
124 virtual bool isEmptyValue() const = 0; | 124 virtual bool isEmptyValue() const = 0; |
125 // Returns true if suggested value is empty. Used to check placeholder visib
ility. | 125 // Returns true if suggested value is empty. Used to check placeholder visib
ility. |
126 virtual bool isEmptySuggestedValue() const { return true; } | 126 virtual bool isEmptySuggestedValue() const { return true; } |
127 // Called in dispatchFocusEvent(), after placeholder process, before calling
parent's dispatchFocusEvent(). | 127 // Called in dispatchFocusEvent(), after placeholder process, before calling
parent's dispatchFocusEvent(). |
128 virtual void handleFocusEvent(Element* /* oldFocusedNode */, FocusDirection)
{ } | 128 virtual void handleFocusEvent(Element* /* oldFocusedNode */, FocusDirection)
{ } |
129 // Called in dispatchBlurEvent(), after placeholder process, before calling
parent's dispatchBlurEvent(). | 129 // Called in dispatchBlurEvent(), after placeholder process, before calling
parent's dispatchBlurEvent(). |
130 virtual void handleBlurEvent() { } | 130 virtual void handleBlurEvent() { } |
131 | 131 |
(...skipping 10 matching lines...) Expand all Loading... |
142 return node.isElementNode() && toElement(node).isTextFormControl(); | 142 return node.isElementNode() && toElement(node).isTextFormControl(); |
143 } | 143 } |
144 | 144 |
145 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); | 145 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); |
146 | 146 |
147 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); | 147 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); |
148 | 148 |
149 } // namespace | 149 } // namespace |
150 | 150 |
151 #endif | 151 #endif |
OLD | NEW |