// // KBToolBar.h // CustomKeyboard // // Created by Mac on 2025/10/28. // #import NS_ASSUME_NONNULL_BEGIN @class KBToolBar; @protocol KBToolBarDelegate @optional /// 左侧功能按钮点击(index 从 0 开始) - (void)toolBar:(KBToolBar *)toolBar didTapActionAtIndex:(NSInteger)index; /// 右侧设置按钮点击 - (void)toolBarDidTapSettings:(KBToolBar *)toolBar; /// 右侧撤销删除按钮点击 - (void)toolBarDidTapUndo:(KBToolBar *)toolBar; @end /// 顶部工具栏:左侧按钮数量可变,右侧为设置/撤销等功能区。 @interface KBToolBar : UIView @property (nonatomic, weak, nullable) id delegate; /// 左侧按钮的标题(数量由数组决定)。默认值:@[@"AI"]。 @property (nonatomic, copy) NSArray *leftButtonTitles; /// 暴露按钮以便外部定制(只读;首次访问时懒加载创建) @property (nonatomic, strong, readonly) NSArray *leftButtons; @property (nonatomic, strong, readonly) UIButton *settingsButton; @property (nonatomic, strong, readonly) UIButton *undoButton; /// 应用皮肤(更新 AI 按钮背景图) - (void)kb_applyTheme; @end NS_ASSUME_NONNULL_END