// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

namespace Microsoft.Terminal.UI
{
    /// <summary>
    /// Categorizes the type of a single grapheme cluster or input text.
    /// Used to determine how the input should be handled or rendered (for example,
    /// whether it should be treated as an emoji, an icon from a symbol font, plain text, etc.).
    /// </summary>
    enum FontIconGlyphKind
    {
        /// <summary>
        /// Input is invalid or contains more than one grapheme cluster and therefore cannot be
        /// treated as a single symbol. Typical for multi-character text like file paths
        /// or composed strings that include separators.
        /// </summary>
        Invalid = -1,

        /// <summary>
        /// No grapheme present (empty string). Indicates absence of a symbol.
        /// </summary>
        None = 0,

        /// <summary>
        /// A single emoji grapheme cluster. This may consist of multiple Unicode code
        /// points combined into one visible glyph (e.g., emoji with modifiers or ZWJ sequences).
        /// </summary>
        Emoji = 1,

        /// <summary>
        /// A single glyph from the Segoe Fluent Icons / MDL2 Assets Private Use Area (PUA),
        /// typically in the Unicode range U+E700–U+F8FF. These are font-based icons (Fluent/MDL2).
        /// </summary>
        FluentSymbol = 2,

        /// <summary>
        /// A single non-emoji grapheme that is not a Fluent/MDL2 PUA symbol.
        /// Covers ordinary characters, letters, numbers, or other single glyph symbols.
        /// </summary>
        Other = 3,
    };

    /// <summary>
    /// Static utility class for text and icon analysis
    /// </summary>
    static runtimeclass FontIconGlyphClassifier
    {
        /// <summary>
        /// Determines if text represents a single grapheme cluster (emoji/symbol icon).
        /// Uses ICU for Unicode boundary detection to distinguish icons from file paths.
        /// </summary>
        /// <param name="text">Text to analyze</param>
        /// <returns>True if single grapheme cluster, false for multi-character text or paths</returns>
        static Boolean IsLikelyToBeEmojiOrSymbolIcon(String text);

        /// <summary>
        /// Classifies the input into a glyph kind suitable for icon or text rendering.
        /// </summary>
        static FontIconGlyphKind Classify(String text);
    };
}
