AcrobatPluginInfo Class Reference

This class is the base class for Acrobat plugins. It is a singelton class. More...

#include <AcrobatPlugin.h>

Inherited by CCInfoPlugin.

Collaboration diagram for AcrobatPluginInfo:
Collaboration graph
[legend]

List of all members.

Classes

struct  NotificationData
 Structure for keeping registered notification information. More...

Public Member Functions

 AcrobatPluginInfo ()
 Initilizes the general variables.
 ~AcrobatPluginInfo ()
 Cleans up.
bool RegisterNotification (NSelector nSel, ASCallback callback, void *pData)
 Call to register a notification callback.
AVWindow RegisterModalDialog (ASWindowRef ref)
 Call when a modal dialog starts.
virtual const char * GetExtensionName ()=0
 Unique name of plugin (for inter-plugin communications and such); must override.
virtual ASBool PluginInit ()
 Called when the plugin is initialized; usually registers commands and other data.
virtual ASBool PluginUnload ()
 Called when the plugin is unloaded.
virtual ASBool ImportReplaceAndRegister ()
 Called after plugin is loaded but before it is initialized; usually registers notifications.

Static Public Member Functions

static AcrobatPluginInfoGetPluginInfo ()
 Returns the single plugin object.
static ASText MakeASText (LPCSTR lpText)
 Converts a text string to the Acrobat's representation of such.
static ASText MakeASText (const std::string &sText)
 Converts a text string to the Acrobat's representation of such.
static std::string LoadStringFromResource (UINT uID, const char *pDefaultValue=NULL)
 Loads a string from the plug-ins string table.
static ASText LoadTextFromResource (UINT uID, const char *pDefaultValue=NULL)
 Loads a string from the plug-ins string table and returns it as the Acrobat's representation of the string.

Protected Attributes

UINT m_uCodePage
 Default codepage for the plugin.
std::list< AcrobatCommand * > m_commands
 List of registered commands.
std::list< NotificationData * > m_notifications
 List of registered notification information.

Static Protected Attributes

static AcrobatPluginInfom_gPluginInfo = NULL
 Pointer to the one and only instance of this class.

Detailed Description

This class is the base class for Acrobat plugins. It is a singelton class.

This class contains the general information and some helper functions, and also manages general resources like commands added to the Acrobat menus and toolbars, registered notifications, and the modal windows owned by the plugin, and cleans them up when the plugin is unloaded

Definition at line 46 of file AcrobatPlugin.h.


Member Function Documentation

virtual const char* AcrobatPluginInfo::GetExtensionName (  )  [pure virtual]

Unique name of plugin (for inter-plugin communications and such); must override.

Returns:
The unique name of the plugin

Implemented in CCInfoFullPlugin.

static AcrobatPluginInfo* AcrobatPluginInfo::GetPluginInfo (  )  [inline, static]
virtual ASBool AcrobatPluginInfo::ImportReplaceAndRegister (  )  [inline, virtual]

Called after plugin is loaded but before it is initialized; usually registers notifications.

Returns:
true to continue loading, false to stop

Reimplemented in CCInfoPlugin.

Definition at line 120 of file AcrobatPlugin.h.

Referenced by CCInfoPlugin::ImportReplaceAndRegister().

std::string AcrobatPluginInfo::LoadStringFromResource ( UINT  uID,
const char *  pDefaultValue = NULL 
) [static]

Loads a string from the plug-ins string table.

Parameters:
uID Resource ID of the string
pDefaultValue String to return if the resources tring not found; can be NULL
Returns:
The string from the resources, if found; pDefaultValue if not found, or empty string if not found and no default

Definition at line 146 of file AcrobatPlugin.cpp.

References gHINSTANCE.

Referenced by CCInfoFullPlugin::CCInfoFullPlugin(), CCInfoPlugin::GetLicenseText(), LoadTextFromResource(), FullLicenseDialog::OnBtnClicked(), ADMWizSummeryPage::OnInitDialog(), CCInfoFullPlugin::RetrieveCCInfo(), ShowAboutBox::ShowAboutBox(), ShowLicenseCommand::ShowLicenseCommand(), and ADMWizLicenseTypePage::UpdateControls().

static ASText AcrobatPluginInfo::LoadTextFromResource ( UINT  uID,
const char *  pDefaultValue = NULL 
) [inline, static]

Loads a string from the plug-ins string table and returns it as the Acrobat's representation of the string.

Parameters:
uID Resource ID of the string
pDefaultValue String to return if the resources tring not found; can be NULL
Returns:
The string from the resources, if found; pDefaultValue if not found, or empty string if not found and no default

Definition at line 141 of file AcrobatPlugin.h.

References LoadStringFromResource(), and MakeASText().

Referenced by ShowLicenseButton::GetTooltip().

ASText AcrobatPluginInfo::MakeASText ( const std::string &  sText  )  [static]

Converts a text string to the Acrobat's representation of such.

Parameters:
sText String to make an ASText from
Returns:
The ASText created from the string

Definition at line 105 of file AcrobatPlugin.cpp.

References m_gPluginInfo, and m_uCodePage.

ASText AcrobatPluginInfo::MakeASText ( LPCSTR  lpText  )  [static]

Converts a text string to the Acrobat's representation of such.

Parameters:
lpText Pointer to string to make an ASText from
Returns:
The ASText created from the string

Definition at line 119 of file AcrobatPlugin.cpp.

References m_gPluginInfo, and m_uCodePage.

Referenced by ShowLicenseButton::GetTooltip(), LoadTextFromResource(), and CCInfoFullPlugin::UpdateLicense().

virtual ASBool AcrobatPluginInfo::PluginInit (  )  [inline, virtual]

Called when the plugin is initialized; usually registers commands and other data.

Returns:
true if initialized successfully; false to stop loading the plugin

Reimplemented in CCInfoFullPlugin, and CCInfoPlugin.

Definition at line 108 of file AcrobatPlugin.h.

Referenced by CCInfoPlugin::PluginInit().

virtual ASBool AcrobatPluginInfo::PluginUnload (  )  [inline, virtual]

Called when the plugin is unloaded.

Returns:
true to continue to unload, false if something failed

Note that this function deletes the plugin object

Definition at line 115 of file AcrobatPlugin.h.

AVWindow AcrobatPluginInfo::RegisterModalDialog ( ASWindowRef  ref  ) 

Call when a modal dialog starts.

Parameters:
ref Pointer to the platform information object of the new dialog
Returns:
Acrobat representation of the new modal dialog

Definition at line 136 of file AcrobatPlugin.cpp.

Referenced by ADMBaseDialog::OnInitDialog().

bool AcrobatPluginInfo::RegisterNotification ( NSelector  nSel,
ASCallback  callback,
void *  pData 
)

Call to register a notification callback.

Parameters:
nSel Notification ID
callback Callback function
pData Client Data
Returns:
true if registered successfully, false if failed (if callback is empty)

Definition at line 89 of file AcrobatPlugin.cpp.

References m_notifications.

Referenced by CCInfoPlugin::ImportReplaceAndRegister().


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