OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 PlainTextRange(int start, int end); | 44 PlainTextRange(int start, int end); |
45 | 45 |
46 size_t end() const { ASSERT(!isNull()); return m_end; } | 46 size_t end() const { ASSERT(!isNull()); return m_end; } |
47 size_t start() const { ASSERT(!isNull()); return m_start; } | 47 size_t start() const { ASSERT(!isNull()); return m_start; } |
48 bool isNull() const { return m_start == kNotFound; } | 48 bool isNull() const { return m_start == kNotFound; } |
49 bool isNotNull() const { return m_start != kNotFound; } | 49 bool isNotNull() const { return m_start != kNotFound; } |
50 size_t length() const { ASSERT(!isNull()); return m_end - m_start; } | 50 size_t length() const { ASSERT(!isNull()); return m_end - m_start; } |
51 | 51 |
52 PassRefPtrWillBeRawPtr<Range> createRange(const ContainerNode& scope) const; | 52 PassRefPtrWillBeRawPtr<Range> createRange(const ContainerNode& scope) const; |
53 PassRefPtrWillBeRawPtr<Range> createRangeForSelection(const ContainerNode& s
cope) const; | 53 PassRefPtrWillBeRawPtr<Range> createRangeForSelection(const ContainerNode& s
cope) const; |
| 54 PassRefPtrWillBeRawPtr<Range> createRangeForInputMethod(const ContainerNode&
scope) const; |
54 | 55 |
55 static PlainTextRange create(const Node& scope, const Range&); | 56 static PlainTextRange create(const Node& scope, const Range&); |
56 | 57 |
57 private: | 58 private: |
58 PlainTextRange& operator=(const PlainTextRange&) WTF_DELETED_FUNCTION; | 59 PlainTextRange& operator=(const PlainTextRange&) WTF_DELETED_FUNCTION; |
59 | 60 |
60 enum GetRangeFor { ForGeneric, ForSelection }; | 61 enum GetRangeFor { ForGeneric, ForSelection, ForInputMethod }; |
61 PassRefPtrWillBeRawPtr<Range> createRangeFor(const ContainerNode& scope, Get
RangeFor) const; | 62 PassRefPtrWillBeRawPtr<Range> createRangeFor(const ContainerNode& scope, Get
RangeFor) const; |
62 | 63 |
63 const size_t m_start; | 64 const size_t m_start; |
64 const size_t m_end; | 65 const size_t m_end; |
65 }; | 66 }; |
66 | 67 |
67 } // namespace WebCore | 68 } // namespace WebCore |
68 | 69 |
69 #endif // PlainTextRange_h | 70 #endif // PlainTextRange_h |
OLD | NEW |