Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreAnnotate.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_ANNOTATE__
8 #define __HDI_CORE_ANNOTATE__
9 
10 #include <vector>
11 
12 #include "hdicoreColor.h"
13 #include "hdicoreRect.h"
14 #include "hdicoreSegPoint.h"
15 #include "hdicoreTypes.h"
16 
17 namespace hdi
18 {
19  namespace core
20  {
21  class Font;
22  class SegPoint;
23 
28  namespace annotate
29  {
30  typedef std::vector<Point> PointVector;
31  typedef std::vector<SegPoint> SegPointVector;
32 
36  enum FontType
37  {
38  DefaultFont, // Mac: Lucida Grande Regular, 13pt; Win: Tahoma Regular, 12pt
39 
40  DialogFont, // Mac: Lucida Grande Regular, 13pt; Win: Tahoma Regular, 12pt
41  BoldDialogFont, // Mac: Lucida Grande Bold, 13pt; Win: Tahoma Bold, 12pt
42  ItalicDialogFont, // Mac: Verdana Italic, 12.5pt; Win: Verdana Italic, 11.5pt
43  BoldItalicDialogFont, // Mac: Verdana Bold Italic, 12.5pt; Win: Verdana Bold Italic, 11.5pt
44 
45  PanelFont, // Mac: Lucida Grande Regular, 9pt; Win: Tahoma Regular, 10.5pt
46  BoldPanelFont, // Mac: Lucida Grande Bold, 9pt; Win: Tahoma Bold, 10.5pt
47  ItalicPanelFont, // Mac: Verdana Italic, 8.5pt; Win: Verdana Italic, 9.5pt
48  BoldItalicPanelFont // Mac: Verdana Bold Italic, 8.5pt; Win: Verdana Bold Italic, 9.5pt
49  };
50 
60  bool line(const Point& start_, const Point& end_);
61 
73  bool dashedLine(const Point& start_, const Point& end_, const double dash_, const double gap_);
74 
84  bool rect(const Rect& rect_, const bool fill_ = false);
85 
95  bool ellipse(const Rect& bounds_, const bool fill_ = false);
96 
106  bool polygon(const PointVector& points_, const bool fill_ = false);
107 
117  bool bezier(const SegPointVector& segPts_, const bool fill_ = false);
118 
130  bool image(const int16_t imgID_, const Point& pt_);
131 
143  bool text(const std::string& text_, const Point& pt_, const bool hasCJK_ = false);
144 
159  bool text(
160  const std::string& text_,
161  const Point& pt_,
162  const ParagraphJustification just_,
163  const bool hasCJK_ = false
164  );
165 
173  Color color();
174 
182  void setColor(const Color& color_);
183 
191  double lineWidth();
192 
200  void setLineWidth(const double width_);
201 
209  void setFont(const Font& font_);
210 
218  void setFontSize(const double size_);
219 
227  std::auto_ptr<Font> font();
228 
236  double fontSize();
237 
245  void setFontType(const FontType font_);
246 
256  Rect textBounds(const std::string& text_, const bool hasCJK_ = false);
257 
268  Rect textBounds(const std::string& text_, const Point& pt_, const bool hasCJK_ = false);
269 
275  void invalidateAll();
276  }
277  }
278 }
279 
280 #endif
281 // __HDI_CORE_ANNOTATE__
bool line(const Point &start_, const Point &end_)
Draws a line with the given end points.
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
void setLineWidth(const double width_)
Sets the line width used when drawing paths or unfilled objects.
void invalidateAll()
Loops through all views of the current document and invalidates their annotations.
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:24
Color color()
Gets the current annotation color.
bool bezier(const SegPointVector &segPts_, const bool fill_=false)
Draws a bezier from the given segment points.
bool dashedLine(const Point &start_, const Point &end_, const double dash_, const double gap_)
Draws a dashed line with the given end points and dash specs.
Header file for describing rectangles.
double lineWidth()
Gets the line width used when drawing paths or unfilled objects.
double fontSize()
Gets the current font size for annotation text art.
void setFontType(const FontType font_)
Sets the current font for annotation text art.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
Header file for Illustrator path segment point manipulation.
Header file for describing Illustrator UI colors.
void setFontSize(const double size_)
Sets the current font size for annotation text art.
bool polygon(const PointVector &points_, const bool fill_=false)
Draws a polygon constructed of the given points.
void setColor(const Color &color_)
Sets the current annotation color.
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
std::auto_ptr< Font > font()
Gets the current font for annotation text art.
bool rect(const Rect &rect_, const bool fill_=false)
Draws a rectangle with the given coordinates and fill.
Rect textBounds(const std::string &text_, const bool hasCJK_=false)
Gets the bounds for the given text at the origin.
Definition: hdicoreaiArray.h:12
bool ellipse(const Rect &bounds_, const bool fill_=false)
Draws an ellipse within the given rectangular bounds.
void setFont(const Font &font_)
Sets the current font for annotation text art.
bool text(const std::string &text_, const Point &pt_, const bool hasCJK_=false)
Draws text with the current font and left justification.
bool image(const int16_t imgID_, const Point &pt_)
Draws an image at the given point.
FontType
Describes the type of font to use when annotating text; see also setFontType()
Definition: hdicoreAnnotate.h:36