7#ifndef __HDI_CORE_DISPATCHER__
8#define __HDI_CORE_DISPATCHER__
23 #if defined(HDI_CORE_AIP_MODE)
36 #if defined(HDI_CORE_AIP_MODE)
37 typedef std::vector< std::shared_ptr<Notifier> > NotifierVector;
46 UnhandledMessageError = 10,
47 UnknownMessageTypeError = 20,
48 RedundantMessageReceivedError = 30
71 ForwardDeleteKey= 230,
116 NumPadDecimalKey = 1000,
117 NumPadPlusKey = 1010,
118 NumPadMinusKey = 1020,
119 NumPadMultiplyKey = 1030,
120 NumPadDivideKey = 1040,
163 LD_BackslashKey = 2380,
167 LD_SemicolonKey = 2410,
172 LD_LeftBracketKey = 2440,
173 LD_RightBracketKey = 2450,
226 const std::string& caller_,
227 const std::string& selector_,
244 #if defined(HDI_CORE_PSP_MODE)
265 const CallerType caller_,
266 const int16_t selector_,
291 Callback*
const coreEventPreCallback()
const;
302 void registerCoreEventPreCallback(
const Callback& callback_);
311 Callback*
const coreEventPostCallback()
const;
322 void registerCoreEventPostCallback(
const Callback& callback_);
335 PrefData*
const coreEventMessage()
const;
348 void setCoreEventResponse(
const PrefData& response_);
389 Error message(
const std::string& caller_,
const std::string& selector_,
void*
const msg_);
391 #if defined(HDI_CORE_PSP_MODE)
409 Error message(
const CallerType caller_,
const int16_t selector_,
void*
const msg_);
422 int16_t*
const resultCode();
475 #if defined(HDI_CORE_AIP_MODE)
596 std::unique_ptr<Callback>& cb__
612 std::unique_ptr<Callback>& cb__
Deals with annotator registration and drawing callbacks.
Definition: hdicoreAnnotator.h:29
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
Message *const lastMessage()
Gets a Message object that wraps around the last message data received.
bool unregisterAnnotator(const Annotator &annotator_)
Unregisters a given annotator.
void scheduleCallback(const Callback &callback_, const double delay_=0.0)
Executes a given callback after a delay.
void removeKeyUpMonitor(const uint32_t id_)
Removes a key-up monitor previously created with addKeyUpMonitor()
VirtualKey
Describes which keys can be monitored for presses at anytime.
Definition: hdicoreDispatcher.h:55
NotifierVector registeredNotifiersOfType(const NotifierType type_)
Gets registered notifiers by their type.
bool unregisterTimer(const Timer &timer_)
Unregisters a given timer.
bool getKeyUpMonitor(const VirtualKey key_, uint32_t &id__, std::unique_ptr< Callback > &cb__) const
Gets an existing key-up monitor, if any.
Error message(const MessageType type_, void *const msg_)
Notifies the dispatcher of an incoming message, causing it to call the appropriate callback or return...
uint32_t addKeyUpMonitor(const VirtualKey key_, const Callback &cb_)
Creates an app-wide key-up monitor that executes a callback when a specific key has been released.
void unregisterMessageCallback(const std::string &caller_, const std::string &selector_)
Unregisters a callback for a given caller/selector pair.
void unregisterMessageCallback(const MessageType type_)
Unregisters a callback for a given message type.
bool registerMessageCallback(const std::string &caller_, const std::string &selector_, const Callback &callback_)
Registers a new callback for a given caller/selector pair.
bool registerMessageCallback(const MessageType type_, const Callback &callback_)
Registers a new callback for a given message type.
Error message(const std::string &caller_, const std::string &selector_, void *const msg_)
Notifies the dispatcher of an incoming (custom) message, causing it to call the appropriate callback ...
void removeKeyDownMonitor(const uint32_t id_)
Removes a key-down monitor previously created with addKeyDownMonitor()
bool unregisterNotifier(const Notifier ¬ifier_)
Unregisters a given notifier.
uint32_t addKeyDownMonitor(const VirtualKey key_, const Callback &cb_)
Creates an app-wide key-down monitor that executes a callback when a specific key has been pressed.
void registerNotifier(const Notifier ¬ifier_)
Registers a Notifier object for a given Illustrator notifier subscription.
Error
Describes a variety of dispatch-related errors.
Definition: hdicoreDispatcher.h:44
bool isKeyDown(const VirtualKey key_, bool &down__)
Gets whether the given key is down.
bool getKeyDownMonitor(const VirtualKey key_, uint32_t &id__, std::unique_ptr< Callback > &cb__) const
Gets an existing key-down monitor, if any.
ToolMessage *const lastToolMessage()
Gets the last tool message received, regardless of whether subsequent non-tool messages have been rec...
void registerAnnotator(const Annotator &annotator_)
Registers an Annotator object.
void registerTimer(const Timer &timer_)
Registers a Timer object.
Base class for all *Message subclasses.
Definition: hdicoreMessage.h:48
Acts as a receiver for specific notifications, passing them along to caller-supplied callbacks.
Definition: hdicoreNotifier.h:24
Base plugin class; the heart of any plugin project.
Definition: hdicorePlugin.h:35
Base class for persistent data objects, stored via JSON.
Definition: hdicorePrefData.h:25
Deals with timer registration and callbacks.
Definition: hdicoreTimer.h:32
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
NotifierType
Describes the types of Illustrator notifiers for which subscriptions are available.
Definition: hdicoreTypes.h:1264
MessageType
Describes the types of plugin messages for which subscriptions are available.
Definition: hdicoreTypes.h:1080