7#ifndef __HDI_CORE_PREFERENCES__
8#define __HDI_CORE_PREFERENCES__
17 #if defined(HDI_CORE_AIP_MODE)
22 #elif defined(HDI_CORE_PSP_MODE)
49 #if defined(HDI_CORE_AIP_MODE)
53 class TransformMatrix;
55 class ArtboardPointPref;
56 class ArtboardRectPref;
59 class DashStyleMapPref;
61 class FillStyleMapPref;
63 class PathStyleMapPref;
64 class StrokeStylePref;
65 class StrokeStyleMapPref;
66 class TransformMatrixPref;
76 typedef std::vector< std::shared_ptr<PrefData> > PrefDataVector;
201 std::unique_ptr<PrefData>
value()
const;
230 typedef std::unique_ptr<Iterator> IteratorUP;
231 typedef std::shared_ptr<Iterator> IteratorSP;
232 typedef std::weak_ptr<Iterator> IteratorWP;
312 virtual bool reload(
const std::string& path_);
322 virtual bool save(
const std::string& path_)
const;
359 virtual bool getPref(
const std::string& key_, std::unique_ptr<PrefData>& pref__)
const;
417 const std::string& key_,
418 const PrefDataVector* elements_,
422 #if defined(HDI_CORE_AIP_MODE)
448 const std::string& key_,
478 const std::string& key_,
508 const std::string& key_,
567 #if defined(HDI_CORE_AIP_MODE)
594 const std::string& key_,
625 const std::string& key_,
662 const std::string& key_,
663 const PrefDataVector* members_,
667 #if defined(HDI_CORE_AIP_MODE)
694 const std::string& key_,
725 const std::string& key_,
758 const std::string& key_,
759 const Font& defaultFont_,
760 const double defaultSize_,
764 #if defined(HDI_CORE_AIP_MODE)
790 const std::string& key_,
837 #if defined(HDI_CORE_AIP_MODE)
864 const std::string& key_,
895 const std::string& key_,
1005 const std::string& key_,
1006 const std::string& default_,
1010 #if defined(HDI_CORE_AIP_MODE)
1037 const std::string& key_,
1068 const std::string& key_,
1120 #if defined(HDI_CORE_AIP_MODE)
1127 #elif defined(HDI_CORE_PSP_MODE)
1137 typedef std::unique_ptr<Preferences> PreferencesUP;
1138 typedef std::shared_ptr<Preferences> PreferencesSP;
1139 typedef std::weak_ptr<Preferences> PreferencesWP;
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
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
Allows for iteration through the members of a Preferences object, a la std::vector iteration.
Definition: hdicorePreferences.h:90
~Iterator()
Destructs an Iterator object.
Iterator operator--(int)
Postfix decrement operator for reverse iteration.
bool atEnd() const
Determines whether iteration should stop; works well as the conditional in a for() loop.
Iterator operator++(int)
Postfix increment operator for forward iteration.
Iterator & operator--()
Prefix decrement operator for reverse iteration.
Iterator & operator=(const Iterator &rhs_)
Assigns one Iterator object to another.
bool operator!=(const Iterator &rhs_) const
Tests whether a given Iterator object is not the same as another.
bool operator==(const Iterator &rhs_) const
Tests whether a given Iterator object is the same as another.
std::string key() const
Gets the current member's key as pointed to by the iterator.
Iterator & operator++()
Prefix increment operator for forward iteration.
Iterator(const Iterator &iter_)
Constructs an Iterator object from an existing Iterator object (copy constructor)
std::unique_ptr< PrefData > value() const
Gets the current member's value as pointed to by the iterator.
Aids in preference storage by reading/writing the JSON data in a given file.
Definition: hdicorePreferences.h:74
virtual bool getOrCreateFillStylePref(const std::string &key_, const FillStyle &default_, FillStylePref &fs__)
Similar to getFillStylePref(), except that, if the member does not already exist, it will be created ...
virtual uint64_t saveCount() const
Gets the save count of the prefs file.
Preferences()
Constructs an empty Preferences object.
virtual bool getStrokeStylePref(const std::string &key_, StrokeStylePref &ss__)
Gets a persistent stroke style object from the prefs data tree.
virtual bool getOrCreateArtboardPointPref(const std::string &key_, const ArtboardPoint &default_, ArtboardPointPref &abp__)
Similar to getArtboardPointPref(), except that, if the pref does not already exist,...
virtual bool getFontPref(const std::string &key_, FontPref &font__) const
Gets a font pref from the prefs data tree.
virtual bool getOrCreatePointPref(const std::string &key_, const Point &default_, PointPref &p__)
Similar to getPointPref(), except that, if the pref does not already exist, it will be created anew w...
virtual bool getArtboardRectPref(const std::string &key_, ArtboardRectPref &abr__) const
Gets an artboard rect pref from the prefs data tree.
virtual bool getOrCreatePathStylePref(const std::string &key_, const PathStyle &default_, PathStylePref &ps__)
Similar to getPathStylePref(), except that, if the member does not already exist, it will be created ...
virtual bool getOrCreateArtColorPref(const std::string &key_, const ArtColor &default_, ArtColorPref &ac__)
Similar to getArtColorPref(), except that, if the pref does not already exist, it will be created ane...
virtual bool getOrCreateTransformMatrixPref(const std::string &key_, const TransformMatrix &default_, TransformMatrixPref &tm__)
Similar to getTransformMatrixPref(), except that, if the pref does not already exist,...
virtual bool getDictPref(const std::string &key_, DictionaryPref &dict__) const
Gets a dictionary pref from the prefs data tree.
virtual bool getTransformMatrixPref(const std::string &key_, TransformMatrixPref &tm__) const
Gets a transform matrix pref from the prefs data tree.
virtual bool getOrCreateDictPref(const std::string &key_, const PrefDataVector *members_, DictionaryPref &dict__)
Similar to getDictPref(), except that, if the pref does not already exist, it will be created anew wi...
virtual bool getOrCreateRectPref(const std::string &key_, const Rect &default_, RectPref &r__)
Similar to getRectPref(), except that, if the pref does not already exist, it will be created anew wi...
virtual bool getStringPref(const std::string &key_, StringPref &str__) const
Gets a string pref from the prefs data tree.
virtual bool getOrCreateFloatPref(const std::string &key_, const double default_, NumberPref &n__)
Similar to getNumberPref(), except that, if the pref does not already exist, it will be created anew ...
virtual bool isEmpty() const
Gets whether the target Preferences object is empty (constructed with the default ctor)
virtual bool getSizePref(const std::string &key_, SizePref &s__) const
Gets a size pref from the prefs data tree.
virtual bool getOrCreateSizePref(const std::string &key_, const Size &default_, SizePref &s__)
Similar to getSizePref(), except that, if the pref does not already exist, it will be created anew wi...
virtual bool getArtColorPref(const std::string &key_, ArtColorPref &ac__) const
Gets an art color pref from the prefs data tree.
virtual bool getNumberPref(const std::string &key_, NumberPref &n__) const
Gets a number pref from the prefs data tree.
virtual bool getOrCreateFillStyleMapPref(const std::string &key_, const FillStyle::Map &default_, FillStyleMapPref &fs__)
Similar to getFillStyleMapPref(), except that, if the member does not already exist,...
virtual bool getFillStyleMapPref(const std::string &key_, FillStyleMapPref &fs__)
Gets a persistent fill style map object from the prefs data tree.
virtual bool getOrCreateDashStylePref(const std::string &key_, const DashStyle &default_, DashStylePref &ds__)
Similar to getDashStylePref(), except that, if the member does not already exist, it will be created ...
virtual bool getPathStylePref(const std::string &key_, PathStylePref &ps__)
Gets a persistent path style object from the prefs data tree.
virtual std::string versionString() const
Gets the version string for the preferences data.
virtual bool setVersionString(const std::string &version_)
Sets the version string for the preferences data.
Preferences(const aip::Preferences &)
Internal use only.
virtual bool getOrCreatePathStyleMapPref(const std::string &key_, const PathStyle::Map &default_, PathStyleMapPref &ps__)
Similar to getPathStyleMapPref(), except that, if the member does not already exist,...
virtual bool getColorPref(const std::string &key_, ColorPref &c__) const
Gets a color pref from the prefs data tree.
virtual bool getOrCreateStringPref(const std::string &key_, const std::string &default_, StringPref &str__)
Similar to getStringPref(), except that, if the pref does not already exist, it will be created anew ...
virtual Iterator begin() const
Gets an iterator for the Preferences object.
virtual bool getPref(const std::string &key_, std::unique_ptr< PrefData > &pref__) const
Gets a single preference object from the prefs data tree.
virtual bool getPointPref(const std::string &key_, PointPref &p__) const
Gets a point pref from the prefs data tree.
virtual bool getOrCreateFontPref(const std::string &key_, const Font &defaultFont_, const double defaultSize_, FontPref &font__)
Similar to getFontPref(), except that, if the pref does not already exist, it will be created anew wi...
virtual bool getBoolPref(const std::string &key_, BoolPref &b__) const
Gets a bool pref from the prefs data tree.
virtual bool addPref(const PrefData &pref_)
Adds a preference object into the prefs data tree, such that when the prefs are written the individua...
virtual bool getDashStyleMapPref(const std::string &key_, DashStyleMapPref &ds__)
Gets a persistent dash style map object from the prefs data tree.
virtual bool save(const std::string &path_) const
Writes JSON preferences data to a file.
Preferences(const Preferences &prefs_)
Constructs a new Preferences object from an existing Preferences object (copy constructor)
virtual bool setVersionNumber(const int32_t version_)
Sets the number version for the preferences data.
virtual bool getArtboardPointPref(const std::string &key_, ArtboardPointPref &abp__) const
Gets an artboard point pref from the prefs data tree.
virtual bool getFillStylePref(const std::string &key_, FillStylePref &fs__)
Gets a persistent fill style object from the prefs data tree.
virtual bool getRectPref(const std::string &key_, RectPref &r__) const
Gets a rect pref from the prefs data tree.
virtual bool removePref(const PrefData &pref_)
Removes a preference from the prefs data tree.
virtual bool getOrCreateStrokeStyleMapPref(const std::string &key_, const StrokeStyle::Map &default_, StrokeStyleMapPref &ss__)
Similar to getStrokeStyleMapPref(), except that, if the member does not already exist,...
static bool load(const std::string &path_, Preferences &prefs__)
Convenience method to create a Preferences object from JSON data in a file.
virtual bool getPathStyleMapPref(const std::string &key_, PathStyleMapPref &ps__)
Gets a persistent path style map object from the prefs data tree.
virtual bool getOrCreateBoolPref(const std::string &key_, const bool default_, BoolPref &b__)
Similar to getBoolPref(), except that, if the pref does not already exist, it will be created anew wi...
virtual bool getOrCreateArtboardRectPref(const std::string &key_, const ArtboardRect &default_, ArtboardRectPref &abr__)
Similar to getArtboardRectPref(), except that, if the pref does not already exist,...
void * __data
Private implementation data.
Definition: hdicorePreferences.h:1118
virtual bool getDashStylePref(const std::string &key_, DashStylePref &ds__)
Gets a persistent dash style object from the prefs data tree.
virtual int32_t versionNumber() const
Gets the number version for the preferences data.
virtual bool getArrayPref(const std::string &key_, ArrayPref &array__) const
Gets an array pref from the prefs data tree.
virtual bool getOrCreateColorPref(const std::string &key_, const Color &default_, ColorPref &c__)
Similar to getColorPref(), except that, if the pref does not already exist, it will be created anew w...
virtual ~Preferences()
Destructs a Preferences object.
virtual bool getStrokeStyleMapPref(const std::string &key_, StrokeStyleMapPref &ss__)
Gets a persistent stroke style map object from the prefs data tree.
virtual bool getOrCreateDashStyleMapPref(const std::string &key_, const DashStyle::Map &default_, DashStyleMapPref &ds__)
Similar to getDashStyleMapPref(), except that, if the member does not already exist,...
virtual bool getOrCreateStrokeStylePref(const std::string &key_, const StrokeStyle &default_, StrokeStylePref &ss__)
Similar to getStrokeStylePref(), except that, if the member does not already exist,...
virtual bool getOrCreateIntPref(const std::string &key_, const int64_t default_, NumberPref &n__)
Similar to getNumberPref(), except that, if the pref does not already exist, it will be created anew ...
virtual Preferences & operator=(const Preferences &rhs_)
Assigns one Preferences object to another.
virtual bool getOrCreateArrayPref(const std::string &key_, const PrefDataVector *elements_, ArrayPref &array__)
Similar to getArrayPref(), except that, if the pref does not already exist, it will be created anew w...
virtual bool reload(const std::string &path_)
Reloads the preferences data from disk (as it is kept in memory at runtime, this might be necessary i...
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
Header file for path style-related classes.