Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreArrayPref.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_ARRAY_PREF__
8 #define __HDI_CORE_ARRAY_PREF__
9 
10 #include <vector>
11 
12 #include "hdicorePathStyle.h"
13 #include "hdicorePrefData.h"
14 
15 namespace hdi
16 {
17  namespace core
18  {
19  class ArtboardPoint;
20  class ArtboardRect;
21  class ArtColor;
22  class Color;
23  class Font;
24  class Point;
25  class Rect;
26  class Size;
27  class TransformMatrix;
28 
29  class ArtboardPointPref;
30  class ArtboardRectPref;
31  class ArtColorPref;
32  class BoolPref;
33  class ColorPref;
34  class DashStylePref;
35  class DashStyleMapPref;
36  class DictionaryPref;
37  class FillStylePref;
38  class FillStyleMapPref;
39  class FontPref;
40  class NumberPref;
41  class PathStylePref;
42  class PathStyleMapPref;
43  class PointPref;
44  class RectPref;
45  class SizePref;
46  class StringPref;
47  class StrokeStylePref;
48  class StrokeStyleMapPref;
49  class TransformMatrixPref;
50 
55  class ArrayPref : public PrefData
56  {
57  public:
58  typedef std::vector< PrefData* > PrefDataVector;
59 
67  ArrayPref(const ArrayPref& array_);
68 
83  ArrayPref(const PrefDataVector* elements_ = NULL, const std::string& name_ = "");
84 
90  virtual ~ArrayPref();
91 
100  virtual ArrayPref& operator=(const ArrayPref& rhs_);
101 
115  virtual ArrayPref* clone() const;
116 
124  virtual uint32_t count() const;
125 
138  virtual bool element(const uint32_t index_, std::auto_ptr<PrefData>& data__) const;
139 
148  virtual bool pushElement(const PrefData& data_);
149 
161  virtual bool popElement(std::auto_ptr<PrefData>& data__);
162 
174  virtual bool insertElement(const uint32_t index_, const PrefData& data_);
175 
190  virtual bool removeElement(const uint32_t index_, std::auto_ptr<PrefData>& data__);
191 
197  virtual void clear();
198 
209  virtual bool getArrayElement(const uint32_t index_, ArrayPref& array__) const;
210 
229  virtual bool getOrCreateArrayElement(
230  const uint32_t index_,
231  const PrefDataVector* elements_,
232  ArrayPref& array__
233  );
234 
245  virtual bool getArtboardPointElement(const uint32_t index_, ArtboardPointPref& abp__) const;
246 
259  virtual bool getOrCreateArtboardPointElement(
260  const uint32_t index_,
261  const ArtboardPoint& default_,
262  ArtboardPointPref& abp__
263  );
264 
275  virtual bool getArtboardRectElement(const uint32_t index_, ArtboardRectPref& abr__) const;
276 
289  virtual bool getOrCreateArtboardRectElement(
290  const uint32_t index_,
291  const ArtboardRect& default_,
292  ArtboardRectPref& abr__
293  );
294 
305  virtual bool getArtColorElement(const uint32_t index_, ArtColorPref& ac__) const;
306 
319  virtual bool getOrCreateArtColorElement(
320  const uint32_t index_,
321  const ArtColor& default_,
322  ArtColorPref& ac__
323  );
324 
335  virtual bool getBoolElement(const uint32_t index_, BoolPref& b__) const;
336 
348  virtual bool getOrCreateBoolElement(const uint32_t index_, const bool default_, BoolPref& b__);
349 
360  virtual bool getColorElement(const uint32_t index_, ColorPref& c__) const;
361 
373  virtual bool getOrCreateColorElement(const uint32_t index_, const Color& default_, ColorPref& c__);
374 
385  virtual bool getDashStyleElement(const uint32_t index_, DashStylePref& ds__);
386 
400  virtual bool getOrCreateDashStyleElement(
401  const uint32_t index_,
402  const DashStyle& default_,
403  DashStylePref& ds__
404  );
405 
416  virtual bool getDashStyleMapElement(const uint32_t index_, DashStyleMapPref& ds__);
417 
431  virtual bool getOrCreateDashStyleMapElement(
432  const uint32_t index_,
433  const DashStyle::Map& default_,
434  DashStyleMapPref& ds__
435  );
436 
447  virtual bool getDictElement(const uint32_t index_, DictionaryPref& dict__) const;
448 
468  virtual bool getOrCreateDictElement(
469  const uint32_t index_,
470  const PrefDataVector* members_,
471  DictionaryPref& dict__
472  );
473 
484  virtual bool getFillStyleElement(const uint32_t index_, FillStylePref& fs__);
485 
499  virtual bool getOrCreateFillStyleElement(
500  const uint32_t index_,
501  const FillStyle& default_,
502  FillStylePref& fs__
503  );
504 
515  virtual bool getFillStyleMapElement(const uint32_t index_, FillStyleMapPref& fs__);
516 
530  virtual bool getOrCreateFillStyleMapElement(
531  const uint32_t index_,
532  const FillStyle::Map& default_,
533  FillStyleMapPref& fs__
534  );
535 
546  virtual bool getFontElement(const uint32_t index_, FontPref& font__) const;
547 
560  virtual bool getOrCreateFontElement(
561  const uint32_t index_,
562  const Font& defaultFont_,
563  const double defaultSize_,
564  FontPref& font__
565  );
566 
577  virtual bool getTransformMatrixElement(const uint32_t index_, TransformMatrixPref& tm__) const;
578 
592  const uint32_t index_,
593  const TransformMatrix& default_,
594  TransformMatrixPref& tm__
595  );
596 
607  virtual bool getNumberElement(const uint32_t index_, NumberPref& n__) const;
608 
621  virtual bool getOrCreateIntElement(const uint32_t index_, const int64_t default_, NumberPref& n__);
622 
635  virtual bool getOrCreateFloatElement(const uint32_t index_, const double default_, NumberPref& n__);
636 
647  virtual bool getPathStyleElement(const uint32_t index_, PathStylePref& ps__);
648 
662  virtual bool getOrCreatePathStyleElement(
663  const uint32_t index_,
664  const PathStyle& default_,
665  PathStylePref& ps__
666  );
667 
678  virtual bool getPathStyleMapElement(const uint32_t index_, PathStyleMapPref& ps__);
679 
693  virtual bool getOrCreatePathStyleMapElement(
694  const uint32_t index_,
695  const PathStyle::Map& default_,
696  PathStyleMapPref& ps__
697  );
698 
709  virtual bool getPointElement(const uint32_t index_, PointPref& p__) const;
710 
723  virtual bool getOrCreatePointElement(const uint32_t index_, const Point& default_, PointPref& p__);
724 
735  virtual bool getRectElement(const uint32_t index_, RectPref& r__) const;
736 
748  virtual bool getOrCreateRectElement(const uint32_t index_, const Rect& default_, RectPref& r__);
749 
760  virtual bool getSizeElement(const uint32_t index_, SizePref& s__) const;
761 
773  virtual bool getOrCreateSizeElement(const uint32_t index_, const Size& default_, SizePref& s__);
774 
785  virtual bool getStringElement(const uint32_t index_, StringPref& str__) const;
786 
799  virtual bool getOrCreateStringElement(
800  const uint32_t index_,
801  const std::string& default_,
802  StringPref& str__
803  );
804 
815  virtual bool getStrokeStyleElement(const uint32_t index_, StrokeStylePref& ss__);
816 
830  virtual bool getOrCreateStrokeStyleElement(
831  const uint32_t index_,
832  const StrokeStyle& default_,
833  StrokeStylePref& ss__
834  );
835 
846  virtual bool getStrokeStyleMapElement(const uint32_t index_, StrokeStyleMapPref& ss__);
847 
862  const uint32_t index_,
863  const StrokeStyle::Map& default_,
864  StrokeStyleMapPref& ss__
865  );
866  };
867 
868  typedef std::auto_ptr<ArrayPref> ArrayPrefAP;
869  }
870 }
871 
872 #endif
873 // __HDI_CORE_ARRAY_PREF__
Allows for storage of path style maps.
Definition: hdicorePathStyleMapPref.h:20
virtual bool getOrCreateBoolElement(const uint32_t index_, const bool default_, BoolPref &b__)
Similar to getBoolElement(), except that, if the element does not already exist, it will be created a...
virtual bool getFillStyleMapElement(const uint32_t index_, FillStyleMapPref &fs__)
Gets a persistent fill style map object from the dictionary.
virtual ArrayPref * clone() const
Convenience method to clone an ArrayPref object on the heap.
Acts as a DashStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:30
virtual bool getOrCreateRectElement(const uint32_t index_, const Rect &default_, RectPref &r__)
Similar to getRectElement(), except that, if the element does not already exist, it will be created a...
virtual bool getOrCreateDictElement(const uint32_t index_, const PrefDataVector *members_, DictionaryPref &dict__)
Similar to getDictElement(), except that, if the element does not already exist, it will be created a...
virtual bool getPointElement(const uint32_t index_, PointPref &p__) const
Gets a persistent point object from the array.
virtual bool element(const uint32_t index_, std::auto_ptr< PrefData > &data__) const
Gets a single element object from the array data tree.
ArrayPref(const ArrayPref &array_)
Constructs a new ArrayPref object from an existing ArrayPref object (copy constructor) ...
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
virtual bool getOrCreateArtboardPointElement(const uint32_t index_, const ArtboardPoint &default_, ArtboardPointPref &abp__)
Similar to getArtboardPointElement(), except that, if the element does not already exist...
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:24
virtual bool getOrCreateArtboardRectElement(const uint32_t index_, const ArtboardRect &default_, ArtboardRectPref &abr__)
Similar to getArtboardRectElement(), except that, if the element does not already exist...
Allows for storage of 2D points.
Definition: hdicorePointPref.h:20
Allows for storage of artboard rects/bounds.
Definition: hdicoreArtboardRectPref.h:20
Allows for storage of colors.
Definition: hdicoreColorPref.h:20
virtual ~ArrayPref()
Destructs an ArrayPref object.
virtual uint32_t count() const
Gets the count of elements in the top-level of the array.
Allows for storage of font faces and sizes.
Definition: hdicoreFontPref.h:21
virtual bool getOrCreatePathStyleMapElement(const uint32_t index_, const PathStyle::Map &default_, PathStyleMapPref &ps__)
Similar to getPathStyleMapElement(), except that, if the element does not already exist...
virtual bool getOrCreateFillStyleElement(const uint32_t index_, const FillStyle &default_, FillStylePref &fs__)
Similar to getFillStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.
virtual bool getNumberElement(const uint32_t index_, NumberPref &n__) const
Gets a persistent number object from the array.
Describes all styling attributes of a path.
Definition: hdicorePathStyle.h:427
Acts as a FillStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:146
virtual bool getOrCreateFillStyleMapElement(const uint32_t index_, const FillStyle::Map &default_, FillStyleMapPref &fs__)
Similar to getFillStyleMapElement(), except that, if the element does not already exist...
virtual bool getOrCreateFloatElement(const uint32_t index_, const double default_, NumberPref &n__)
Similar to getNumberElement(), except that, if the element does not already exist, it will be created anew with a default value.
virtual bool getStrokeStyleElement(const uint32_t index_, StrokeStylePref &ss__)
Gets a persistent stroke style object from the dictionary.
Describes the stroke styling of a path.
Definition: hdicorePathStyle.h:249
Allows for storage of rects/bounds.
Definition: hdicoreRectPref.h:20
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:25
virtual bool getOrCreateArtColorElement(const uint32_t index_, const ArtColor &default_, ArtColorPref &ac__)
Similar to getArtColorElement(), except that, if the element does not already exist, it will be created anew with a default value.
virtual bool getFillStyleElement(const uint32_t index_, FillStylePref &fs__)
Gets a persistent fill style object from the dictionary.
Allows for storage of dash style maps.
Definition: hdicoreDashStyleMapPref.h:25
Acts as a dictionary-style container to store any other persistent data types, including arrays and d...
Definition: hdicoreDictionaryPref.h:55
virtual bool getStringElement(const uint32_t index_, StringPref &str__) const
Gets a persistent string object from the array.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
virtual bool getOrCreateIntElement(const uint32_t index_, const int64_t default_, NumberPref &n__)
Similar to getNumberElement(), except that, if the element does not already exist, it will be created anew with a default value.
virtual bool getOrCreateStringElement(const uint32_t index_, const std::string &default_, StringPref &str__)
Similar to getStringElement(), except that, if the element does not already exist, it will be created anew with a default value.
virtual bool getFontElement(const uint32_t index_, FontPref &font__) const
Gets a persistent font object from the array.
virtual ArrayPref & operator=(const ArrayPref &rhs_)
Allows one ArrayPref object to be assigned from another.
virtual bool pushElement(const PrefData &data_)
Adds a persistent data object to the end of the array.
Allows for 2-dimensional transformations in a single application via matrix math. ...
Definition: hdicoreTransformMatrix.h:26
virtual bool getOrCreatePathStyleElement(const uint32_t index_, const PathStyle &default_, PathStylePref &ps__)
Similar to getPathStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.
Allows for storage of fill style maps.
Definition: hdicoreFillStyleMapPref.h:25
virtual bool getBoolElement(const uint32_t index_, BoolPref &b__) const
Gets a persistent bool object from the array.
virtual bool getOrCreatePointElement(const uint32_t index_, const Point &default_, PointPref &p__)
Similar to getPointElement(), except that, if the element does not already exist, it will be created ...
Allows for storage of stroke style maps.
Definition: hdicoreStrokeStyleMapPref.h:25
Allows for storage of fill styles.
Definition: hdicoreFillStylePref.h:25
virtual bool getSizeElement(const uint32_t index_, SizePref &s__) const
Gets a persistent size object from the array.
Acts as a StrokeStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:433
Font class to allow for easy font manipulation.
Definition: hdicoreFont.h:170
virtual bool getOrCreateSizeElement(const uint32_t index_, const Size &default_, SizePref &s__)
Similar to getSizeElement(), except that, if the element does not already exist, it will be created a...
Allows for storage of transformation matrices.
Definition: hdicoreTransformMatrixPref.h:20
Header file for path style-related classes.
Allows for storage of 2D sizes.
Definition: hdicoreSizePref.h:20
Allows for storage of stroke styles.
Definition: hdicoreStrokeStylePref.h:25
Allows for storage of bools.
Definition: hdicoreBoolPref.h:19
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:24
Base class for persistent data objects, stored via JSON.
Definition: hdicorePrefData.h:24
Acts as an array-style container to store any other persistent data types, including arrays and dicti...
Definition: hdicoreArrayPref.h:55
virtual bool getDictElement(const uint32_t index_, DictionaryPref &dict__) const
Gets a persistent dictionary object from the array.
Allows for storage of dash styles.
Definition: hdicoreDashStylePref.h:25
Definition: hdicoreaiArray.h:12
virtual bool removeElement(const uint32_t index_, std::auto_ptr< PrefData > &data__)
Removes a persistent data object from an arbitrary position in the array.
virtual bool getOrCreateDashStyleElement(const uint32_t index_, const DashStyle &default_, DashStylePref &ds__)
Similar to getDashStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.
virtual bool getArtboardRectElement(const uint32_t index_, ArtboardRectPref &abr__) const
Gets a persistent artboard rect object from the array.
virtual bool getRectElement(const uint32_t index_, RectPref &r__) const
Gets a persistent rect object from the array.
Allows for storage of art colors.
Definition: hdicoreArtColorPref.h:20
Allows for the storage of strings.
Definition: hdicoreStringPref.h:19
Acts as a StrokeStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:276
virtual bool getArtColorElement(const uint32_t index_, ArtColorPref &ac__) const
Gets a persistent art color object from the array.
virtual bool insertElement(const uint32_t index_, const PrefData &data_)
Inserts a persistent data object at an arbitrary position in the array.
virtual bool popElement(std::auto_ptr< PrefData > &data__)
Removes a persistent data object from the end of the array.
virtual void clear()
Removes all elements from an array.
virtual bool getDashStyleMapElement(const uint32_t index_, DashStyleMapPref &ds__)
Gets a persistent dash style map object from the dictionary.
virtual bool getStrokeStyleMapElement(const uint32_t index_, StrokeStyleMapPref &ss__)
Gets a persistent stroke style map object from the dictionary.
virtual bool getPathStyleElement(const uint32_t index_, PathStylePref &ps__)
Gets a persistent path style object from the dictionary.
virtual bool getOrCreateFontElement(const uint32_t index_, const Font &defaultFont_, const double defaultSize_, FontPref &font__)
Similar to getFontElement(), except that, if the element does not already exist, it will be created a...
virtual bool getOrCreateArrayElement(const uint32_t index_, const PrefDataVector *elements_, ArrayPref &array__)
Similar to getArrayElement(), except that, if the element does not already exist, it will be created ...
virtual bool getOrCreateStrokeStyleElement(const uint32_t index_, const StrokeStyle &default_, StrokeStylePref &ss__)
Similar to getStrokeStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.
Allows for storage of 2D artboard points.
Definition: hdicoreArtboardPointPref.h:20
Describes the dash styling of a path.
Definition: hdicorePathStyle.h:19
virtual bool getTransformMatrixElement(const uint32_t index_, TransformMatrixPref &tm__) const
Gets a persistent matrix object from the array.
virtual bool getOrCreateDashStyleMapElement(const uint32_t index_, const DashStyle::Map &default_, DashStyleMapPref &ds__)
Similar to getDashStyleMapElement(), except that, if the element does not already exist...
virtual bool getArrayElement(const uint32_t index_, ArrayPref &array__) const
Gets a persistent array object from the containing array.
Allows for the storage of numbers.
Definition: hdicoreNumberPref.h:19
virtual bool getOrCreateTransformMatrixElement(const uint32_t index_, const TransformMatrix &default_, TransformMatrixPref &tm__)
Similar to getTransformMatrixElement(), except that, if the element does not already exist...
virtual bool getArtboardPointElement(const uint32_t index_, ArtboardPointPref &abp__) const
Gets a persistent point object from the array.
Header file for general preference data storage.
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28
virtual bool getOrCreateStrokeStyleMapElement(const uint32_t index_, const StrokeStyle::Map &default_, StrokeStyleMapPref &ss__)
Similar to getStrokeStyleMapElement(), except that, if the element does not already exist...
virtual bool getOrCreateColorElement(const uint32_t index_, const Color &default_, ColorPref &c__)
Similar to getColorElement(), except that, if the element does not already exist, it will be created ...
virtual bool getDashStyleElement(const uint32_t index_, DashStylePref &ds__)
Gets a persistent dash style object from the dictionary.
Describes the fill styling of a path.
Definition: hdicorePathStyle.h:140
Describes the color of art on the artboard.
Definition: hdicoreArtColor.h:32
virtual bool getPathStyleMapElement(const uint32_t index_, PathStyleMapPref &ps__)
Gets a persistent path style map object from the dictionary.
Allows for storage of path styles.
Definition: hdicorePathStylePref.h:20
virtual bool getColorElement(const uint32_t index_, ColorPref &c__) const
Gets a persistent color object from the array.