| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #define PendingSelection_h | 23 #define PendingSelection_h |
| 24 | 24 |
| 25 #include "core/editing/Position.h" | 25 #include "core/editing/Position.h" |
| 26 #include "core/editing/VisibleSelection.h" | 26 #include "core/editing/VisibleSelection.h" |
| 27 #include "platform/heap/Handle.h" | 27 #include "platform/heap/Handle.h" |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 class Document; | 31 class Document; |
| 32 class FrameSelection; | 32 class FrameSelection; |
| 33 class LayoutView; |
| 33 | 34 |
| 34 class PendingSelection final : public NoBaseWillBeGarbageCollected<PendingSelect
ion> { | 35 class PendingSelection final : public NoBaseWillBeGarbageCollected<PendingSelect
ion> { |
| 35 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(PendingSelection); | 36 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(PendingSelection); |
| 36 public: | 37 public: |
| 37 static PassOwnPtrWillBeRawPtr<PendingSelection> create() | 38 static PassOwnPtrWillBeRawPtr<PendingSelection> create() |
| 38 { | 39 { |
| 39 return adoptPtrWillBeNoop(new PendingSelection); | 40 return adoptPtrWillBeNoop(new PendingSelection); |
| 40 } | 41 } |
| 41 | 42 |
| 42 bool hasPendingSelection() const { return m_hasPendingSelection; } | 43 bool hasPendingSelection() const { return m_hasPendingSelection; } |
| 43 void setSelection(const FrameSelection&); | 44 void setSelection(const FrameSelection&); |
| 44 void clear(); | 45 void commit(LayoutView&); |
| 45 | |
| 46 bool isInDocument(const Document&) const; | |
| 47 VisibleSelection calcVisibleSelection() const; | |
| 48 | 46 |
| 49 DECLARE_TRACE(); | 47 DECLARE_TRACE(); |
| 50 | 48 |
| 51 private: | 49 private: |
| 52 PendingSelection(); | 50 PendingSelection(); |
| 53 | 51 |
| 54 template <typename Strategy> | 52 template <typename Strategy> |
| 55 bool isInDocumentAlgorithm(const Document&) const; | 53 bool isInDocumentAlgorithm(const Document&) const; |
| 56 | 54 |
| 57 template <typename Strategy> | 55 template <typename Strategy> |
| 58 VisibleSelection calcVisibleSelectionAlgorithm() const; | 56 VisibleSelection calcVisibleSelectionAlgorithm() const; |
| 57 void clear(); |
| 58 template <typename Strategy> |
| 59 void commitAlgorithm(LayoutView&); |
| 60 bool isInDocument(const Document&) const; |
| 59 | 61 |
| 60 VisibleSelection m_selection; | 62 VisibleSelection m_selection; |
| 61 bool m_hasPendingSelection : 1; | 63 bool m_hasPendingSelection : 1; |
| 62 bool m_shouldShowBlockCursor : 1; | 64 bool m_shouldShowBlockCursor : 1; |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 } // namespace blink | 67 } // namespace blink |
| 66 | 68 |
| 67 #endif | 69 #endif |
| OLD | NEW |