Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreNotificationHub.h
1 #ifndef __HDI_CORE_NOTIFICATION_HUB__
2 #define __HDI_CORE_NOTIFICATION_HUB__
3 
4 #include "hdicoreTypes.h"
5 #include "hdicoreAnnotate.h"
6 #include "hdicoreColor.h"
7 #include "hdicoreFont.h"
8 #include "hdicorePoint.h"
9 
10 namespace hdi
11 {
12  namespace core
13  {
23  {
24  public:
28  struct Notification
29  {
30  public:
31  typedef Font NFont;
32  #define NFontDefault Font()
33 
38  {
39  UnknownLocType = 0,
40  PinPointLocType = 10,
41  PointLocType = 20
42  };
43 
47  std::string text;
48 
53 
57  NFont font;
58 
62  bool border;
63 
68 
72  double duration;
73 
81  Notification();
82 
90  Notification(const Notification& n_);
91 
106  Notification(
107  const std::string& text_,
108  const BoundsPinPointType pinPt_ = TopRightPinPoint,
109  const Color& textCol_ = Color::black(),
110  const bool border_ = true,
111  const Color& borderCol_ = Color::black(),
112  const NFont font_ = NFontDefault,
113  const double duration_ = 2.0
114  );
115 
130  Notification(
131  const std::string& text_,
132  const Point& point_,
133  const Color& textCol_ = Color::black(),
134  const bool border_ = true,
135  const Color& borderCol_ = Color::black(),
136  const NFont font_ = NFontDefault,
137  const double duration_ = 2.0
138  );
139 
145  virtual ~Notification();
146 
156  Notification& operator=(const Notification& rhs_);
157 
165  LocationType locationType() const;
166 
174  BoundsPinPointType pinPoint() const;
175 
185  void setPinPoint(const BoundsPinPointType pinPt_);
186 
194  Point point() const;
195 
205  void setPoint(const Point& pt_);
206 
207 
208  private:
212  LocationType __locationType;
213 
217  BoundsPinPointType __pinPoint;
218 
222  Point __point;
223  };
224 
225  typedef std::auto_ptr<Notification> NotificationAP;
226 
235  static NotificationHub* instance();
236 
245  bool display(const Notification& n_);
246 
247 
248  private:
249  friend class Plugin;
250 
254  static NotificationHub* __instance;
255 
259  void* __data;
260 
266  NotificationHub(void* const);
267 
274 
280  ~NotificationHub();
281 
287  NotificationHub& operator=(const NotificationHub&);
288 
289 
290  public:
291  static const std::string caller;
292  static const std::string displaySelector;
293 
305  {
310 
316  int16_t version;
317 
323  char* text;
324 
328  double textColorR;
329 
333  double textColorG;
334 
338  double textColorB;
339 
343  double textColorO;
344 
348  char* fontName;
349 
353  bool border;
354 
358  double borderColorR;
359 
363  double borderColorG;
364 
368  double borderColorB;
369 
373  double borderColorO;
374 
378  double duration;
379 
384  bool usePoint;
385 
389  BoundsPinPointType pinPoint;
390 
394  double pointX;
395 
399  double pointY;
400  };
401  };
402  }
403 }
404 
405 #endif
406 // __HDI_CORE_NOTIFICATION_HUB__
double borderColorO
Stores the opacity (alpha) border color channel for the notification.
Definition: hdicoreNotificationHub.h:373
virtual ~Notification()
Destructs a Notification object.
LocationType locationType() const
Gets the location type for the notification.
bool usePoint
Stores whether to use the point or pinPoint member (true is pointX and pointY, false is pinPoint) ...
Definition: hdicoreNotificationHub.h:384
Describes the text, color, location, etc. of a notification.
Definition: hdicoreNotificationHub.h:28
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
Definition: hdicoreTypes.h:1252
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:24
double pointX
Stores the x-axis value for the exact point at which the notification should appear.
Definition: hdicoreNotificationHub.h:394
Point point() const
Gets the point for the notification.
double pointY
Stores the y-axis value for the exact point at which the notification should appear.
Definition: hdicoreNotificationHub.h:399
void setPoint(const Point &pt_)
Sets the point for the notification.
bool border
Stores whether the notification should have a border.
Definition: hdicoreNotificationHub.h:62
static NotificationHub * instance()
Allows access to the singleton notificiation hub instance object.
Base plugin class; the heart of any plugin project.
Definition: hdicorePlugin.h:40
char * fontName
Stores the name of the font that should be used.
Definition: hdicoreNotificationHub.h:348
NFont font
Stores the font for the notification.
Definition: hdicoreNotificationHub.h:57
double textColorO
Stores the opacity (alpha) text color channel for the notification.
Definition: hdicoreNotificationHub.h:343
int16_t version
Stores the version number of the display message (MUST always come after the data member) ...
Definition: hdicoreNotificationHub.h:316
double duration
Stores the duration, in seconds, that the notification should be displayed.
Definition: hdicoreNotificationHub.h:378
Header file for Illustrator font manipulation.
double borderColorR
Stores the red border color channel for the notification.
Definition: hdicoreNotificationHub.h:358
Header file for describing Illustrator UI colors.
BoundsPinPointType pinPoint() const
Gets the pin point for the notification.
double textColorG
Stores the green text color channel for the notification.
Definition: hdicoreNotificationHub.h:333
double textColorB
Stores the blue text color channel for the notification.
Definition: hdicoreNotificationHub.h:338
Structure that can actually be passed to the NotificationHub.aip plugin.
Definition: hdicoreNotificationHub.h:304
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Font class to allow for easy font manipulation.
Definition: hdicoreFont.h:170
SPMessageData data
Stores SuitePea message data (MUST always be the first member)
Definition: hdicoreNotificationHub.h:309
Header file for describing 2D points.
Definition: hdicoreaiArray.h:12
double textColorR
Stores the red text color channel for the notification.
Definition: hdicoreNotificationHub.h:328
bool display(const Notification &n_)
Sends a notification to the NotificationHub.aip plugin to be displayed.
Color borderColor
Stores the border color for the notification.
Definition: hdicoreNotificationHub.h:67
double borderColorB
Stores the blue border color channel for the notification.
Definition: hdicoreNotificationHub.h:368
static Color black()
Static accessor to get a pure black Color object.
LocationType
Describes the type of location that a notification should be displayed.
Definition: hdicoreNotificationHub.h:37
char * text
Stores the text that should be displayed in the notification.
Definition: hdicoreNotificationHub.h:323
BoundsPinPointType pinPoint
Stores the pin point at which the notification should appear.
Definition: hdicoreNotificationHub.h:389
std::string text
Stores the text that should be displayed in the notification, as UTF-8.
Definition: hdicoreNotificationHub.h:47
Notification & operator=(const Notification &rhs_)
Overloaded Notification assignment operator; copies values from one Notification object into another...
void setPinPoint(const BoundsPinPointType pinPt_)
Sets the pin point for the notification.
Allows notifications to be presented to the user in the form of text annotations on the current docum...
Definition: hdicoreNotificationHub.h:22
Notification()
Constructs a Notification object with default values (and an empty text value; be sure to set the tex...
double borderColorG
Stores the green border color channel for the notification.
Definition: hdicoreNotificationHub.h:363
bool border
Stores whether the notification should have a border.
Definition: hdicoreNotificationHub.h:353
double duration
Stores the duration, in seconds, that the notification should be displayed.
Definition: hdicoreNotificationHub.h:72
Color textColor
Stores the text color for the notification.
Definition: hdicoreNotificationHub.h:52
Header file for drawing Illustrator annotations during Annotator object callbacks.