InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ICommandChecker Class Referenceabstract

#include <ICommandChecker.h>

Inheritance diagram for ICommandChecker:
IPMUnknownCCommandChecker

Public Types

enum  { kDefaultIID = IID_ICOMMANDCHECKER }
 

Public Member Functions

virtual ErrorCode CheckCommand (bool16 saveError)=0
 
virtual void ClearLastError (bool16 saveError)=0
 
virtual void SaveLastError ()=0
 
virtual ErrorCode GetLastError ()=0
 
virtual void SetError (const ErrorCode &error)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This interface can be added to a command boss class, and used by "clients" of the command such as trackers and panels, as well as within the command. Implementations of ICommandChecker (typically derived from CCommandChecker) can access the command's item list and the current data in the command's data interface in order to validate them. This provides a central place for validation that can be shared by trackers, panel UI and the commands themselves. As long as the command object is around, the error code can be obtained, whether or not the command has been executed. The error code can also be cached (if requested) to avoid repeating expensive checks. To allow finer control, and distinguish between different error conditions, multiple command checkers (with different interface IDs of course) can be added to a command boss.

See Also
CCommandChecker