Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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
15namespace hdi
16{
17 namespace core
18 {
19 class Color;
20 class Font;
21 class Point;
22 class Rect;
23 class Size;
24
25 class BoolPref;
26 class ColorPref;
27 class DictionaryPref;
28 class FontPref;
29 class NumberPref;
30 class PointPref;
31 class RectPref;
32 class SizePref;
33 class StringPref;
34
35 #if defined(HDI_CORE_AIP_MODE)
36 class ArtboardPoint;
37 class ArtboardRect;
38 class ArtColor;
39 class TransformMatrix;
40
41 class ArtboardPointPref;
42 class ArtboardRectPref;
43 class ArtColorPref;
44 class DashStylePref;
45 class DashStyleMapPref;
46 class FillStylePref;
47 class FillStyleMapPref;
48 class PathStylePref;
49 class PathStyleMapPref;
50 class StrokeStylePref;
51 class StrokeStyleMapPref;
52 class TransformMatrixPref;
53 #endif
54
59 class ArrayPref : public PrefData
60 {
61 public:
62 typedef std::vector< std::shared_ptr<PrefData> > PrefDataVector;
63
71 ArrayPref(const ArrayPref& array_);
72
84 ArrayPref(const PrefDataVector* elements_ = NULL, const std::string& name_ = "");
85
91 virtual ~ArrayPref();
92
101 virtual ArrayPref& operator=(const ArrayPref& rhs_);
102
116 virtual ArrayPref* clone() const;
117
125 virtual uint32_t count() const;
126
139 virtual bool element(const uint32_t index_, std::unique_ptr<PrefData>& data__) const;
140
149 virtual bool pushElement(const PrefData& data_);
150
162 virtual bool popElement(std::unique_ptr<PrefData>& data__);
163
175 virtual bool insertElement(const uint32_t index_, const PrefData& data_);
176
191 virtual bool removeElement(const uint32_t index_, std::unique_ptr<PrefData>& data__);
192
198 virtual void clear();
199
210 virtual bool getArrayElement(const uint32_t index_, ArrayPref& array__) const;
211
228 const uint32_t index_,
229 const PrefDataVector* elements_,
230 ArrayPref& array__
231 );
232
233 #if defined(HDI_CORE_AIP_MODE)
244 virtual bool getArtboardPointElement(const uint32_t index_, ArtboardPointPref& abp__) const;
245
259 const uint32_t index_,
260 const ArtboardPoint& default_,
261 ArtboardPointPref& abp__
262 );
263
274 virtual bool getArtboardRectElement(const uint32_t index_, ArtboardRectPref& abr__) const;
275
289 const uint32_t index_,
290 const ArtboardRect& default_,
291 ArtboardRectPref& abr__
292 );
293
304 virtual bool getArtColorElement(const uint32_t index_, ArtColorPref& ac__) const;
305
319 const uint32_t index_,
320 const ArtColor& default_,
321 ArtColorPref& ac__
322 );
323 #endif
324 // HDI_CORE_AIP_MODE
325
336 virtual bool getBoolElement(const uint32_t index_, BoolPref& b__) const;
337
349 virtual bool getOrCreateBoolElement(const uint32_t index_, const bool default_, BoolPref& b__);
350
361 virtual bool getColorElement(const uint32_t index_, ColorPref& c__) const;
362
374 virtual bool getOrCreateColorElement(const uint32_t index_, const Color& default_, ColorPref& c__);
375
376 #if defined(HDI_CORE_AIP_MODE)
387 virtual bool getDashStyleElement(const uint32_t index_, DashStylePref& ds__);
388
403 const uint32_t index_,
404 const DashStyle& default_,
405 DashStylePref& ds__
406 );
407
418 virtual bool getDashStyleMapElement(const uint32_t index_, DashStyleMapPref& ds__);
419
434 const uint32_t index_,
435 const DashStyle::Map& default_,
436 DashStyleMapPref& ds__
437 );
438 #endif
439 // HDI_CORE_AIP_MODE
440
451 virtual bool getDictElement(const uint32_t index_, DictionaryPref& dict__) const;
452
470 const uint32_t index_,
471 const PrefDataVector* members_,
472 DictionaryPref& dict__
473 );
474
475 #if defined(HDI_CORE_AIP_MODE)
486 virtual bool getFillStyleElement(const uint32_t index_, FillStylePref& fs__);
487
502 const uint32_t index_,
503 const FillStyle& default_,
504 FillStylePref& fs__
505 );
506
517 virtual bool getFillStyleMapElement(const uint32_t index_, FillStyleMapPref& fs__);
518
533 const uint32_t index_,
534 const FillStyle::Map& default_,
535 FillStyleMapPref& fs__
536 );
537 #endif
538 // HDI_CORE_AIP_MODE
539
550 virtual bool getFontElement(const uint32_t index_, FontPref& font__) const;
551
565 const uint32_t index_,
566 const Font& defaultFont_,
567 const double defaultSize_,
568 FontPref& font__
569 );
570
571 #if defined(HDI_CORE_AIP_MODE)
582 virtual bool getTransformMatrixElement(const uint32_t index_, TransformMatrixPref& tm__) const;
583
597 const uint32_t index_,
598 const TransformMatrix& default_,
600 );
601 #endif
602 // HDI_CORE_AIP_MODE
603
614 virtual bool getNumberElement(const uint32_t index_, NumberPref& n__) const;
615
628 virtual bool getOrCreateIntElement(const uint32_t index_, const int64_t default_, NumberPref& n__);
629
642 virtual bool getOrCreateFloatElement(const uint32_t index_, const double default_, NumberPref& n__);
643
644 #if defined(HDI_CORE_AIP_MODE)
655 virtual bool getPathStyleElement(const uint32_t index_, PathStylePref& ps__);
656
671 const uint32_t index_,
672 const PathStyle& default_,
673 PathStylePref& ps__
674 );
675
686 virtual bool getPathStyleMapElement(const uint32_t index_, PathStyleMapPref& ps__);
687
702 const uint32_t index_,
703 const PathStyle::Map& default_,
704 PathStyleMapPref& ps__
705 );
706 #endif
707 // HDI_CORE_AIP_MODE
708
719 virtual bool getPointElement(const uint32_t index_, PointPref& p__) const;
720
733 virtual bool getOrCreatePointElement(const uint32_t index_, const Point& default_, PointPref& p__);
734
745 virtual bool getRectElement(const uint32_t index_, RectPref& r__) const;
746
758 virtual bool getOrCreateRectElement(const uint32_t index_, const Rect& default_, RectPref& r__);
759
770 virtual bool getSizeElement(const uint32_t index_, SizePref& s__) const;
771
783 virtual bool getOrCreateSizeElement(const uint32_t index_, const Size& default_, SizePref& s__);
784
795 virtual bool getStringElement(const uint32_t index_, StringPref& str__) const;
796
810 const uint32_t index_,
811 const std::string& default_,
812 StringPref& str__
813 );
814
815 #if defined(HDI_CORE_AIP_MODE)
826 virtual bool getStrokeStyleElement(const uint32_t index_, StrokeStylePref& ss__);
827
842 const uint32_t index_,
843 const StrokeStyle& default_,
844 StrokeStylePref& ss__
845 );
846
857 virtual bool getStrokeStyleMapElement(const uint32_t index_, StrokeStyleMapPref& ss__);
858
873 const uint32_t index_,
874 const StrokeStyle::Map& default_,
876 );
877 #endif
878 // HDI_CORE_AIP_MODE
879 };
880
881 typedef std::unique_ptr<ArrayPref> ArrayPrefUP;
882 typedef std::shared_ptr<ArrayPref> ArrayPrefSP;
883 typedef std::weak_ptr<ArrayPref> ArrayPrefWP;
884 }
885}
886
887#endif
888// __HDI_CORE_ARRAY_PREF__
Acts as an array-style container to store any other persistent data types, including arrays and dicti...
Definition: hdicoreArrayPref.h:60
virtual bool getPathStyleMapElement(const uint32_t index_, PathStyleMapPref &ps__)
Gets a persistent path 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 element(const uint32_t index_, std::unique_ptr< PrefData > &data__) const
Gets a single element object from the array data tree.
virtual bool getFillStyleMapElement(const uint32_t index_, FillStyleMapPref &fs__)
Gets a persistent fill style map object from the dictionary.
virtual bool getArtboardRectElement(const uint32_t index_, ArtboardRectPref &abr__) const
Gets a persistent artboard rect object from the array.
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 getOrCreatePathStyleElement(const uint32_t index_, const PathStyle &default_, PathStylePref &ps__)
Similar to getPathStyleElement(), except that, if the element does not already exist,...
virtual bool getArtColorElement(const uint32_t index_, ArtColorPref &ac__) const
Gets a persistent art color object from the array.
virtual bool getDictElement(const uint32_t index_, DictionaryPref &dict__) const
Gets a persistent dictionary object from the array.
virtual bool getTransformMatrixElement(const uint32_t index_, TransformMatrixPref &tm__) const
Gets a persistent matrix object from the array.
virtual uint32_t count() const
Gets the count of elements in the top-level of the array.
virtual bool getArrayElement(const uint32_t index_, ArrayPref &array__) const
Gets a persistent array object from the containing array.
virtual bool getDashStyleMapElement(const uint32_t index_, DashStyleMapPref &ds__)
Gets a persistent dash style map object from the dictionary.
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 getDashStyleElement(const uint32_t index_, DashStylePref &ds__)
Gets a persistent dash style object from the dictionary.
virtual bool getOrCreateStrokeStyleElement(const uint32_t index_, const StrokeStyle &default_, StrokeStylePref &ss__)
Similar to getStrokeStyleElement(), except that, if the element does not already exist,...
virtual bool getRectElement(const uint32_t index_, RectPref &r__) const
Gets a persistent rect object from the array.
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,...
virtual bool removeElement(const uint32_t index_, std::unique_ptr< PrefData > &data__)
Removes a persistent data object from an arbitrary position in the array.
virtual ArrayPref & operator=(const ArrayPref &rhs_)
Allows one ArrayPref object to be assigned from another.
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 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 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 ...
virtual bool getOrCreateArtboardPointElement(const uint32_t index_, const ArtboardPoint &default_, ArtboardPointPref &abp__)
Similar to getArtboardPointElement(), except that, if the element does not already exist,...
virtual bool getOrCreateArtColorElement(const uint32_t index_, const ArtColor &default_, ArtColorPref &ac__)
Similar to getArtColorElement(), except that, if the element does not already exist,...
virtual void clear()
Removes all elements from an array.
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,...
ArrayPref(const PrefDataVector *elements_=NULL, const std::string &name_="")
Constructs an ArrayPref object, with new data, to be added to a container at a later time.
virtual bool getNumberElement(const uint32_t index_, NumberPref &n__) const
Gets a persistent number 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 getOrCreateDashStyleElement(const uint32_t index_, const DashStyle &default_, DashStylePref &ds__)
Similar to getDashStyleElement(), 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,...
virtual bool getSizeElement(const uint32_t index_, SizePref &s__) const
Gets a persistent size object from the array.
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 pushElement(const PrefData &data_)
Adds a persistent data object to the end of the array.
virtual bool getStrokeStyleElement(const uint32_t index_, StrokeStylePref &ss__)
Gets a persistent stroke style object from the dictionary.
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 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 getOrCreateFloatElement(const uint32_t index_, const double default_, NumberPref &n__)
Similar to getNumberElement(), 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.
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 ArrayPref * clone() const
Convenience method to clone an ArrayPref object on the heap.
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 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...
virtual bool getColorElement(const uint32_t index_, ColorPref &c__) const
Gets a persistent color object from the array.
virtual bool getStringElement(const uint32_t index_, StringPref &str__) const
Gets a persistent string object from the array.
virtual bool getBoolElement(const uint32_t index_, BoolPref &b__) const
Gets a persistent bool object from the array.
virtual bool getPointElement(const uint32_t index_, PointPref &p__) const
Gets a persistent point object from the array.
virtual bool getOrCreateArtboardRectElement(const uint32_t index_, const ArtboardRect &default_, ArtboardRectPref &abr__)
Similar to getArtboardRectElement(), except that, if the element does not already exist,...
ArrayPref(const ArrayPref &array_)
Constructs a new ArrayPref object from an existing ArrayPref object (copy constructor)
virtual bool getFontElement(const uint32_t index_, FontPref &font__) const
Gets a persistent font object from the array.
virtual bool getStrokeStyleMapElement(const uint32_t index_, StrokeStyleMapPref &ss__)
Gets a persistent stroke style map object from the dictionary.
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 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 popElement(std::unique_ptr< PrefData > &data__)
Removes a persistent data object from the end of the array.
virtual ~ArrayPref()
Destructs an ArrayPref object.
virtual bool getFillStyleElement(const uint32_t index_, FillStylePref &fs__)
Gets a persistent fill style object from the dictionary.
Describes the color of art on the artboard.
Definition: hdicoreArtColor.h:40
Allows for storage of art colors.
Definition: hdicoreArtColorPref.h:23
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:31
Allows for storage of 2D artboard points.
Definition: hdicoreArtboardPointPref.h:23
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:28
Allows for storage of artboard rects/bounds.
Definition: hdicoreArtboardRectPref.h:23
Allows for storage of bools.
Definition: hdicoreBoolPref.h:20
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:32
Allows for storage of colors.
Definition: hdicoreColorPref.h:21
Acts as a DashStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:33
Describes the dash styling of a path.
Definition: hdicorePathStyle.h:22
Allows for storage of dash style maps.
Definition: hdicoreDashStyleMapPref.h:28
Allows for storage of dash styles.
Definition: hdicoreDashStylePref.h:28
Acts as a dictionary-style container to store any other persistent data types, including arrays and d...
Definition: hdicoreDictionaryPref.h:60
Acts as a FillStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:153
Describes the fill styling of a path.
Definition: hdicorePathStyle.h:147
Allows for storage of fill style maps.
Definition: hdicoreFillStyleMapPref.h:28
Allows for storage of fill styles.
Definition: hdicoreFillStylePref.h:28
Font class to allow for easy font manipulation.
Definition: hdicoreFont.h:183
Allows for storage of font faces and sizes.
Definition: hdicoreFontPref.h:22
Allows for the storage of numbers.
Definition: hdicoreNumberPref.h:20
Acts as a StrokeStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:448
Describes all styling attributes of a path.
Definition: hdicorePathStyle.h:442
Allows for storage of path style maps.
Definition: hdicorePathStyleMapPref.h:23
Allows for storage of path styles.
Definition: hdicorePathStylePref.h:23
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:38
Allows for storage of 2D points.
Definition: hdicorePointPref.h:21
Base class for persistent data objects, stored via JSON.
Definition: hdicorePrefData.h:25
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Allows for storage of rects/bounds.
Definition: hdicoreRectPref.h:21
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:25
Allows for storage of 2D sizes.
Definition: hdicoreSizePref.h:21
Allows for the storage of strings.
Definition: hdicoreStringPref.h:20
Acts as a StrokeStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:287
Describes the stroke styling of a path.
Definition: hdicorePathStyle.h:260
Allows for storage of stroke style maps.
Definition: hdicoreStrokeStyleMapPref.h:28
Allows for storage of stroke styles.
Definition: hdicoreStrokeStylePref.h:28
Allows for 2-dimensional transformations in a single application via matrix math.
Definition: hdicoreTransformMatrix.h:34
Allows for storage of transformation matrices.
Definition: hdicoreTransformMatrixPref.h:23
Header file for path style-related classes.
Header file for general preference data storage.