#import <UIKit/UIKit.h>typedefenum{AMMenuItemStyleDefault=0,// Default display style (what the user has selected)AMMenuItemStyleText=1,// Always display textAMMenuItemStyleImage=2,// Display image where available, otherwise display text}AMMenuItemStyle;typedefenum{AMActionMenuBehaviorDefault=0,// Default additional behaviors provided by Action MenuAMActionMenuBehaviorDisableMenu=(1<<0),// Disable the popup menu that Action Menu has added}AMActionMenuBehaviors;#define kAMMenuItemPrioritySelect 100#define kAMMenuItemPrioritySelectAll 200#define kAMMenuItemPriorityCut 300#define kAMMenuItemPriorityCopy 400#define kAMMenuItemPriorityPaste 500#define kAMMenuItemPriorityDelete 600#define kAMMenuItemPriorityCorrect 900#define kAMMenuItemPriorityDefault 1000#define kAMMenuItemPriorityCopyAll 450#define kAMMenuItemPriorityHistory 525#define kAMMenuItemPriorityFavorites 550#define kAMMenuItemPriorityDial 925#define kAMMenuItemPriorityLookup 950#define kAMMenuItemPriorityFind 975#define kAMMenuItemPriorityTweet 1100#define kAMMenuItemPriorityScroll 1200#define kAMMenuItemPriorityBuiltins 510@protocolAMMenuItem<NSObject>@property(nonatomic,readonly,assign)SELaction;// Selector that will be sent to the target when menu item is pressed@property(nonatomic,readonly,assign)SELcanPerform;// Selector that will be sent to the target to query whether menu item is valid@property(nonatomic,readwrite,copy)NSString*title;// Localized title of the menu item@property(nonatomic,readwrite,assign)UIImage*image;// Image that will be used to display the menu item@property(nonatomic,readwrite,assign)AMMenuItemStylestyle;// Style of the menu item@property(nonatomic,readwrite,assign)NSIntegerpriority;// Specify the priority of the item@end@interfaceUIMenuController(ActionMenu)// Plugin Registration functions-(id<AMMenuItem>)registerAction:(SEL)actiontitle:(NSString*)titlecanPerform:(SEL)canPerform;-(id<AMMenuItem>)registerAction:(SEL)actiontitle:(NSString*)titlecanPerform:(SEL)canPerformforPlugin:(NSString*)pluginName;// action will be sent to the target when the menu item has been pressed// canPerform will be sent to the target when the menu is about to be shown and we need to know if the menu item is valid// title is the localized title of the menu item// pluginName is the unlocalized title of the plugin@end@interfaceUIResponder(ActionMenu)-(NSString*)textualRepresentation;-(NSString*)cachedTextualRepresentation;// Called by plugins to get the text of the object; implement manually for custom views-(NSString*)selectedTextualRepresentation;-(NSString*)cachedSelectedTextualRepresentation;// Returns only the selected text; if unimplemented, will call and return textualRepresentation-(AMActionMenuBehaviors)actionMenuBehaviors;// Control which additional ActionMenu behaviors are valid on this target-(BOOL)always;// Always returns YES (used by actions that are always valid)@end@interfaceUIAlertView(ActionMenu)-(void)showAboveExistingAlert;@end/* Notes: Plugins will be loaded lazily from /Libary/ActionMenu/Plugins when the menu is first shown; this is usually much later than one might expect. If the user disables a plugin after it has been loaded, the plugin will still be resident in memory, but its items will no longer show. If the user enables a plugin, it will be loaded the next time the menu becomes visible. Plugins may be either .dylibs or .bundles Dylib plugins get a ON/OFF switch in the preferences pane. Bundle plugins get their own subpane to do what they please with.*/