7#ifndef __HDI_CORE_PLUGIN__
8#define __HDI_CORE_PLUGIN__
17#define HDI_CORE_PLUGIN hdi::core::Plugin::instance()
37 typedef std::vector<byte> ByteVector;
39 #if defined(HDI_CORE_AIP_MODE)
46 AutoSelectsResultsOption = 1 << 0,
47 RetainsPartialPathSelectionOption = 1 << 1
55 UnknownUndoContext = 0,
59 StandardUndoContext = 10,
63 SilentUndoContext = 20,
68 AppendUndoContext = 30
129 virtual std::string
name()
const;
138 virtual void setName(
const std::string& name_);
140 #if defined(HDI_CORE_AIP_MODE)
170 #if defined(HDI_CORE_AIP_MODE)
221 virtual bool resourceData(
const int32_t type_,
const int16_t id_, ByteVector& data__)
const;
237 const std::string& name_,
241 #if defined(HDI_CORE_AIP_MODE)
366 #if defined(HDI_CORE_AIP_MODE)
467 #if defined(HDI_CORE_AIP_MODE)
506 #if defined(HDI_CORE_AIP_MODE)
567 #if defined(HDI_CORE_AIP_MODE)
1004 #if defined(HDI_CORE_PSP_MODE)
1013 virtual Callback*
const aboutBoxShowingCallback()
const;
1023 virtual void setAboutBoxShowingCallback(
const Callback& cb_);
1057 #if defined(HDI_CORE_AIP_MODE)
1124 #if defined(HDI_CORE_AIP_MODE)
1126 #elif defined(HDI_CORE_PSP_MODE)
1127 #if defined(MAC_ENV)
1128 friend void (::hdicoreDylibUnloading) ();
1131 friend __MainError (::ActionsPluginMain) (
const char*,
const char*,
void*);
1132 friend void (::AcquirePluginMain) (
const int16_t,
void*, intptr_t*, int16_t*);
1133 friend void (::ExportPluginMain) (
const int16_t,
void*, intptr_t*, int16_t*);
1134 friend void (::ExtensionPluginMain) (
const int16_t,
void*, intptr_t*, int16_t*);
1135 friend void (::FilterPluginMain) (
const int16_t,
void*, intptr_t*, int16_t*);
1136 friend void (::FormatPluginMain) (
const int16_t,
void*, intptr_t*, int16_t*);
1137 friend void (::MeasurementPluginMain) (
const int16_t,
void*, intptr_t*, int16_t*);
1138 friend void (::PickerPluginMain) (
const int16_t,
void*, intptr_t*, int16_t*);
1139 friend void (::SelectionPluginMain) (
const int16_t,
void*, intptr_t*, int16_t*);
1147 __NoStartupError = 0,
1148 __CantLockPluginError = 1000,
1149 __CantSetPluginNameError = 1010,
1150 __BadApplicationVersionError = 1020,
1151 __WrongPluginBinaryError = 1030,
1152 __WrongInstallLocationError = 1040,
1153 __CantLoadPrefsError = 1050,
1154 __CantSetupToolsError = 1060,
1155 __CantSetupNotifiersError = 1070,
1156 __CantSetupAnnotatorsError = 1080,
1157 __CantSetupTimersError = 1090,
1158 __CustomStartupErrorOffset = 1000000
1164 enum __PostStartupError
1166 __NoPostStartupError = 0,
1167 __CustomPostStartupErrorOffset = 2000000
1173 enum __PreShutdownError
1175 __NoPreShutdownError = 0,
1176 __CustomPreShutdownErrorOffset = 3000000
1182 enum __ShutdownError
1184 __NoShutdownError = 0,
1185 __CantUnlockPluginError = 4000,
1186 __CustomShutdownErrorOffset = 4000000
1192 static Plugin* __instance;
1211 Plugin(
const Plugin&);
1218 Plugin(
const void*,
const std::string&);
1232 Plugin& operator=(
const Plugin& rhs_);
1239 __StartupError __startup();
1246 __PostStartupError __postStartup();
1248 #if defined(HDI_CORE_AIP_MODE)
1254 __PreShutdownError __preShutdown();
1263 __ShutdownError __shutdown();
1265 #if defined(HDI_CORE_PSP_MODE)
1271 void __aboutBoxShow();
1278#if defined(HDI_CORE_AIP_MODE)
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Class through which all messages ultimately pass; holds registered callbacks for messages,...
Definition: hdicoreDispatcher.h:34
Used to create and display a modal dialog to the user, blocking input to other UI elements.
Definition: hdicoreModalDialog.h:25
Base plugin class; the heart of any plugin project.
Definition: hdicorePlugin.h:35
virtual void setMenuItemSelectedCallback(const Callback &cb_)
Sets the callback that's called when a user selects one of the plugin's menu items.
virtual void setToolPostEditedCallback(const Callback &cb_)
Sets the callback that's called just after a tool is double-clicked in the toolbar (i....
virtual Callback *const toolPostDiameterDecreasedCallback() const
Gets the callback that's called just after the '[' key is hit while a tool is selected (i....
virtual void setToolPreEditedCallback(const Callback &cb_)
Sets the callback that's called just before a tool is double-clicked in the toolbar (i....
virtual std::string fileName() const
Gets the name of the plugin file at runtime.
virtual Callback *const toolPostDraggedCallback() const
Gets the callback that's called just after the mouse button is down and the cursor moves (i....
virtual bool hasPostStartedUp() const
Gets whether the plugin has already completed post-starting up.
virtual void undo() const
Undoes the last set of artwork changes by this specific plugin.
virtual void setPrefsDialog(const ModalDialog &dialog_)
Sets the global prefs modal dialog for the plugin.
virtual Callback *const toolPreMouseDownCallback() const
Gets the callback that's called just before the mouse button goes down (i.e. the tool's mouse down ca...
virtual Callback *const preShutdownCallback() const
Gets the callback that's called just before the plugin will shutdown.
virtual Callback *const postStartupCallback() const
Gets the callback that's called just after the plugin has started up.
virtual void setPreShutdownCallback(const Callback &cb_)
Sets the callback that's called just before the plugin will shutdown.
virtual ModalDialog *const aboutBox() const
Gets the about box modal dialog for the plugin.
virtual void setToolsSnapToArt(const bool snap_)
Sets whether tools belonging to this plugin should snap the cursor to artwork.
virtual void setToolPostMouseUpCallback(const Callback &cb_)
Sets the callback that's called just after the mouse button comes up (i.e. the tool's mouse up callba...
virtual Callback *const toolPostDiameterIncreasedCallback() const
Gets the callback that's called just after the ']' key is hit while a tool is selected (i....
virtual Callback *const toolPreMouseUpCallback() const
Gets the callback that's called just before the mouse button comes up (i.e. the tool's mouse up callb...
virtual Callback *const toolPreDiameterIncreasedCallback() const
Gets the callback that's called just before the ']' key is hit while a tool is selected (i....
virtual void setName(const std::string &name_)
Sets the plugin name.
virtual void setToolPostMouseDownCallback(const Callback &cb_)
Sets the callback that's called just after the mouse button goes down (i.e. the tool's mouse down cal...
virtual Callback *const menuItemsUpdateCallback() const
Gets the callback that's called when a user hovers over menu groups that will show this plugin's menu...
virtual MenuItem *const prefsMenuItem() const
Gets the global prefs menu item for the plugin.
virtual Callback *const toolPostDeselectedCallback() const
Gets the callback that's called just after a tool is deselected (i.e. the tool's deselection callback...
virtual bool hasStartedUp() const
Gets whether the plugin has already completed starting up.
virtual bool resourceData(const int32_t type_, const std::string &name_, ByteVector &data__) const
Acquires a byte vector for a given resource.
virtual void setToolPostTrackedCallback(const Callback &cb_)
Sets the callback that's called just after the cursor moves (with the mouse button released; i....
virtual void setToolPreDraggedCallback(const Callback &cb_)
Sets the callback that's called just before the mouse button is down and the cursor moves (i....
virtual void setToolPreDiameterDecreasedCallback(const Callback &cb_)
Sets the callback that's called just before the '[' key is hit while a tool is selected (i....
virtual void setShutdownCallback(const Callback &cb_)
Sets the callback that's called when the plugin is shutting down.
virtual SPPluginRef spPluginRef() const
Gets the plugin ref around which the target object is wrapped.
virtual Callback *const toolPostMouseDownCallback() const
Gets the callback that's called just after the mouse button goes down (i.e. the tool's mouse down cal...
virtual void setAboutBox(const ModalDialog &dialog_)
Sets the about box modal dialog for the plugin.
virtual bool resourceData(const int32_t type_, const int16_t id_, ByteVector &data__) const
Acquires a byte vector for a given resource.
virtual bool toolsSnapToGrids() const
Gets whether tools belonging to this plugin should snap the cursor to the Illustrator gridlines.
virtual void setUndoRedoNames(const std::string &undo_, const std::string &redo_)
Sets the text for the Undo and Redo menu items, which Illustrator uses as needed.
virtual bool shuttingDown() const
Gets whether the plugin is in the process of shutting down.
virtual bool startingUp() const
Gets whether the plugin is in the process of starting up.
virtual bool toolsSnapToArt() const
Gets whether tools belonging to this plugin should snap the cursor to artwork.
virtual bool hasPreShutdown() const
Gets whether the plugin has already completed pre-shutting down.
virtual Callback *const toolPreSelectedCallback() const
Gets the callback that's called just before a tool is selected from the toolbar (i....
virtual Callback *const menuItemSelectedCallback() const
Gets the callback that's called when a user selects one of the plugin's menu items.
virtual void setToolPostReselectedCallback(const Callback &cb_)
Sets the callback that's called just after a tool is reselected (i.e. the tool's reselection callback...
virtual bool postStartingUp() const
Gets whether the plugin is in the process of post-starting up.
virtual Callback *const startupCallback() const
Gets the callback that's called when the plugin is starting up.
virtual bool setUndoKind(const UndoContext uc_)
Changes the undo context to another type.
virtual Callback *const shutdownCallback() const
Gets the callback that's called when the plugin is shutting down.
virtual void setToolsSnapToArtBounds(const bool snap_)
Sets whether tools belonging to this plugin should snap the cursor to artwork bounds.
virtual void setToolPreDiameterIncreasedCallback(const Callback &cb_)
Sets the callback that's called just before the ']' key is hit while a tool is selected (i....
virtual void setToolsSnapToGrids(const bool snap_)
Sets whether tools belonging to this plugin should snap the cursor to the Illustrator gridlines.
virtual Callback *const toolPostMouseUpCallback() const
Gets the callback that's called just after the mouse button comes up (i.e. the tool's mouse up callba...
virtual bool toolsSnapToArtboard() const
Gets whether tools belonging to this plugin should snap the cursor to the artboard edges.
virtual void setBrightnessAdjustedCallback(const Callback &cb_)
Sets the callback that's called when the brightness of the app UI is changed via the app preference d...
virtual void setToolPreDeselectedCallback(const Callback &cb_)
Sets the callback that's called just before a tool is deselected (i.e. the tool's deselection callbac...
virtual void setToolPostDiameterIncreasedCallback(const Callback &cb_)
Sets the callback that's called just after the ']' key is hit while a tool is selected (i....
virtual void setToolsSnapToArtboard(const bool snap_)
Sets whether tools belonging to this plugin should snap the cursor to the artboard edges.
virtual void setLoggingStream(const std::string &name_, std::ostream *const str_)
Sets the logging stream, by name, for debugging output for the plugin.
PlatformPluginPtr platformPlugin() const
Gets a pointer to the platform object representing the current Plugin instance.
virtual void setMenuItemsUpdateCallback(const Callback &cb_)
Sets the callback that's called when a user hovers over menu groups that will show this plugin's menu...
virtual Callback *const toolPostSelectedCallback() const
Gets the callback that's called just after a tool is selected from the toolbar (i....
virtual Callback *const toolPostTrackedCallback() const
Gets the callback that's called just after the cursor moves (with the mouse button released; i....
virtual Tool *const currentTool() const
Gets a pointer to the currently selected tool.
virtual Callback *const toolPreEditedCallback() const
Gets the callback that's called just before a tool is double-clicked in the toolbar (i....
virtual Dispatcher *const dispatcher() const
Convenience method to return the Dispatcher instance.
virtual Options options() const
Gets the plugin's options.
virtual std::string filePath() const
Gets the full path of the plugin file at runtime.
static Plugin *const instance()
Allows access to the singleton Plugin instance object.
virtual void setToolPreSelectedCallback(const Callback &cb_)
Sets the callback that's called just before a tool is selected from the toolbar (i....
friend __MainError() PluginMain(const char *, const char *, void *)
Main entry point for all plugins (required by Illustrator). This is called whenever a plugin should p...
virtual Callback *const brightnessAdjustedCallback() const
Gets the callback that's called when the brightness of the app UI is changed via the app preference d...
virtual void setToolPostDraggedCallback(const Callback &cb_)
Sets the callback that's called just after the mouse button is down and the cursor moves (i....
virtual MenuItem *const aboutMenuItem() const
Gets the about box menu item for the plugin.
virtual void setToolPostDiameterDecreasedCallback(const Callback &cb_)
Sets the callback that's called just after the '[' key is hit while a tool is selected (i....
Options
Allows for configuration of various plug-in behaviors.
Definition: hdicorePlugin.h:44
virtual void setOptions(const Options options_)
Sets the plugin's options.
virtual void setToolPostDeselectedCallback(const Callback &cb_)
Sets the callback that's called just after a tool is deselected (i.e. the tool's deselection callback...
virtual bool hasShutdown() const
Gets whether the plugin has already completed shutting down.
virtual Callback *const toolPreReselectedCallback() const
Gets the callback that's called just before a tool is reselected (i.e. the tool's reselection callbac...
virtual void setPostStartupCallback(const Callback &cb_)
Sets the callback that's called just after the plugin has started up.
virtual void setToolPreReselectedCallback(const Callback &cb_)
Sets the callback that's called just before a tool is reselected (i.e. the tool's reselection callbac...
UndoContext
Allows for setting of the undo context to other behaviors.
Definition: hdicorePlugin.h:54
virtual Callback *const toolPostEditedCallback() const
Gets the callback that's called just after a tool is double-clicked in the toolbar (i....
virtual Callback *const toolPostReselectedCallback() const
Gets the callback that's called just after a tool is reselected (i.e. the tool's reselection callback...
virtual void setAboutMenuItem(const MenuItem &mi_)
Sets the about box menu item for the plugin.
virtual Callback *const toolPreDeselectedCallback() const
Gets the callback that's called just before a tool is deselected (i.e. the tool's deselection callbac...
virtual std::ostream *const loggingStream(const std::string &name_) const
Gets a logging stream, by name, for debugging output for the plugin.
virtual bool toolsSnapToArtBounds() const
Gets whether tools belonging to this plugin should snap the cursor to artwork bounds.
virtual void setToolPreTrackedCallback(const Callback &cb_)
Sets the callback that's called just before the cursor moves (with the mouse button released; i....
virtual bool preShuttingDown() const
Gets whether the plugin is in the process of pre-shutting down.
virtual Callback *const toolPreTrackedCallback() const
Gets the callback that's called just before the cursor moves (with the mouse button released; i....
virtual void setToolPostSelectedCallback(const Callback &cb_)
Sets the callback that's called just after a tool is selected from the toolbar (i....
virtual void setStartupCallback(const Callback &cb_)
Sets the callback that's called when the plugin is starting up.
virtual std::string name() const
Gets the plugin name.
virtual Callback *const toolPreDiameterDecreasedCallback() const
Gets the callback that's called just before the '[' key is hit while a tool is selected (i....
virtual Callback *const toolPreDraggedCallback() const
Gets the callback that's called just before the mouse button is down and the cursor moves (i....
virtual ModalDialog *const prefsDialog() const
Gets the global prefs modal dialog for the plugin.
virtual void setToolPreMouseDownCallback(const Callback &cb_)
Sets the callback that's called just before the mouse button goes down (i.e. the tool's mouse down ca...
virtual void setPrefsMenuItem(const MenuItem &mi_)
Sets the global prefs menu item for the plugin.
virtual void setToolPreMouseUpCallback(const Callback &cb_)
Sets the callback that's called just before the mouse button comes up (i.e. the tool's mouse up callb...
Header file for various plugin entry points.