Wrapper class for acrobat plug-in's command (both menu item and toolbar button). More...
#include <AcrobatCommand.h>
Inherited by ShowAboutBox, ShowLicenseButton, and ShowLicenseCommand.
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. | |
Wrapper class for acrobat plug-in's command (both menu item and toolbar button).
Definition at line 36 of file AcrobatCommand.h.
| AcrobatCommand::AcrobatCommand | ( | const char * | pCommandName, | |
| const char * | pCommandIdent, | |||
| const char * | pParentMenu, | |||
| bool | bHasEnabled = false, |
|||
| bool | bHasMarked = false, |
|||
| AVIcon | icon = NULL | |||
| ) |
Menu item command constructor.
| 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.
| 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().
| virtual ASText AcrobatCommand::GetTooltip | ( | ASBool | bEnabled | ) | [inline, virtual] |
Called to retrieve a tooltip for the command.
| bEnabled | true if the command button is enabled, false if it is disabled |
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.
| pData | User defined data (pointer to the command object) | |
| bEnabled | true if the button is currently enabled, false otherwise |
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] |
| 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 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] |
| 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 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.
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.
| pData | User defined data (pointer to the command object) |
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.
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.
| pData | User defined data (pointer to the command object) |
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.
| 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().
1.6.1