123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- //
- // KMToolbar.h
- //
- // Copyright © 2022 Kdan Mobile. All rights reserved.
- //
- #import <Cocoa/Cocoa.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
- postition:(KMToolBoxImagePosition)imagePositionImagePosition;
- - (instancetype)initWithItemIdentifier:(NSString *)itemIdentifier;
- @end
- @protocol KMNewToolbarDelegate;
- @interface KMToolbar : NSView
- @property (nonatomic,readonly) NSString *toolbarIdentifier;
- @property (nonatomic,weak) id<KMNewToolbarDelegate> delegate;
- @property (nonatomic,readonly) NSArray<KMToolBoxItem *> *items;
- - (instancetype)initWithIdentifier:(NSString *)identifier;
- - (void)reloadData;
- - (KMToolBoxItem * _Nullable)itemForItemIdentifier:(NSString * _Nonnull)itemIdentifier;
- @end
- @protocol KMNewToolbarDelegate <NSObject>
- @optional
- - (KMToolBoxItem *)toolbar:(KMToolbar *)toolbar itemForItemIdentifier:(NSString *)identifier;
- - (NSArray<NSString *> *)toolbarAllowedItemIdentifiers:(KMToolbar *)toolbar;
- - (NSArray<NSString *> *)toolbarDefaultItemIdentifiers:(KMToolbar *)toolbar;
- - (NSArray<NSString *> *)toolbarLeftDefaultItemIdentifiers:(KMToolbar *)toolbar;
- - (NSArray<NSString *> *)toolbarRightDefaultItemIdentifiers:(KMToolbar *)toolbar;
- @end
|