// // KMToolbar.h // // Copyright © 2022 Kdan Mobile. All rights reserved. // #import #import "KMCustomButtonPopMenuViewController.h" typedef NS_ENUM(NSInteger, KMToolBoxImagePosition) { KMToolBoxImagePosition_Only = 0, KMToolBoxImagePosition_Left, KMToolBoxImagePosition_ExpandLeft, KMToolBoxImagePosition_Above, }; extern NSString *KMNewToolbarSpaceItemIdentifier; extern NSString *KMToolbarDividerItemIdentifier; @interface KMToolbarClickButton : NSButton @property (nonatomic,assign) id clickObject; @end @interface KMToolBoxItem : NSView @property (nonatomic,retain) NSMenuItem *menuFormRepresentation; @property (nonatomic,readonly) NSString *itemIdentifier; @property(nonatomic,readonly) KMToolbarClickButton *clickButton; @property (nonatomic,assign) BOOL isSelected; @property (nonatomic,assign) BOOL unEnabled; @property (nonatomic,assign) BOOL isShowCustomToolTip; @property (nonatomic,assign) KMToolBoxImagePosition boxImagePosition; @property (nonatomic,retain) NSImage * image; @property (nonatomic,retain) NSImage * selectedImage; @property (nonatomic,retain) NSString * titleName; @property (nonatomic,retain) NSImage * alternateImage; @property (nonatomic,assign) id target; @property (nonatomic,assign) BOOL needExpandAction; @property (nonatomic,assign) NSInteger btnTag; @property (nonatomic,assign) SEL btnAction; @property (nonatomic,retain) NSView *customizeView; @property (nonatomic,assign) BOOL isMainTool; @property (nonatomic,retain) NSView *linView; @property (nonatomic,retain) NSColor *normalBackgroundColor; @property (nonatomic,retain) NSColor *selectedBackgroundColor; - (instancetype)initWithItemIdentifier:(NSString *)itemIdentifier postition:(KMToolBoxImagePosition)imagePositionImagePosition withPopMenu:(KMCustomButtonPopMenuViewController *)popMenuViewController; - (instancetype)initWithItemIdentifier:(NSString *)itemIdentifier; @end @protocol KMNewToolbarDelegate; @interface KMToolbar : NSView @property (nonatomic,readonly) NSString *toolbarIdentifier; @property (nonatomic,weak) id delegate; @property (nonatomic,readonly) NSArray *items; - (instancetype)initWithIdentifier:(NSString *)identifier; - (void)reloadData; - (KMToolBoxItem * _Nullable)itemForItemIdentifier:(NSString * _Nonnull)itemIdentifier; @end @protocol KMNewToolbarDelegate @optional - (KMToolBoxItem *)toolbar:(KMToolbar *)toolbar itemForItemIdentifier:(NSString *)identifier; - (NSArray *)toolbarAllowedItemIdentifiers:(KMToolbar *)toolbar; - (NSArray *)toolbarDefaultItemIdentifiers:(KMToolbar *)toolbar; - (NSArray *)toolbarLeftDefaultItemIdentifiers:(KMToolbar *)toolbar; - (NSArray *)toolbarRightDefaultItemIdentifiers:(KMToolbar *)toolbar; @end