Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreDictionaryPref.h
Go to the documentation of this file.
1
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
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 DictionaryPref : public PrefData
60 {
61 public:
62 typedef std::vector< std::shared_ptr<PrefData> > PrefDataVector;
63
76 {
77 public:
85 Iterator(const Iterator& iter_);
86
93
104
113 bool operator==(const Iterator& rhs_) const;
114
123 bool operator!=(const Iterator& rhs_) const;
124
133
142
151
160
169 bool atEnd() const;
170
178 std::string key() const;
179
187 std::unique_ptr<PrefData> value() const;
188
189
190 private:
191 // Only DictionaryPref can construct a new Iterator object
192 friend class DictionaryPref;
193
197 void* __data;
198
204 Iterator();
205
213 explicit Iterator(const DictionaryPref& dict_);
214 };
215
216 typedef std::unique_ptr<Iterator> IteratorUP;
217 typedef std::shared_ptr<Iterator> IteratorSP;
218 typedef std::weak_ptr<Iterator> IteratorWP;
219
229
242 DictionaryPref(const PrefDataVector* members_ = NULL, const std::string& name_ = "");
243
250
260
274 virtual DictionaryPref* clone() const;
275
287 virtual bool addMember(const PrefData& data_);
288
302 virtual bool member(const std::string& name_, std::unique_ptr<PrefData>& data__) const;
303
317 virtual bool removeMember(const std::string& name_, std::unique_ptr<PrefData>& data__);
318
334 virtual Iterator begin() const;
335
346 virtual bool getArrayMember(const std::string& key_, ArrayPref& array__) const;
347
365 const std::string& name_,
366 const PrefDataVector* elements_,
367 ArrayPref& array__
368 );
369
370 #if defined(HDI_CORE_AIP_MODE)
381 virtual bool getArtboardPointMember(const std::string& key_, ArtboardPointPref& abp__) const;
382
397 const std::string& key_,
398 const ArtboardPoint& default_,
399 ArtboardPointPref& abp__
400 );
401
412 virtual bool getArtboardRectMember(const std::string& key_, ArtboardRectPref& abr__) const;
413
428 const std::string& key_,
429 const ArtboardRect& default_,
430 ArtboardRectPref& abr__
431 );
432
443 virtual bool getArtColorMember(const std::string& key_, ArtColorPref& ac__) const;
444
459 const std::string& key_,
460 const ArtColor& default_,
461 ArtColorPref& ac__
462 );
463 #endif
464 // HDI_CORE_AIP_MODE
465
476 virtual bool getBoolMember(const std::string& key_, BoolPref& b__) const;
477
491 const std::string& key_,
492 const bool default_,
493 BoolPref& b__
494 );
495
506 virtual bool getColorMember(const std::string& key_, ColorPref& c__) const;
507
521 const std::string& key_,
522 const Color& default_,
523 ColorPref& c__
524 );
525
526 #if defined(HDI_CORE_AIP_MODE)
537 virtual bool getDashStyleMember(const std::string& key_, DashStylePref& ds__);
538
553 const std::string& key_,
554 const DashStyle& default_,
555 DashStylePref& ds__
556 );
557
568 virtual bool getDashStyleMapMember(const std::string& key_, DashStyleMapPref& ds__);
569
584 const std::string& key_,
585 const DashStyle::Map& default_,
586 DashStyleMapPref& ds__
587 );
588 #endif
589 // HDI_CORE_AIP_MODE
590
601 virtual bool getDictMember(const std::string& key_, DictionaryPref& dict__) const;
602
621 const std::string& name_,
622 const PrefDataVector* members_,
623 DictionaryPref& dict__
624 );
625
626 #if defined(HDI_CORE_AIP_MODE)
637 virtual bool getFillStyleMember(const std::string& key_, FillStylePref& fs__);
638
653 const std::string& key_,
654 const FillStyle& default_,
655 FillStylePref& fs__
656 );
657
668 virtual bool getFillStyleMapMember(const std::string& key_, FillStyleMapPref& fs__);
669
684 const std::string& key_,
685 const FillStyle::Map& default_,
686 FillStyleMapPref& fs__
687 );
688 #endif
689 // HDI_CORE_AIP_MODE
690
701 virtual bool getFontMember(const std::string& key_, FontPref& f__) const;
702
717 const std::string& key_,
718 const Font& defaultFont_,
719 const double defaultSize_,
720 FontPref& f__
721 );
722
723 #if defined(HDI_CORE_AIP_MODE)
734 virtual bool getTransformMatrixMember(const std::string& key_, TransformMatrixPref& tm__) const;
735
750 const std::string& key_,
751 const TransformMatrix& default_,
753 );
754 #endif
755 // HDI_CORE_AIP_MODE
756
767 virtual bool getNumberMember(const std::string& key_, NumberPref& n__) const;
768
782 virtual bool getOrCreateIntMember(const std::string& key_, const int64_t default_, NumberPref& n__);
783
797 virtual bool getOrCreateFloatMember(const std::string& key_, const double default_, NumberPref& n__);
798
799 #if defined(HDI_CORE_AIP_MODE)
810 virtual bool getPathStyleMember(const std::string& key_, PathStylePref& ps__);
811
826 const std::string& key_,
827 const PathStyle& default_,
828 PathStylePref& ps__
829 );
830
841 virtual bool getPathStyleMapMember(const std::string& key_, PathStyleMapPref& ps__);
842
857 const std::string& key_,
858 const PathStyle::Map& default_,
859 PathStyleMapPref& ps__
860 );
861 #endif
862 // HDI_CORE_AIP_MODE
863
874 virtual bool getPointMember(const std::string& key_, PointPref& p__) const;
875
888 virtual bool getOrCreatePointMember(const std::string& key_, const Point& default_, PointPref& p__);
889
900 virtual bool getRectMember(const std::string& key_, RectPref& r__) const;
901
914 virtual bool getOrCreateRectMember(const std::string& key_, const Rect& default_, RectPref& r__);
915
926 virtual bool getSizeMember(const std::string& key_, SizePref& s__) const;
927
940 virtual bool getOrCreateSizeMember(const std::string& key_, const Size& default_, SizePref& s__);
941
952 virtual bool getStringMember(const std::string& key_, StringPref& str__) const;
953
968 const std::string& key_,
969 const std::string& default_,
970 StringPref& str__
971 );
972
973 #if defined(HDI_CORE_AIP_MODE)
984 virtual bool getStrokeStyleMember(const std::string& key_, StrokeStylePref& ss__);
985
1000 const std::string& key_,
1001 const StrokeStyle& default_,
1002 StrokeStylePref& ss__
1003 );
1004
1015 virtual bool getStrokeStyleMapMember(const std::string& key_, StrokeStyleMapPref& ss__);
1016
1031 const std::string& key_,
1032 const StrokeStyle::Map& default_,
1033 StrokeStyleMapPref& ss__
1034 );
1035 #endif
1036 // HDI_CORE_AIP_MODE
1037 };
1038
1039 typedef std::unique_ptr<DictionaryPref> DictionaryPrefUP;
1040 typedef std::shared_ptr<DictionaryPref> DictionaryPrefSP;
1041 typedef std::weak_ptr<DictionaryPref> DictionaryPrefWP;
1042 }
1043}
1044
1045#endif
1046// __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: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
Allows for iteration through the members of a dictionary pref, a la std::vector iteration.
Definition: hdicoreDictionaryPref.h:76
~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.
Acts as a dictionary-style container to store any other persistent data types, including arrays and d...
Definition: hdicoreDictionaryPref.h:60
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 bool getOrCreateStrokeStyleMember(const std::string &key_, const StrokeStyle &default_, StrokeStylePref &ss__)
Similar to getStrokeStyleMember(), except that, if the member does not already exist,...
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
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.