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 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef PlainTextRange_h | 26 #ifndef PlainTextRange_h |
27 #define PlainTextRange_h | 27 #define PlainTextRange_h |
28 | 28 |
29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
30 #include "core/editing/EphemeralRange.h" | 30 #include "core/editing/EphemeralRange.h" |
31 #include "platform/heap/Handle.h" | 31 #include "platform/heap/Handle.h" |
| 32 #include "wtf/Allocator.h" |
32 #include "wtf/NotFound.h" | 33 #include "wtf/NotFound.h" |
33 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
34 | 35 |
35 namespace blink { | 36 namespace blink { |
36 | 37 |
37 class ContainerNode; | 38 class ContainerNode; |
38 class Range; | 39 class Range; |
39 | 40 |
40 class CORE_EXPORT PlainTextRange { | 41 class CORE_EXPORT PlainTextRange { |
| 42 STACK_ALLOCATED(); |
41 public: | 43 public: |
42 PlainTextRange(); | 44 PlainTextRange(); |
43 PlainTextRange(const PlainTextRange&); | 45 PlainTextRange(const PlainTextRange&); |
44 explicit PlainTextRange(int location); | 46 explicit PlainTextRange(int location); |
45 PlainTextRange(int start, int end); | 47 PlainTextRange(int start, int end); |
46 | 48 |
47 size_t end() const { ASSERT(!isNull()); return m_end; } | 49 size_t end() const { ASSERT(!isNull()); return m_end; } |
48 size_t start() const { ASSERT(!isNull()); return m_start; } | 50 size_t start() const { ASSERT(!isNull()); return m_start; } |
49 bool isNull() const { return m_start == kNotFound; } | 51 bool isNull() const { return m_start == kNotFound; } |
50 bool isNotNull() const { return m_start != kNotFound; } | 52 bool isNotNull() const { return m_start != kNotFound; } |
(...skipping 11 matching lines...) Expand all Loading... |
62 enum GetRangeFor { ForGeneric, ForSelection }; | 64 enum GetRangeFor { ForGeneric, ForSelection }; |
63 EphemeralRange createRangeFor(const ContainerNode& scope, GetRangeFor) const
; | 65 EphemeralRange createRangeFor(const ContainerNode& scope, GetRangeFor) const
; |
64 | 66 |
65 const size_t m_start; | 67 const size_t m_start; |
66 const size_t m_end; | 68 const size_t m_end; |
67 }; | 69 }; |
68 | 70 |
69 } // namespace blink | 71 } // namespace blink |
70 | 72 |
71 #endif // PlainTextRange_h | 73 #endif // PlainTextRange_h |
OLD | NEW |