mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
fix api for JS usage; remove nsIStateUpdatingControllerCommands in favor of CommandParams (bug 157097, r=cmanske, sr=sfraser)
This commit is contained in:
parent
1d4d545c1a
commit
51a0bc675a
@ -48,7 +48,7 @@ interface nsIControllerCommand : nsISupports
|
||||
*/
|
||||
boolean isCommandEnabled(in string aCommandName, in nsISupports aCommandRefCon);
|
||||
|
||||
void getCommandState(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandRefCon);
|
||||
void getCommandStateParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandRefCon);
|
||||
|
||||
/**
|
||||
* Execute the name command.
|
||||
@ -65,39 +65,3 @@ interface nsIControllerCommand : nsISupports
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* nsIStatefulControllerCommand
|
||||
*
|
||||
* An extension of the basic nsIControllerCommand interface, for commands
|
||||
* that have to update state (e.g. "bold" in an editor). Note that the
|
||||
* implementation of the command *must* be stateless (since a given command
|
||||
* can be shared between clients of the controller command manager). State
|
||||
* must be stored/update via the refCon.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(78ad2381-1ae6-11d4-9f7e-a6d3f6dffffc)]
|
||||
interface nsIStateUpdatingControllerCommand : nsISupports
|
||||
{
|
||||
|
||||
/**
|
||||
* Update the state of the named command.
|
||||
*
|
||||
* @param aCommandName the name of the command for which we want to update state.
|
||||
*
|
||||
* @param aCommandRefCon a cookie held by the nsIControllerCommandManager,
|
||||
* allowing the command to get some context information.
|
||||
* The contents of this cookie are implementation-defined.
|
||||
*/
|
||||
void updateCommandState(in string aCommandName, in nsISupports aCommandRefCon);
|
||||
|
||||
/**
|
||||
* Gets the command states based on the input parameters
|
||||
* @param aCommandParams this will pass in the states that need to beupdated. the results will be
|
||||
* placed in the value portion of the command Params
|
||||
*/
|
||||
//void getCommandState(in nsICommandParams aCommandParams, in nsISupports aCommandRefCon);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
@ -142,16 +142,7 @@ nsControllerCommandManager::UpdateCommandState(const char * aCommandName, nsISup
|
||||
return NS_OK; // we don't handle this command
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIStateUpdatingControllerCommand> stateCommand = do_QueryInterface(commandHandler);
|
||||
if (!stateCommand)
|
||||
{
|
||||
#if DEBUG
|
||||
NS_WARNING("Controller command manager asked to update the state of a command that doesn't do state updating -- ");
|
||||
#endif
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
return stateCommand->UpdateCommandState(aCommandName, aCommandRefCon);
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -221,7 +212,7 @@ nsControllerCommandManager::GetCommandState(const char *aCommandName, nsICommand
|
||||
#endif
|
||||
return NS_OK; // we don't handle this command
|
||||
}
|
||||
return commandHandler->GetCommandState(aCommandName, aParams, aCommandRefCon);
|
||||
return commandHandler->GetCommandStateParams(aCommandName, aParams, aCommandRefCon);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user