Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / editing / PendingSelection.h
blob8a301ddbd7587848d8db909e951efef3d6b8d39d
1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2006 Apple Computer, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
22 #ifndef PendingSelection_h
23 #define PendingSelection_h
25 #include "core/editing/Position.h"
26 #include "core/editing/VisibleSelection.h"
27 #include "platform/heap/Handle.h"
29 namespace blink {
31 class Document;
32 class FrameSelection;
33 class LayoutView;
35 class PendingSelection final : public NoBaseWillBeGarbageCollected<PendingSelection> {
36 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(PendingSelection);
37 public:
38 static PassOwnPtrWillBeRawPtr<PendingSelection> create(FrameSelection& frameSelection)
40 return adoptPtrWillBeNoop(new PendingSelection(frameSelection));
43 bool hasPendingSelection() const { return m_hasPendingSelection; }
44 void setHasPendingSelection() { m_hasPendingSelection = true; }
45 void commit(LayoutView&);
47 DECLARE_TRACE();
49 private:
50 PendingSelection(FrameSelection&);
52 const VisibleSelection& visibleSelection() const;
54 template <typename Strategy>
55 VisibleSelectionTemplate<Strategy> calcVisibleSelectionAlgorithm(const VisibleSelectionTemplate<Strategy>&) const;
56 template <typename Strategy>
57 void commitAlgorithm(LayoutView&);
59 RawPtrWillBeMember<FrameSelection> m_frameSelection;
60 bool m_hasPendingSelection : 1;
63 } // namespace blink
65 #endif