Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreGrid.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_GRID__
8 #define __HDI_CORE_GRID__
9 
10 #include "hdicoreTypes.h"
11 #include "hdicoreColor.h"
12 
13 namespace hdi
14 {
15  namespace core
16  {
20  class Grid
21  {
22  public:
26  enum Style
27  {
28  UnknownStyle = 0,
29  GraphStyle = 10,
30  DottedStyle = 20
31  };
32 
36  class Spacing
37  {
38  public:
42  double spacing;
43 
47  int32_t ticks;
48 
54  Spacing();
55 
61  virtual ~Spacing();
62  };
63 
64  typedef std::auto_ptr<Spacing> SpacingAP;
65 
71  ~Grid();
72 
78  void show();
79 
85  void hide();
86 
94  bool visible() const;
95 
105  void setVisible(const bool visible_);
106 
114  bool snaps() const;
115 
123  void setSnaps(const bool snaps_);
124 
132  bool behindArt() const;
133 
141  void setBehindArt(const bool behind_);
142 
150  Style style() const;
151 
159  void setStyle(const Style style_);
160 
168  Spacing spacing() const;
169 
177  void setSpacing(const Spacing& spacing_);
178 
187  void setSpacing(const double spacing_, const int32_t ticks_);
188 
196  Color darkColor() const;
197 
205  void setDarkColor(const Color& color_);
206 
214  Color lightColor() const;
215 
223  void setLightColor(const Color& color_);
224 
225 
226  private:
227  // Only CurrentDocument can construct a Grid object
228  friend class CurrentDocument;
229 
235  Grid();
236  };
237  }
238 }
239 
240 #endif
241 // __HDI_CORE_GRID__
bool behindArt() const
Gets whether the grid draws behind art.
void setSnaps(const bool snaps_)
Sets whether the gridlines can be snapped to.
Color darkColor() const
Gets the current "dark" color (for major gridlines)
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:24
void setVisible(const bool visible_)
Sets whether the grid is visible.
~Grid()
Destructs a Grid object.
Describes the spacing and density of gridlines.
Definition: hdicoreGrid.h:36
void show()
Shows the grid.
Style
Indicates how the grid is drawn.
Definition: hdicoreGrid.h:26
virtual ~Spacing()
Destructs a Spacing object.
Style style() const
Gets the gridline style, either kAIGridStyleGraph and kAIGridStyleDotted.
Header file for describing Illustrator UI colors.
Color lightColor() const
Gets the current "light" color (for minor gridlines, also called "ticks")
bool snaps() const
Gets whether the gridlines can be snapped to.
void setSpacing(const Spacing &spacing_)
Sets the spacing of the gridlines from an AIGridSpacing struct.
int32_t ticks
Number of minor gridlines between the major gridlines.
Definition: hdicoreGrid.h:47
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Current (focused) document class to allow for metadata access, updating, dictionary access...
Definition: hdicoreCurrentDocument.h:50
void hide()
Hides the grid.
Definition: hdicoreaiArray.h:12
bool visible() const
Gets whether the grid is visible or not.
void setStyle(const Style style_)
Sets the gridline style, either kAIGridStyleGraph and kAIGridStyleDotted.
Spacing()
Constructs a new Spacing object with default values.
void setBehindArt(const bool behind_)
Sets whether the grid draws behind art.
double spacing
Space between major gridlines, in points.
Definition: hdicoreGrid.h:42
Spacing spacing() const
Gets the spacing of the gridlines.
void setDarkColor(const Color &color_)
Sets the current "dark" color (for major gridlines)
void setLightColor(const Color &color_)
Sets the current "light" color (for minor gridlines, also called "ticks")
Allows manipulation of Illustrator's built-in grids.
Definition: hdicoreGrid.h:20