Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreLayer.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_LAYER__
8 #define __HDI_CORE_LAYER__
9 
10 #include "hdicoreTypes.h"
11 #include "hdicoreColor.h"
12 
13 namespace hdi
14 {
15  namespace plugin
16  {
17  class Layer;
18  }
19 
20  namespace core
21  {
22  class Art;
23 
27  class Layer
28  {
29  public:
49  class Iterator
50  {
51  public:
59  Iterator(const Iterator& iter_);
60 
66  ~Iterator();
67 
77  Iterator& operator=(const Iterator& rhs_);
78 
87  bool operator==(const Iterator& rhs_) const;
88 
97  bool operator!=(const Iterator& rhs_) const;
98 
106  Iterator& operator++();
107 
115  Iterator operator++(int);
116 
124  Iterator& operator--();
125 
133  Iterator operator--(int);
134 
143  bool atEnd() const;
144 
153  std::auto_ptr<Layer> layer() const;
154 
155 
156  private:
157  // Only Layer can construct a new Iterator object
158  friend class Layer;
159 
163  void* __data;
164 
170  Iterator();
171 
180  explicit Iterator(const Layer& layer_);
181  };
182 
183  typedef std::auto_ptr<Iterator> IteratorAP;
184 
196  Layer();
197 
205  Layer(const Layer& layer_);
206 
214  Layer(const AILayerHandle aiLayer_);
215 
226  Layer(const PaintOrder order_, const Layer* const prep_ = NULL);
227 
233  virtual ~Layer();
234 
243  virtual Layer& operator=(const Layer& rhs_);
244 
256  virtual AILayerHandle aiLayerHandle() const;
257 
265  virtual bool isEmpty() const;
266 
277  virtual bool dispose();
278 
288  virtual bool editable() const;
289 
299  virtual void setEditable(const bool editable_);
300 
310  virtual bool locked() const;
311 
321  virtual void setLocked(const bool locked_);
322 
330  virtual std::string name() const;
331 
339  virtual void setName(const std::string& name_);
340 
346  virtual void show();
347 
353  virtual void hide();
354 
362  virtual bool visible() const;
363 
373  virtual void setVisible(const bool visible_);
374 
383  virtual std::auto_ptr<Art> group() const;
384 
392  virtual bool active() const;
393 
401  virtual bool hasArt() const;
402 
410  virtual bool hasSelectedArt() const;
411 
419  virtual void deselectArt() const;
420 
428  virtual Color color() const;
429 
437  virtual void setColor(const Color& color_);
438 
446  virtual std::auto_ptr<Layer> parent() const;
447 
455  virtual std::auto_ptr<Layer> firstChild() const;
456 
464  virtual std::auto_ptr<Layer> sibling() const;
465 
473  virtual std::auto_ptr<Layer> priorSibling() const;
474 
483  virtual std::auto_ptr<Layer> nextPreorderLayer() const;
484 
492  virtual bool preview() const;
493 
501  virtual void setPreview(const bool preview_);
502 
510  virtual bool printed() const;
511 
519  virtual void setPrinted(const bool printed_);
520 
528  virtual bool dimsPlacedImages() const;
529 
537  virtual void setDimsPlacedImages(const bool dim_);
538 
552  virtual bool convertToGroup();
553 
562  virtual bool operator==(const Layer& rhs_) const;
563 
572  virtual bool operator!=(const Layer& rhs_) const;
573 
581  virtual bool valid() const;
582 
608  Iterator begin() const;
609 
610 
611  private:
612  friend class CurrentDocument;
613 
614  friend plugin::Layer* __accessImpl(const Layer&);
615  friend Layer __accessCtor(plugin::Layer*&);
616 
620  void* __data;
621 
627  void* __impl() const;
628 
634  Layer(plugin::Layer*&);
635  };
636 
637  typedef std::auto_ptr<Layer> LayerAP;
638 
639  extern plugin::Layer* __accessImpl(const Layer&);
640  extern Layer __accessCtor(plugin::Layer*&);
641  }
642 }
643 
644 #endif
645 // __HDI_CORE_LAYER__
virtual bool operator==(const Layer &rhs_) const
Tests whether a given Layer object is the same as another.
virtual bool locked() const
Gets whether the target layer is locked.
virtual std::auto_ptr< Layer > nextPreorderLayer() const
Gets the next layer in preorder traversal, which returns descendents first.
virtual void hide()
Hides the layer.
virtual Color color() const
Gets the color of the layer in the layer list.
virtual bool hasSelectedArt() const
Gets whether any of the target layer's art is selected.
Iterator begin() const
Gets an iterator for the layer in the target's parent layer, starting with the target.
Iterator & operator=(const Iterator &rhs_)
Assigns one Iterator object to another.
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:24
virtual std::auto_ptr< Layer > priorSibling() const
Gets the previous sibling layer object for the target layer.
virtual AILayerHandle aiLayerHandle() const
Gets the layer handle around which the target object is wrapped.
virtual bool dispose()
Removes the layer from the document.
Iterator & operator++()
Prefix increment operator for forward iteration.
virtual std::string name() const
Gets the name for the target layer.
virtual bool active() const
Gets whether the target Layer object is the active (current) layer.
virtual std::auto_ptr< Layer > parent() const
Gets the parent layer object for the target layer.
virtual ~Layer()
Layer destructor.
virtual void setPrinted(const bool printed_)
Sets whether the target layer is considered printable when printing the document. ...
Iterator & operator--()
Prefix decrement operator for reverse iteration.
virtual bool printed() const
Gets whether the target layer is considered printable when printing the document. ...
Header file for describing Illustrator UI colors.
virtual void setEditable(const bool editable_)
Sets whether the target layer is editable.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Allows for layer metadata access, visibility manipulation, locking, sibling access, etc.
Definition: hdicoreLayer.h:27
virtual bool preview() const
Gets the target layer's preview or outline mode setting.
bool operator!=(const Iterator &rhs_) const
Tests whether a given Iterator object is not the same as another.
virtual std::auto_ptr< Layer > firstChild() const
Gets the first child layer object for the target layer.
Current (focused) document class to allow for metadata access, updating, dictionary access...
Definition: hdicoreCurrentDocument.h:50
virtual void setDimsPlacedImages(const bool dim_)
Sets whether images in the target layer are automatically dimmed.
virtual bool valid() const
Tests the validity of the target layer by checking its topmost "invisible" group. ...
bool operator==(const Iterator &rhs_) const
Tests whether a given Iterator object is the same as another.
Definition: hdicoreaiArray.h:12
std::auto_ptr< Layer > layer() const
Gets the current layer pointed to by the iterator.
virtual Layer & operator=(const Layer &rhs_)
Assigns one Layer object to another.
bool atEnd() const
Determines whether iteration should stop; works well as the conditional in a for() loop...
virtual bool editable() const
Gets whether the target layer is editable.
virtual void show()
Shows the layer.
virtual void setVisible(const bool visible_)
Sets whether the target layer is visible.
virtual void deselectArt() const
Deselects all of the target layer's art.
virtual bool convertToGroup()
Converts the target layer to an artwork group.
virtual std::auto_ptr< Art > group() const
Gets the first (invisible) art group inside the layer.
virtual bool hasArt() const
Gets whether the target layer has any art.
virtual void setName(const std::string &name_)
Sets the name for the target layer.
virtual void setPreview(const bool preview_)
Sets the target layer to preview or outline mode.
Allows for iteration through the siblings of a layer, a la std::vector iteration. ...
Definition: hdicoreLayer.h:49
virtual bool isEmpty() const
Gets whether the target Layer object is empty (constructed with the default ctor) ...
virtual bool dimsPlacedImages() const
Gets whether images in the target layer are automatically dimmed.
virtual bool operator!=(const Layer &rhs_) const
Tests whether a given Layer object is not the same as another.
virtual bool visible() const
Gets whether the target layer is visible.
~Iterator()
Destructs an Iterator object.
virtual void setColor(const Color &color_)
Sets the color of the layer in the layer list.
virtual void setLocked(const bool locked_)
Sets whether the target layer is locked.
Layer()
Constructs an empty Layer object.
virtual std::auto_ptr< Layer > sibling() const
Gets the next sibling layer object for the target layer.