CommandFactory

Used to manage commands in GroupWise. A command occurs in multiple locations, including the menu and toolbar. This object has no properties.

Properties

None.

Methods

BuildCommand( Context: string; 
PersistentID: string;  
BaseCommand: variant; 
parms: variant): variant;
  • This method is invoked to create a Command object. The C3PO cannot assume that Command::WantCommand has been called before this method is invoked.
  • In
  • Context: string is the context for the command. The context string contains either the class of a GW data object (for example, GW.MESSAGE.MAIL.X) or the class of the specific user interface (for example, GW.APPLICATION.BROWSER).
  • PersistentID: string can be either a "pre-defined" ID or is an ID provided in a previous session of GroupWise.
  • BaseCommand: variant is the command being overridden.
  • parms: variant is the parameter list of the command.
  • Out
  • GWCommand: variant is the command object of the command being overridden. Each time the BuildCommand is invoked, the C3PO should return a new instance of a GWCommand object. This is neccessary because BuildCommand can be called recursively
CustomizeContextMenu( Context: String; 
GWMenu: Variant );
  • Method to customize a Context Menu.
  • In
  • Context: string is the class of the object owning the menu. For example, ObjClass would contain "GW.MESSAGE.MAIL" for the mail messages.
  • GWMenu: variant is the context menu to be modified.
  • Out
  • None.
CustomizeMenu( Context: string; 
GWMenu: variant ): TOleBool;
  • Method to customize the menu.
  • In
  • Context: string is the class of the containing window. For example "GW.APPLICATION.BROWSER"
  • GWMenu: variant is the main menu object being modified.
  • Out
  • TOleBool. The return value indicates whether the modifications to the menu were "volatile." If the return value is TRUE, CustomizeMenu( ) will continue to be called each time the menu may need to be updated, such as at each popup creation). Otherwise, C3POServers can safely assume that CustomizeMenu is called only once for any single instance of a menu. This simplifies the resulting code because there is no need to check for commands that might already be on the menu. That is, the C3PO commands are guaranteed to be absent from the menu at the time of the first CustomizeMenu call.
CustomizeToolBar( Context: string; 
GWToolbar: variant ): TOleBool;
  • Method to customize the toolbar. The C3PO must assume that its commands are absent from the toolbar. For example, when a toolbar has been saved and restored in another session of GroupWise, the commands can be put back onto the toolbar without any intervening calls to CustomizeToolbar. For that reason, the C3PO should query the toolbar first before adding anything to the toolbar window.
  • In
  • Context: string contains the class of the containing window.
  • GWToolbar: variant contains the GWToolbar object to be modified.
  • Out
  • TOleBool. Returning TRUE from this method indicates that the toolbar modifications were "volatile." In that case, each time the toolbar is validated in the UI, the CommandFactory::CustomizeToolbar method will be called.
Init( lcid: longint ): longint;
  • This method is the first method of Command::Factory called. It is used to tell GroupWise what UI items will be modified.
  • In
  • lcid: longint. This is the local ID of the application driving the C3PO.
  • Out
  • The C3POServer returns any combination of the following bits:

eGW_CMDINIT_MENUS

The C3PO intends to modify the menus (CustomizeMenu Interface).

eGW_CMDINIT_TOOLBARS

The C3PO intends to modify the toolbar (CustomizeMenu Interface).

eGW_CMDINIT_CONTEXT_MENUS

The C3PO intends to modify the context menus (CustomizeMenu Interface)

eGW_CMDINIT_NO_PREDEFINED

Optimization flag that indicates the C3PO will never respond to predefined commands. Returning this flag will suppress calls to the WantCommand method for predefined commands.

WantCommand( Context: string; PersistentID: string ): TOleBool;
  • This method is used to query the C3PO for its intention to support a predefined command.
  • In
  • Context: string is the actual object class associates with the command.
  • PersistentID: string can be either a pre-defined ID or an ID provided in a previous session of GroupWise.
  • Out
  • TRUE. I do want to support this predefined command.
  • FALSE.. I do not want to support this predefined command.

Remarks

None.