52 lines
1.4 KiB
C
52 lines
1.4 KiB
C
|
|
//
|
|||
|
|
// KBAIPersonaSidebarView.h
|
|||
|
|
// keyBoard
|
|||
|
|
//
|
|||
|
|
// Created by Codex on 2026/2/3.
|
|||
|
|
//
|
|||
|
|
|
|||
|
|
#import <UIKit/UIKit.h>
|
|||
|
|
|
|||
|
|
NS_ASSUME_NONNULL_BEGIN
|
|||
|
|
|
|||
|
|
@class KBPersonaModel;
|
|||
|
|
@class KBAIPersonaSidebarView;
|
|||
|
|
|
|||
|
|
@protocol KBAIPersonaSidebarViewDelegate <NSObject>
|
|||
|
|
@optional
|
|||
|
|
/// 侧边栏请求人设数据
|
|||
|
|
/// page 从 1 开始
|
|||
|
|
- (void)personaSidebarView:(KBAIPersonaSidebarView *)view
|
|||
|
|
requestPersonasAtPage:(NSInteger)page;
|
|||
|
|
/// 选择某个人设
|
|||
|
|
- (void)personaSidebarView:(KBAIPersonaSidebarView *)view
|
|||
|
|
didSelectPersona:(KBPersonaModel *)persona;
|
|||
|
|
@end
|
|||
|
|
|
|||
|
|
/// 人设侧边栏(LSTPopView 内容视图)
|
|||
|
|
@interface KBAIPersonaSidebarView : UIView
|
|||
|
|
|
|||
|
|
@property (nonatomic, weak) id<KBAIPersonaSidebarViewDelegate> delegate;
|
|||
|
|
@property (nonatomic, assign) NSInteger selectedPersonaId;
|
|||
|
|
@property (nonatomic, assign, readonly) NSInteger currentPage;
|
|||
|
|
|
|||
|
|
/// 更新人设列表
|
|||
|
|
/// reset=YES 表示重置并替换数据;reset=NO 表示追加
|
|||
|
|
/// currentPage 为当前已加载页数(从 1 开始)
|
|||
|
|
- (void)updatePersonas:(NSArray<KBPersonaModel *> *)personas
|
|||
|
|
reset:(BOOL)reset
|
|||
|
|
hasMore:(BOOL)hasMore
|
|||
|
|
currentPage:(NSInteger)currentPage;
|
|||
|
|
/// 请求数据(若为空)
|
|||
|
|
- (void)requestPersonasIfNeeded;
|
|||
|
|
/// 更新选中态
|
|||
|
|
- (void)updateSelectedPersonaId:(NSInteger)personaId;
|
|||
|
|
/// 结束加载更多
|
|||
|
|
- (void)endLoadingMore;
|
|||
|
|
/// 重置加载更多状态
|
|||
|
|
- (void)resetLoadMore;
|
|||
|
|
|
|||
|
|
@end
|
|||
|
|
|
|||
|
|
NS_ASSUME_NONNULL_END
|