Files
keyboard/CustomKeyboard/Manager/KBEmojiDataProvider.h
2025-12-15 13:24:43 +08:00

47 lines
1.3 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// KBEmojiDataProvider.h
// CustomKeyboard
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
FOUNDATION_EXPORT NSString * const KBEmojiRecentsDidChangeNotification;
@class KBEmojiCategory, KBEmojiItem;
@interface KBEmojiItem : NSObject <NSCopying>
@property (nonatomic, copy, readonly) NSString *value;
@property (nonatomic, copy, readonly) NSString *name;
- (instancetype)initWithValue:(NSString *)value name:(NSString *)name;
@end
@interface KBEmojiCategory : NSObject
@property (nonatomic, copy, readonly) NSString *identifier;
@property (nonatomic, copy, readonly) NSString *displayTitle;
@property (nonatomic, copy, readonly) NSString *iconSymbol;
@property (nonatomic, assign, readonly, getter=isDynamic) BOOL dynamic;
@property (nonatomic, copy, readonly) NSArray<KBEmojiItem *> *items;
@end
@interface KBEmojiDataProvider : NSObject
+ (instancetype)shared;
/// 所有分类(按系统顺序),包含“常用”。
@property (nonatomic, copy, readonly) NSArray<KBEmojiCategory *> *categories;
/// 记录一次 emoji 选择,并刷新“常用”分类。
- (void)recordEmojiSelection:(NSString *)emoji;
/// 重新加载 JSON若首次调用
- (void)reloadIfNeeded;
/// 更新当前语言对应的分类标题。
- (void)refreshLocalizedTitles;
@end
NS_ASSUME_NONNULL_END