Hot Door CORE 0.8.4
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreDictionaryPref.h
Go to the documentation of this file.
1
6
7#ifndef __HDI_CORE_DICTIONARY_PREF__
8#define __HDI_CORE_DICTIONARY_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 ArrayPref;
26 class BoolPref;
27 class ColorPref;
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
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;
53 #endif
54
59 class DictionaryPref : public PrefData
60 {
61 public:
62 typedef std::vector< std::shared_ptr<PrefData> > PrefDataVector;
63 typedef std::vector< std::string > KeyVector;
64
77 {
78 public:
86 Iterator(const Iterator& iter_);
87
94
105
114 bool operator==(const Iterator& rhs_) const;
115
124 bool operator!=(const Iterator& rhs_) const;
125
134
143
152
161
170 bool atEnd() const;
171
179 std::string key() const;
180
188 std::unique_ptr<PrefData> value() const;
189
190
191 private:
192 // Only DictionaryPref can construct a new Iterator object
193 friend class DictionaryPref;
194
198 void* __data;
199
205 Iterator();
206
214 explicit Iterator(const DictionaryPref& dict_);
215 };
216
217 typedef std::unique_ptr<Iterator> IteratorUP;
218 typedef std::shared_ptr<Iterator> IteratorSP;
219 typedef std::weak_ptr<Iterator> IteratorWP;
220
230
243 DictionaryPref(const PrefDataVector* members_ = NULL, const std::string& name_ = "");
244
251
261
275 virtual DictionaryPref* clone() const;
276
284 virtual KeyVector allKeys() const;
285
297 virtual bool addMember(const PrefData& data_);
298
312 virtual bool member(const std::string& name_, std::unique_ptr<PrefData>& data__) const;
313
327 virtual bool removeMember(const std::string& name_, std::unique_ptr<PrefData>& data__);
328
334 virtual void clear();
335
351 virtual Iterator begin() const;
352
363 virtual bool getArrayMember(const std::string& key_, ArrayPref& array__) const;
364
382 const std::string& name_,
383 const PrefDataVector* elements_,
384 ArrayPref& array__
385 );
386
387 #if defined(HDI_CORE_AIP_MODE)
398 virtual bool getArtboardPointMember(const std::string& key_, ArtboardPointPref& abp__) const;
399
414 const std::string& key_,
415 const ArtboardPoint& default_,
416 ArtboardPointPref& abp__
417 );
418
429 virtual bool getArtboardRectMember(const std::string& key_, ArtboardRectPref& abr__) const;
430
445 const std::string& key_,
446 const ArtboardRect& default_,
447 ArtboardRectPref& abr__
448 );
449
460 virtual bool getArtColorMember(const std::string& key_, ArtColorPref& ac__) const;
461
476 const std::string& key_,
477 const ArtColor& default_,
478 ArtColorPref& ac__
479 );
480 #endif
481 // HDI_CORE_AIP_MODE
482
493 virtual bool getBoolMember(const std::string& key_, BoolPref& b__) const;
494
508 const std::string& key_,
509 const bool default_,
510 BoolPref& b__
511 );
512
523 virtual bool getColorMember(const std::string& key_, ColorPref& c__) const;
524
538 const std::string& key_,
539 const Color& default_,
540 ColorPref& c__
541 );
542
543 #if defined(HDI_CORE_AIP_MODE)
554 virtual bool getDashStyleMember(const std::string& key_, DashStylePref& ds__);
555
570 const std::string& key_,
571 const DashStyle& default_,
572 DashStylePref& ds__
573 );
574
585 virtual bool getDashStyleMapMember(const std::string& key_, DashStyleMapPref& ds__);
586
601 const std::string& key_,
602 const DashStyle::Map& default_,
603 DashStyleMapPref& ds__
604 );
605 #endif
606 // HDI_CORE_AIP_MODE
607
618 virtual bool getDictMember(const std::string& key_, DictionaryPref& dict__) const;
619
638 const std::string& name_,
639 const PrefDataVector* members_,
640 DictionaryPref& dict__
641 );
642
643 #if defined(HDI_CORE_AIP_MODE)
654 virtual bool getFillStyleMember(const std::string& key_, FillStylePref& fs__);
655
670 const std::string& key_,
671 const FillStyle& default_,
672 FillStylePref& fs__
673 );
674
685 virtual bool getFillStyleMapMember(const std::string& key_, FillStyleMapPref& fs__);
686
701 const std::string& key_,
702 const FillStyle::Map& default_,
703 FillStyleMapPref& fs__
704 );
705 #endif
706 // HDI_CORE_AIP_MODE
707
718 virtual bool getFontMember(const std::string& key_, FontPref& f__) const;
719
734 const std::string& key_,
735 const Font& defaultFont_,
736 const double defaultSize_,
737 FontPref& f__
738 );
739
740 #if defined(HDI_CORE_AIP_MODE)
751 virtual bool getTransformMatrixMember(const std::string& key_, TransformMatrixPref& tm__) const;
752
767 const std::string& key_,
768 const TransformMatrix& default_,
770 );
771 #endif
772 // HDI_CORE_AIP_MODE
773
784 virtual bool getNumberMember(const std::string& key_, NumberPref& n__) const;
785
799 virtual bool getOrCreateIntMember(const std::string& key_, const int64_t default_, NumberPref& n__);
800
814 virtual bool getOrCreateFloatMember(const std::string& key_, const double default_, NumberPref& n__);
815
816 #if defined(HDI_CORE_AIP_MODE)
827 virtual bool getPathStyleMember(const std::string& key_, PathStylePref& ps__);
828
843 const std::string& key_,
844 const PathStyle& default_,
845 PathStylePref& ps__
846 );
847
858 virtual bool getPathStyleMapMember(const std::string& key_, PathStyleMapPref& ps__);
859
874 const std::string& key_,
875 const PathStyle::Map& default_,
876 PathStyleMapPref& ps__
877 );
878 #endif
879 // HDI_CORE_AIP_MODE
880
891 virtual bool getPointMember(const std::string& key_, PointPref& p__) const;
892
905 virtual bool getOrCreatePointMember(const std::string& key_, const Point& default_, PointPref& p__);
906
917 virtual bool getRectMember(const std::string& key_, RectPref& r__) const;
918
931 virtual bool getOrCreateRectMember(const std::string& key_, const Rect& default_, RectPref& r__);
932
943 virtual bool getSizeMember(const std::string& key_, SizePref& s__) const;
944
957 virtual bool getOrCreateSizeMember(const std::string& key_, const Size& default_, SizePref& s__);
958
969 virtual bool getStringMember(const std::string& key_, StringPref& str__) const;
970
985 const std::string& key_,
986 const std::string& default_,
987 StringPref& str__
988 );
989
990 #if defined(HDI_CORE_AIP_MODE)
1001 virtual bool getStrokeStyleMember(const std::string& key_, StrokeStylePref& ss__);
1002
1017 const std::string& key_,
1018 const StrokeStyle& default_,
1019 StrokeStylePref& ss__
1020 );
1021
1032 virtual bool getStrokeStyleMapMember(const std::string& key_, StrokeStyleMapPref& ss__);
1033
1048 const std::string& key_,
1049 const StrokeStyle::Map& default_,
1050 StrokeStyleMapPref& ss__
1051 );
1052 #endif
1053 // HDI_CORE_AIP_MODE
1054 };
1055
1056 typedef std::unique_ptr<DictionaryPref> DictionaryPrefUP;
1057 typedef std::shared_ptr<DictionaryPref> DictionaryPrefSP;
1058 typedef std::weak_ptr<DictionaryPref> DictionaryPrefWP;
1059 }
1060}
1061
1062#endif
1063// __HDI_CORE_DICTIONARY_PREF__
Acts as an array-style container to store any other persistent data types, including arrays and dicti...
Definition hdicoreArrayPref.h:60
Describes the color of art on the artboard.
Definition hdicoreArtColor.h:42
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:34
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
Allows for iteration through the members of a dictionary pref, a la std::vector iteration.
Definition hdicoreDictionaryPref.h:77
~Iterator()
Destructs an Iterator object.
bool operator==(const Iterator &rhs_) const
Tests whether a given Iterator object is the same as another.
Iterator & operator--()
Prefix decrement operator for reverse iteration.
Iterator operator--(int)
Postfix decrement operator for reverse iteration.
Iterator & operator++()
Prefix increment operator for forward iteration.
std::unique_ptr< PrefData > value() const
Gets the current member's value as pointed to by the iterator.
bool atEnd() const
Determines whether iteration should stop; works well as the conditional in a for() loop.
std::string key() const
Gets the current member's key as pointed to by the iterator.
bool operator!=(const Iterator &rhs_) const
Tests whether a given Iterator object is not the same as another.
Iterator(const Iterator &iter_)
Constructs an Iterator object from an existing Iterator object (copy constructor)
Iterator & operator=(const Iterator &rhs_)
Assigns one Iterator object to another.
Iterator operator++(int)
Postfix increment operator for forward iteration.
virtual bool getPathStyleMapMember(const std::string &key_, PathStyleMapPref &ps__)
Gets a persistent path style map object from the dictionary.
virtual bool getArtboardPointMember(const std::string &key_, ArtboardPointPref &abp__) const
Gets a persistent artboard point object from the dictionary.
virtual ~DictionaryPref()
Destructs a DictionaryPref object.
virtual bool getTransformMatrixMember(const std::string &key_, TransformMatrixPref &tm__) const
Gets a persistent matrix object from the dictionary.
virtual bool getStrokeStyleMapMember(const std::string &key_, StrokeStyleMapPref &ss__)
Gets a persistent stroke style map object from the dictionary.
virtual DictionaryPref & operator=(const DictionaryPref &rhs_)
Allows one DictionaryPref object to be assigned from another.
virtual bool getFillStyleMember(const std::string &key_, FillStylePref &fs__)
Gets a persistent fill style object from the dictionary.
virtual bool getNumberMember(const std::string &key_, NumberPref &n__) const
Gets a persistent number object from the dictionary.
virtual Iterator begin() const
Gets an iterator for the dictionary.
virtual bool getOrCreateTransformMatrixMember(const std::string &key_, const TransformMatrix &default_, TransformMatrixPref &tm__)
Similar to getTransformMatrixMember(), except that, if the member does not already exist,...
virtual bool getOrCreateColorMember(const std::string &key_, const Color &default_, ColorPref &c__)
Similar to getColorMember(), except that, if the member does not already exist, it will be created an...
virtual bool getOrCreateFloatMember(const std::string &key_, const double default_, NumberPref &n__)
Similar to getNumberMember(), except that, if the member does not already exist, it will be created a...
virtual bool getDictMember(const std::string &key_, DictionaryPref &dict__) const
Gets a persistent dictionary object from the dictionary.
virtual bool getStrokeStyleMember(const std::string &key_, StrokeStylePref &ss__)
Gets a persistent stroke style object from the dictionary.
virtual bool getOrCreateFillStyleMapMember(const std::string &key_, const FillStyle::Map &default_, FillStyleMapPref &fs__)
Similar to getFillStyleMapMember(), except that, if the member does not already exist,...
virtual bool getOrCreateDashStyleMember(const std::string &key_, const DashStyle &default_, DashStylePref &ds__)
Similar to getDashStyleMember(), except that, if the member does not already exist,...
virtual bool getOrCreateIntMember(const std::string &key_, const int64_t default_, NumberPref &n__)
Similar to getNumberMember(), except that, if the member does not already exist, it will be created a...
virtual bool member(const std::string &name_, std::unique_ptr< PrefData > &data__) const
Gets a single member object from the dictionary data tree.
virtual bool getArrayMember(const std::string &key_, ArrayPref &array__) const
Gets a persistent array object from the containing dictionary.
virtual bool getPointMember(const std::string &key_, PointPref &p__) const
Gets a persistent point object from the dictionary.
virtual bool getOrCreateDictMember(const std::string &name_, const PrefDataVector *members_, DictionaryPref &dict__)
Similar to getDictMember(), except that, if the member does not already exist, it will be created ane...
virtual KeyVector allKeys() const
Gets a vector of all keys contained by the target dictionary.
virtual bool getOrCreateStrokeStyleMember(const std::string &key_, const StrokeStyle &default_, StrokeStylePref &ss__)
Similar to getStrokeStyleMember(), except that, if the member does not already exist,...
virtual void clear()
Removes all members from the target dictionary.
virtual bool getSizeMember(const std::string &key_, SizePref &s__) const
Gets a persistent size object from the dictionary.
virtual bool getOrCreateStringMember(const std::string &key_, const std::string &default_, StringPref &str__)
Similar to getStringMember(), except that, if the member does not already exist, it will be created a...
virtual bool getOrCreateRectMember(const std::string &key_, const Rect &default_, RectPref &r__)
Similar to getRectMember(), except that, if the member does not already exist, it will be created ane...
virtual bool getArtboardRectMember(const std::string &key_, ArtboardRectPref &abr__) const
Gets a persistent artboard rect object from the dictionary.
virtual bool getOrCreateBoolMember(const std::string &key_, const bool default_, BoolPref &b__)
Similar to getBoolMember(), except that, if the member does not already exist, it will be created ane...
virtual bool getFillStyleMapMember(const std::string &key_, FillStyleMapPref &fs__)
Gets a persistent fill style map object from the dictionary.
virtual bool addMember(const PrefData &data_)
Adds a PrefData object into the dictionary member tree at the top-level.
virtual bool getFontMember(const std::string &key_, FontPref &f__) const
Gets a persistent font object from the dictionary.
virtual bool getOrCreateArtboardPointMember(const std::string &key_, const ArtboardPoint &default_, ArtboardPointPref &abp__)
Similar to getArtboardPointMember(), except that, if the member does not already exist,...
virtual bool removeMember(const std::string &name_, std::unique_ptr< PrefData > &data__)
Removes a PrefData member from the dictionary.
virtual bool getOrCreatePointMember(const std::string &key_, const Point &default_, PointPref &p__)
Similar to getPointMember(), except that, if the member does not already exist, it will be created an...
virtual DictionaryPref * clone() const
Convenience method to clone an DictionaryPref object on the heap.
virtual bool getArtColorMember(const std::string &key_, ArtColorPref &ac__) const
Gets a persistent art color object from the dictionary.
DictionaryPref(const PrefDataVector *members_=NULL, const std::string &name_="")
Constructs a DictionaryPref object, with new data, to be added to a container at a later time.
virtual bool getColorMember(const std::string &key_, ColorPref &c__) const
Gets a persistent color object from the dictionary.
virtual bool getBoolMember(const std::string &key_, BoolPref &b__) const
Gets a persistent bool object from the dictionary.
DictionaryPref(const DictionaryPref &dict_)
Constructs a new DictionaryPref object from an existing DictionaryPref object (copy constructor)
virtual bool getOrCreateArtboardRectMember(const std::string &key_, const ArtboardRect &default_, ArtboardRectPref &abr__)
Similar to getArtboardRectMember(), except that, if the member does not already exist,...
virtual bool getOrCreateArtColorMember(const std::string &key_, const ArtColor &default_, ArtColorPref &ac__)
Similar to getArtColorMember(), except that, if the member does not already exist,...
virtual bool getDashStyleMember(const std::string &key_, DashStylePref &ds__)
Gets a persistent dash style object from the dictionary.
virtual bool getRectMember(const std::string &key_, RectPref &r__) const
Gets a persistent rect object from the dictionary.
virtual bool getDashStyleMapMember(const std::string &key_, DashStyleMapPref &ds__)
Gets a persistent dash style map object from the dictionary.
virtual bool getOrCreateStrokeStyleMapMember(const std::string &key_, const StrokeStyle::Map &default_, StrokeStyleMapPref &ss__)
Similar to getStrokeStyleMapMember(), except that, if the member does not already exist,...
virtual bool getOrCreateFillStyleMember(const std::string &key_, const FillStyle &default_, FillStylePref &fs__)
Similar to getFillStyleMember(), except that, if the member does not already exist,...
virtual bool getOrCreateFontMember(const std::string &key_, const Font &defaultFont_, const double defaultSize_, FontPref &f__)
Similar to getFontMember(), except that, if the member does not already exist, it will be created ane...
virtual bool getOrCreatePathStyleMember(const std::string &key_, const PathStyle &default_, PathStylePref &ps__)
Similar to getPathStyleMember(), except that, if the member does not already exist,...
virtual bool getPathStyleMember(const std::string &key_, PathStylePref &ps__)
Gets a persistent path style object from the dictionary.
virtual bool getOrCreateArrayMember(const std::string &name_, const PrefDataVector *elements_, ArrayPref &array__)
Similar to getArrayMember(), except that, if the member does not already exist, it will be created an...
virtual bool getOrCreateSizeMember(const std::string &key_, const Size &default_, SizePref &s__)
Similar to getSizeMember(), except that, if the member does not already exist, it will be created ane...
virtual bool getStringMember(const std::string &key_, StringPref &str__) const
Gets a persistent string object from the dictionary.
virtual bool getOrCreateDashStyleMapMember(const std::string &key_, const DashStyle::Map &default_, DashStyleMapPref &ds__)
Similar to getDashStyleMapMember(), except that, if the member does not already exist,...
virtual bool getOrCreatePathStyleMapMember(const std::string &key_, const PathStyle::Map &default_, PathStyleMapPref &ps__)
Similar to getPathStyleMapMember(), except that, if the member does not already exist,...
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
PrefData()
Constructs an empty PrefData object.
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.