All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.smileys_emotion.emotion._allEmotion.kt Maven / Gradle / Ivy

The newest version!
package org.kodein.emoji.smileys_emotion.emotion

import org.kodein.emoji.Emoji
import org.kodein.emoji.EmojiFinder
import org.kodein.emoji.addSt1Variations
import org.kodein.emoji.addSt2Variations


internal fun EmojiFinder.addAllEmotion() {
    add(intArrayOf(0x1f48b), _KissMark)
    add(intArrayOf(0x1f4af), _HundredPoints)
    add(intArrayOf(0x1f4a2), _AngerSymbol)
    add(intArrayOf(0x1f4a5), _Collision)
    add(intArrayOf(0x1f4ab), _Dizzy)
    add(intArrayOf(0x1f4a6), _SweatDroplets)
    add(intArrayOf(0x1f4a8), _DashingAway)
    add(intArrayOf(0x1f573, 0xfe0f), _Hole)
    add(intArrayOf(0x1f573), _Hole)
    add(intArrayOf(0x1f4ac), _SpeechBalloon)
    add(intArrayOf(0x1f441, 0xfe0f, 0x200d, 0x1f5e8, 0xfe0f), _EyeInSpeechBubble)
    add(intArrayOf(0x1f441, 0x200d, 0x1f5e8, 0xfe0f), _EyeInSpeechBubble)
    add(intArrayOf(0x1f441, 0xfe0f, 0x200d, 0x1f5e8), _EyeInSpeechBubble)
    add(intArrayOf(0x1f441, 0x200d, 0x1f5e8), _EyeInSpeechBubble)
    add(intArrayOf(0x1f5e8, 0xfe0f), _LeftSpeechBubble)
    add(intArrayOf(0x1f5e8), _LeftSpeechBubble)
    add(intArrayOf(0x1f5ef, 0xfe0f), _RightAngerBubble)
    add(intArrayOf(0x1f5ef), _RightAngerBubble)
    add(intArrayOf(0x1f4ad), _ThoughtBalloon)
    add(intArrayOf(0x1f4a4), _Zzz)
}

internal suspend fun SequenceScope.yieldAllEmotion() {
    yield(_KissMark)
    yield(_HundredPoints)
    yield(_AngerSymbol)
    yield(_Collision)
    yield(_Dizzy)
    yield(_SweatDroplets)
    yield(_DashingAway)
    yield(_Hole)
    yield(_SpeechBalloon)
    yield(_EyeInSpeechBubble)
    yield(_LeftSpeechBubble)
    yield(_RightAngerBubble)
    yield(_ThoughtBalloon)
    yield(_Zzz)
}

internal val countEmotion = 14

/**
 * All Emoji of the Smileys & Emotion: emotion subgroup.
*/
public fun Emoji.Companion.sequenceEmotion(): Sequence =
    sequence { yieldAllEmotion() }

/**
 * All Emoji of the Smileys & Emotion: emotion subgroup.
 *
 * WARNING: This can be quite heavy to construct.
 * This method should be called in background and its result should be cached.
*/
public fun Emoji.Companion.listEmotion(): List =
    ArrayList(countEmotion).also { list -> sequenceEmotion().forEach { list.add(it) } }

@Deprecated("Renamed listEmotion.", replaceWith = ReplaceWith("listEmotion()"), level = DeprecationLevel.WARNING)
public fun Emoji.Companion.allEmotion(): List =
    listEmotion()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy