Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_M_CommandHandler Class Reference

Singleton class that manages the registration and lookup of commands. More...

Inheritance diagram for CP_M_CommandHandler:

CP_SigSlot::CP_SlotObject CP_Application_Imp CP_Document_Base CP_View_Imp CP_View_Imp_Base CP_Application< DOC_POLICY, PRINT_POLICY, UNDO_POLICY > CP_Document< UNDO_POLICY, PRINT_POLICY > CP_View CP_View_Imp_Control CP_BackgroundView CP_FocusBorder CP_LittleArrowsEditBuddy CP_OpenGLView CP_PlatformControl CP_PrintView CP_QT_MovieView CP_ScrollableView CP_Scroller CP_SelectColorButton CP_Splitter CP_TextView CP_Toolbar CP_Window_Imp CP_View_Imp_ControlScroller CP_View_Imp_MLTE CP_View_Imp_Toolbar CP_View_Imp_Toolbar_Item List of all members.

Public Member Functions

void disconnect_all ()
void signal_connect (CP_Signal *inSender)
void signal_disconnect (CP_Signal *inSender)
Constructor / Destructor
 CP_M_CommandHandler ()
 Constructor.
virtual ~CP_M_CommandHandler ()
 Destructor.

Protected Attributes

CP_Commands_ArrayfCommands
CP_MenuSelectionSignalfMennuSelectionSignal
sender_set fSenders

Detailed Description

This class is used to register CP_CommandNos and their associated flags, or signals that are used when the user causes some action that will cause the command to be called.


Constructor & Destructor Documentation

CP_M_CommandHandler::CP_M_CommandHandler  ) 
 

Constructor.

Exceptions:
none 

CP_M_CommandHandler::~CP_M_CommandHandler  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

bool CP_M_CommandHandler::UpdateCommandStatus CP_CommandNo  inOSCommand,
CP_CommandStatus inOutCommandStatus
 

Updates the status of a command.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
inOutCommandStatus CP_CommandStatus object that holds the result of the update for the command.
Exceptions:
none 
Returns:
bool True if the command was handled.

bool CP_M_CommandHandler::UpdateCommandStatusForAppState CP_CommandNo  inOSCommand,
CP_CommandStatus inOutCommandStatus,
CP_Command inCommand
[virtual]
 

Updates the status of a command based on the current state of the application.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
inOutCommandStatus CP_CommandStatus object that holds the result of the update for the command.
inCommand CP_Command object with the command.
Exceptions:
none 
Returns:
bool True if the command was handled.

OSStatus CP_M_CommandHandler::HandleCommand CP_CommandNo  inOSCommand  ) 
 

Handles the processing of a command. If the command has been registered with this class, then its signal will be called.

If the command has not been registered, then this function does nothing with the passed in command.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
Exceptions:
NULL exceptions.
Returns:
OSStatus Result of the command handling.

CP_MenuSelectionSignal* CP_M_CommandHandler::GetMenuSelectionSignal  ) 
 

Returns the signal called when a menu item is selected and has no command associated with it.

Exceptions:
none 
Returns:
CP_MenuSelectionSignal * Returns the menu selection signal.

void CP_M_CommandHandler::RegisterCommand CP_CommandNo  inOSCommand,
CP_CommandHandlerSignal inCommandHandler,
CP_CommandStatusSignal inCommandStatus
 

Registers the passed in command. This places the command in a list of commands we will handle updating the status for, and when called executing the signal registered for the command.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
inCommandHandler The CP_CommandHandlerSignal called when the command is called to be executed. Note: This signal will be deleted when the command is removed from the list of commands, and should be unique for each command, ie don't assign the same signal to the same command.
inCommandStatus The CP_CommandStatusSignal called when the commands status needs to be updated. Note: This signal will be deleted when the command is removed from the list of commands, and should be unique for each command, ie don't assign the same signal to the same command.
Exceptions:
none 
Returns:
void

void CP_M_CommandHandler::RegisterCommand CP_CommandNo  inOSCommand,
CP_CommandHandlerSignal inCommandHandler,
SInt32  inFlags
 

Registers the passed in command. This places the command in a list of commands we will handle updating the status for, and when called executing the signal registered for the command.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
inCommandHandler The CP_CommandHandlerSignal called when the command is called to be executed. Note: This signal will be deleted when the command is removed from the list of commands, and should be unique for each command, ie don't assign the same signal to the same command.
inFlags Flags used to update the status of the command instead of calling a signal to do the updating.
Exceptions:
none 
Returns:
void

CP_CommandHandlerSignal * CP_M_CommandHandler::RegisterCommand CP_CommandNo  inOSCommand,
SInt32  inFlags
 

Registers the passed in command. This places the command in a list of commands we will handle updating the status for. You are returned the signal object that you need to connect your slot to.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
inFlags Flags used to update the status of the command instead of calling a signal to do the updating.
Exceptions:
none 
Returns:
CP_CommandHandlerSignal The command handler signal that will be called when the command is executed. You need to connect your slot to this signal.

CP_CommandStatusSignal * CP_M_CommandHandler::RegisterUpdateStatusHandler CP_CommandNo  inOSCommand  ) 
 

Registers the passed in command, returning the command status signal. If the command already exists, we will return the existing command status signal if there is one, otherwise we create a new signal, and return that signal. If there is already a signal, then return the existing signal.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
Exceptions:
none 
Returns:
CP_CommandStatusSignal The command status signal that will be called when the command is executed. You need to connect your slot to this signal.

CP_CommandHandlerSignal * CP_M_CommandHandler::RegisterCommandHandler CP_CommandNo  inOSCommand  ) 
 

Registers the passed in command, returning the command handling signal. If the command already exists, we will return the existing command handler signal if there is one, otherwise we create a new signal, and return that signal. If there is already a signal, then return the existing signal.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
Exceptions:
none 
Returns:
CP_CommandHandlerSignal The command handler signal that will be called when the command is executed. You need to connect your slot to this signal.

bool CP_M_CommandHandler::IsRegisteredCommand CP_CommandNo  inOSCommand  )  const
 

Returns true if the passed in command is known to this class.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
Exceptions:
none 
Returns:
bool const Returns true if we have previously registered the passed in command.

void CP_M_CommandHandler::ReplaceCommand CP_CommandNo  inOSCommand,
CP_Command inCommand
 

Replaces a CP_Command for the passed in command number.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
inCommand The CP_Command to replace with.
Exceptions:
none 
Returns:
void

void CP_M_CommandHandler::UnRegisterCommand CP_CommandNo  inOSCommand  ) 
 

Unregisters a command.

Parameters:
inOSCommand The CP_CommandNo to remove from the list of known commands we handle.
Exceptions:
none 
Returns:
void

CP_Command * CP_M_CommandHandler::GetCommand CP_CommandNo  inOSCommand  ) 
 

Returns the CP_Command object associated with the passed in command number.

Parameters:
inOSCommand The CP_CommandNo assigned to the command.
Exceptions:
none 
Returns:
CP_Command * CP_Command object associated with the passed in command number. Note: This will return a NULL CP_Command if the command has not been registered yet.

OSStatus CP_M_CommandHandler::HandleCommand HICommand  inCommand,
CP_Menu inMenu = NULL
 

Signal called when a menu item is selected with no associated command.

OSStatus CP_M_CommandHandler::HandleCommandUpdateStatus HICommand  inCommand,
CP_Menu inMenu = NULL
 

MacOS - Handles the processing of the passed in HICommand. This will translate the HICommand into a CPLAT CP_CommandNo for processing and updating the status of the command.

Parameters:
inCommand The HICommand to be handled.
Exceptions:
OSError exceptions.
Returns:
OSStatus Result of the command handling.

OSStatus CP_M_CommandHandler::UpdateCommandStatusOS CP_CommandStatus  inCommandStatus,
bool  inResult,
HICommand  inCommand
 

void CP_SigSlot::CP_SlotObject::disconnect_all  )  [inherited]
 

void CP_SigSlot::CP_SlotObject::signal_connect CP_Signal inSender  )  [inherited]
 

void CP_SigSlot::CP_SlotObject::signal_disconnect CP_Signal inSender  )  [inherited]
 


Member Data Documentation

CP_Commands_Array* CP_M_CommandHandler::fCommands [protected]
 

CP_MenuSelectionSignal* CP_M_CommandHandler::fMennuSelectionSignal [protected]
 

List of commands managed by this class.

sender_set CP_SigSlot::CP_SlotObject::fSenders [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:51 2005 for CPLAT_MacOS by  doxygen 1.4.0