#import "../ui/toolbar.h"
#import "toolkit.h"
#import <stdarg.h>
@protocol UiToolItem
- (NSToolbarItem *) createItem:(NSToolbar*)toolbar
identifier:(NSString*)identifier
object:(UiObject*)obj;
- (void) addGroup:(int)group;
- (UcxList*) groups;
@end
@interface UiToolbarStockItem : NSObject <UiToolItem> {
char *name;
char *stockid;
ui_callback callback;
void *userdata;
UcxList *groups;
BOOL isToggleButton;
}
- (UiToolbarStockItem*) initWithIdentifier:(char*)identifier
stockID:(char*)sid
callback:(ui_callback)f
userdata:(void*)data;
- (void) setIsToggleButton:(BOOL)t;
@end
@interface UiToolbarItem : NSObject <UiToolItem> {
char *name;
char *label;
ui_callback callback;
void *userdata;
UcxList *groups;
BOOL isToggleButton;
}
- (UiToolbarItem*) initWithIdentifier:(char*)identifier
label:(char*)lbl
callback:(ui_callback)f
userdata:(void*)data;
- (void) setIsToggleButton:(BOOL)t;
@end
@interface UiToolbarDelegate : NSObject <NSToolbarDelegate> {
NSMutableArray *allowedItems;
NSMutableArray *defaultItems;
NSMutableDictionary *items;
}
- (UiToolbarDelegate*) init;
- (void) addDefault:(NSString*)identifier;
- (void) addItem: (NSString*) identifier
item: (NSObject<UiToolItem>*) item;
@end
@interface UiToolbar : NSToolbar {
UiObject *obj;
}
- (UiToolbar*) initWithObject:(UiObject*)object;
- (UiObject*) object;
@end
void ui_toolbar_init();
void ui_toolbar_stock_button(char *name, char *stockid, BOOL toggle, ui_callback f, void *udata, va_list ap);
NSToolbar* ui_create_toolbar(UiObject *obj);