Homer Library
HomerCommand
HomerCommand::HomerCommand()
Sets the name to NULL.
HomerCommand::~HomerCommand();
Deletes the name if non NULL.
char* GetName() const;
void SetName(const char* name);
Returns or sets the name of the command. When setting the name, the former name is deleted if any.
BView* DefaultCommandView(const char* label)
This constructs the default command view (that is, a view without any parameter of any type) but a simple text label.
virtual BView* CommandView()
This methods returns an instance of the command view. It is used in HomerEditor to set the commands parameters. By default, this methods uses return the result of DefaultCommandView("no parameters"). This method mustn't fail (by returning NULL).
virtual status_t GetConfig(BMessage* config, BView* command_view);
This retrieves the parameters values from command_view to the config container. By default, this method does nothing and returns B_OK.
virtual status_t SetConfig(BMessage* config, BView* command_view);
This set the parameters for command_view base on the information contained in config.
virtual status_tl Process(entry_ref entry, BMessage* config, BLooper* msg_target);
This actually processes the entry. The parameters are taken
from config. If any message has to be sent, msg_target is used. See the part of the Homer
library which deals with issuing messages.
There are 2 special values that can be returned by a command:
extern char HOMER_SYMBOL addonName[];
extern char HOMER_SYMBOL addonVersion[];
extern char HOMER_SYMBOL addonAuthor[];
extern char HOMER_SYMBOL addonEmail[];
extern "C" HOMER_SYMBOL HomerCommand* instantiate_command();
These symbols are required so that the command add-ons are recognized by Homer.
This page was last updated on 12/12/99.