重构
This commit is contained in:
42
CustomKeyboard/View/KBKeyboardView/KBKeyboardLayoutEngine.h
Normal file
42
CustomKeyboard/View/KBKeyboardView/KBKeyboardLayoutEngine.h
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// KBKeyboardLayoutEngine.h
|
||||
// CustomKeyboard
|
||||
//
|
||||
// Layout metrics calculation helper.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class KBKeyboardLayoutConfig;
|
||||
@class KBKeyboardLayout;
|
||||
@class KBKeyboardRowConfig;
|
||||
@class KBKeyboardRowItem;
|
||||
@class KBKeyboardKeyFactory;
|
||||
@class KBKey;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KBKeyboardLayoutEngine : NSObject
|
||||
|
||||
- (instancetype)initWithLayoutConfig:(KBKeyboardLayoutConfig *)layoutConfig;
|
||||
|
||||
- (CGFloat)rowSpacingForLayout:(KBKeyboardLayout *)layout;
|
||||
- (CGFloat)topInsetForLayout:(KBKeyboardLayout *)layout;
|
||||
- (CGFloat)bottomInsetForLayout:(KBKeyboardLayout *)layout;
|
||||
|
||||
- (CGFloat)rowHeightForRow:(KBKeyboardRowConfig *)row;
|
||||
- (CGFloat)gapForRow:(KBKeyboardRowConfig *)row;
|
||||
- (CGFloat)insetLeftForRow:(KBKeyboardRowConfig *)row;
|
||||
- (CGFloat)insetRightForRow:(KBKeyboardRowConfig *)row;
|
||||
|
||||
- (CGFloat)widthForItem:(KBKeyboardRowItem *)item key:(KBKey *)key;
|
||||
- (CGFloat)fontSizeForItem:(KBKeyboardRowItem *)item key:(KBKey *)key;
|
||||
- (CGFloat)fontSizeForFontKey:(NSString *)fontKey;
|
||||
|
||||
- (CGFloat)calculateUniformCharKeyWidthForRows:(NSArray<KBKeyboardRowConfig *> *)rows
|
||||
keyFactory:(KBKeyboardKeyFactory *)keyFactory
|
||||
shiftOn:(BOOL)shiftOn;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Reference in New Issue
Block a user