AcrobatCommand Class Reference

Wrapper class for acrobat plug-in's command (both menu item and toolbar button). More...

#include <AcrobatCommand.h>

Inherited by ShowAboutBox, ShowLicenseButton, and ShowLicenseCommand.

List of all members.

Public Member Functions

 AcrobatCommand ()
 Default constructor.
 AcrobatCommand (const char *pCommandName, const char *pCommandIdent, const char *pParentMenu, bool bHasEnabled=false, bool bHasMarked=false, AVIcon icon=NULL)
 Menu item command constructor.
 AcrobatCommand (const char *pIdent, const char *pParentToolbar, AVIcon icon, AVToolButton btnOther, bool bHasEnabled=false, bool bHasMarked=false, bool bHasTooltip=false)
 Toolbar button command constructor.
 ~AcrobatCommand ()
 Cleans up the command (including removal from the Acrobat user interface).
virtual void OnCommand ()=0
 Must override to perform the command.
virtual bool IsEnabled ()
 Called to check if the command menu item/toolbar button should be enabled.
virtual bool IsMarked ()
 Called to check if a check mark is to be displayed next to the menu item.
virtual ASText GetTooltip (ASBool bEnabled)
 Called to retrieve a tooltip for the command.

Protected Member Functions

bool InitializeMenuItem (const char *pCommandName, const char *pCommandIdent, const char *pParentMenu, bool bHasEnabled=false, bool bHasMarked=false, AVIcon icon=NULL)
bool InitializeToolbarButton (const char *pIdent, const char *pParentToolbar, AVIcon icon, AVToolButton btnOther, bool bHasEnabled=false, bool bHasMarked=false, bool bHasTooltip=false)

Static Protected Member Functions

static void OnCommandCallback (void *pData)
 Called by Acrobat when the command menu item is selected/when the toolbar button is clicked.
static ASBool IsEnabledCallback (void *pData)
 Called by Acrobat to check if the command menu item/toolbar button is to be enabled.
static ASBool IsMarkedCallback (void *pData)
 Called by Acrobat to check if the menu item should display a check mark.
static ASText GetTooltipCallback (void *pData, ASBool bEnabled)
 Called by Acrobat when a tooltip is needed for a toolbar button.

Protected Attributes

AVMenuItem m_item
 The menu item of the command; will only be valid if this is a menu item command.
AVToolButton m_button
 The toolbar button of the command; will only be valid if this is a toolbar button command.

Detailed Description

Wrapper class for acrobat plug-in's command (both menu item and toolbar button).

Definition at line 36 of file AcrobatCommand.h.


Constructor & Destructor Documentation

AcrobatCommand::AcrobatCommand ( const char *  pCommandName,
const char *  pCommandIdent,
const char *  pParentMenu,
bool  bHasEnabled = false,
bool  bHasMarked = false,
AVIcon  icon = NULL 
)

Menu item command constructor.

Parameters:
pCommandName Name of command menu item to display
pCommandIdent Identifier of command; must be unique
pParentMenu Name of parent menu
bHasEnabled true to use the IsEnabled callback
bHasMarked true to use the IsMarked callback
icon Image to display next to the menu item

Definition at line 36 of file AcrobatCommand.cpp.

References InitializeMenuItem().

AcrobatCommand::AcrobatCommand ( const char *  pIdent,
const char *  pParentToolbar,
AVIcon  icon,
AVToolButton  btnOther,
bool  bHasEnabled = false,
bool  bHasMarked = false,
bool  bHasTooltip = false 
)

Toolbar button command constructor.

Parameters:
pIdent Identifier of command; must be unique
pParentToolbar Name of toolbar to put the button at
icon Image for the button
btnOther Button to put the command button after
bHasEnabled true to use the IsEnabled callback
bHasMarked true to use the IsMarked callback
bHasTooltip true to use the GetTooltip callback

Definition at line 50 of file AcrobatCommand.cpp.

References InitializeToolbarButton().


Member Function Documentation

virtual ASText AcrobatCommand::GetTooltip ( ASBool  bEnabled  )  [inline, virtual]

Called to retrieve a tooltip for the command.

Parameters:
bEnabled true if the command button is enabled, false if it is disabled
Returns:
The text of the tooltip (no tooltip by default)

Override to provide a tooltip for the button

Reimplemented in ShowLicenseButton.

Definition at line 85 of file AcrobatCommand.h.

