CaretAssociationHint.h (1189B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_CaretAssociationHint_h 8 #define mozilla_CaretAssociationHint_h 9 10 namespace mozilla { 11 12 template <typename PT, typename CT> 13 class RangeBoundaryBase; 14 15 namespace intl { 16 class BidiEmbeddingLevel; 17 }; 18 19 /** 20 * Hint whether a caret is associated with the content before a 21 * given character offset (Before), or with the content after a given 22 * character offset (After). 23 */ 24 enum class CaretAssociationHint { Before, After }; 25 26 /** 27 * Return better caret association hint for aCaretPoint than aDefault. 28 * This computes the result from layout. Therefore, you should flush pending 29 * layout before calling this. 30 */ 31 template <typename PT, typename CT> 32 CaretAssociationHint ComputeCaretAssociationHint( 33 CaretAssociationHint aDefault, intl::BidiEmbeddingLevel aBidiLevel, 34 const RangeBoundaryBase<PT, CT>& aCaretPoint); 35 36 } // namespace mozilla 37 38 #endif