// // MacroCommand.h // PureMVC_ObjectiveC // // PureMVC Port to ObjectiveC by Brian Knorr // PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved. // #import #import "INotification.h" #import "Notifier.h" #import "ICommand.h" /** * A base ICommand implementation that executes other ICommands. * *

* A MacroCommand maintains an list of * ICommand Class references called SubCommands.

* *

* When execute is called, the MacroCommand * instantiates and calls execute on each of its SubCommands turn. * Each SubCommand will be passed a reference to the original * INotification that was passed to the MacroCommand's * execute method.

* *

* Unlike SimpleCommand, your subclass * should not override execute, but instead, should * override the initializeMacroCommand method, * calling addSubCommand once for each SubCommand * to be executed.

* *

* * @see Controller, Notification, SimpleCommand */ @interface MacroCommand : Notifier { NSMutableArray *subCommands; } @property(nonatomic, retain) NSMutableArray *subCommands; -(id)init; -(void)initializeMacroCommand; -(void)addSubCommand:(Class)commandClassRef; +(id)command; @end