static ASText AcrobatCommand::GetTooltipCallback ( void *  pData,
ASBool  bEnabled 
) [inline, static, protected]

Called by Acrobat when a tooltip is needed for a toolbar button.

Parameters:
pData User defined data (pointer to the command object)
bEnabled true if the button is currently enabled, false otherwise
Returns:
Text to display as a tooltip (NULL not to have a tooltip)

Calls the command object's GetTooltip() function

Definition at line 125 of file AcrobatCommand.h.

Referenced by InitializeToolbarButton().

bool AcrobatCommand::InitializeMenuItem ( const char *  pCommandName,
const char *  pCommandIdent,
const char *  pParentMenu,
bool  bHasEnabled = false,
bool  bHasMarked = false,
AVIcon  icon = NULL 
) [protected]
Parameters:
pCommandName Name of command menu item to display
pCommandIdent Identifier of command; must be unique
pParentMenu Name of parent menu
bHasEnabled true to use the IsEnabled callback
bHasMarked true to use the IsMarked callback
icon Image to display next to the menu item
Returns:
true if menu item added successfully, false if failed

Definition at line 64 of file AcrobatCommand.cpp.

References IsEnabledCallback(), IsMarkedCallback(), m_button, m_item, and OnCommandCallback().

Referenced by AcrobatCommand(), ShowAboutBox::ShowAboutBox(), and ShowLicenseCommand::ShowLicenseCommand().

bool AcrobatCommand::InitializeToolbarButton ( const char *  pIdent,
const char *  pParentToolbar,
AVIcon  icon,
AVToolButton  btnOther,
bool  bHasEnabled = false,
bool  bHasMarked = false,
bool  bHasTooltip = false 
) [protected]
Parameters:
pIdent Identifier of command; must be unique
pParentToolbar Name of toolbar to put the button at
icon Image for the button
btnOther Button to put the command button after
bHasEnabled true to use the IsEnabled callback
bHasMarked true to use the IsMarked callback
bHasTooltip true to use the GetTooltip callback
Returns:
true if toolbar button added successfully, false if failed

Definition at line 113 of file AcrobatCommand.cpp.

References GetTooltipCallback(), IsEnabledCallback(), IsMarkedCallback(), m_button, m_item, and OnCommandCallback().

Referenced by AcrobatCommand().

virtual bool AcrobatCommand::IsEnabled (  )  [inline, virtual]

Called to check if the command menu item/toolbar button should be enabled.

Returns:
true to enable the command (default), false to disable

Override to set the enabled status.

Reimplemented in ShowLicenseCommand, and ShowLicenseButton.

Definition at line 70 of file AcrobatCommand.h.

static ASBool AcrobatCommand::IsEnabledCallback ( void *  pData  )  [inline, static, protected]

Called by Acrobat to check if the command menu item/toolbar button is to be enabled.

Parameters:
pData User defined data (pointer to the command object)
Returns:
true to enable the button, false to disable it

Calls the command object's IsEnabled() function

Definition at line 108 of file AcrobatCommand.h.

Referenced by InitializeMenuItem(), and InitializeToolbarButton().

virtual bool AcrobatCommand::IsMarked (  )  [inline, virtual]

Called to check if a check mark is to be displayed next to the menu item.

Returns:
true to display the check mark, false not to (default)

Override to set the marked status.

Reimplemented in ShowLicenseCommand.

Definition at line 77 of file AcrobatCommand.h.

static ASBool AcrobatCommand::IsMarkedCallback ( void *  pData  )  [inline, static, protected]

Called by Acrobat to check if the menu item should display a check mark.

Parameters:
pData User defined data (pointer to the command object)
Returns:
true to display a check mark, false not to (the default)

Calls the command object's IsMarked() function

Definition at line 116 of file AcrobatCommand.h.

Referenced by InitializeMenuItem(), and InitializeToolbarButton().

static void AcrobatCommand::OnCommandCallback ( void *  pData  )  [inline, static, protected]

Called by Acrobat when the command menu item is selected/when the toolbar button is clicked.

Parameters:
pData User defined data (pointer to the command object)

Calls the command object's OnCommand() function

Definition at line 100 of file AcrobatCommand.h.

Referenced by InitializeMenuItem(), and InitializeToolbarButton().


The documentation for this class was generated from the following files:

Generated on Thu Dec 17 17:37:08 2009 for CCInfo PDF Plugin by doxygen 1.6.1