Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicorePreferences.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_PREFERENCES__
8 #define __HDI_CORE_PREFERENCES__
9 
10 #include <vector>
11 
12 #include "hdicorePathStyle.h"
13 
14 namespace hdi
15 {
16  namespace plugin
17  {
18  class Preferences;
19  }
20 
21  namespace core
22  {
23  class ArtboardPoint;
24  class ArtboardRect;
25  class ArtColor;
26  class Color;
27  class Font;
28  class Point;
29  class Rect;
30  class Size;
31  class TransformMatrix;
32 
33  class PrefData;
34  class ArrayPref;
35  class ArtboardPointPref;
36  class ArtboardRectPref;
37  class ArtColorPref;
38  class BoolPref;
39  class ColorPref;
40  class DashStylePref;
41  class DashStyleMapPref;
42  class DictionaryPref;
43  class FillStylePref;
44  class FillStyleMapPref;
45  class FontPref;
46  class NumberPref;
47  class PathStylePref;
48  class PathStyleMapPref;
49  class PointPref;
50  class RectPref;
51  class SizePref;
52  class StringPref;
53  class StrokeStylePref;
54  class StrokeStyleMapPref;
55  class TransformMatrixPref;
56 
61  {
62  public:
63  typedef std::vector< PrefData* > PrefDataVector;
64 
76  Preferences();
77 
85  Preferences(const Preferences& prefs_);
86 
92  virtual ~Preferences();
93 
103  virtual Preferences& operator=(const Preferences& rhs_);
104 
112  virtual bool isEmpty() const;
113 
126  static bool load(const std::string& path_, Preferences& prefs__);
127 
143  virtual bool reload(const std::string& path_);
144 
153  virtual bool save(const std::string& path_) const;
154 
162  virtual uint64_t saveCount() const;
163 
176  virtual bool addPref(const PrefData& pref_);
177 
190  virtual bool getPref(const std::string& key_, std::auto_ptr<PrefData>& pref__) const;
191 
200  virtual bool removePref(const PrefData& pref_);
201 
212  virtual bool getArrayPref(const std::string& key_, ArrayPref& array__) const;
213 
233  virtual bool getOrCreateArrayPref(
234  const std::string& key_,
235  const PrefDataVector* elements_,
236  ArrayPref& array__
237  );
238 
249  virtual bool getArtboardPointPref(const std::string& key_, ArtboardPointPref& abp__) const;
250 
263  virtual bool getOrCreateArtboardPointPref(
264  const std::string& key_,
265  const ArtboardPoint& default_,
266  ArtboardPointPref& abp__
267  );
268 
279  virtual bool getArtboardRectPref(const std::string& key_, ArtboardRectPref& abr__) const;
280 
293  virtual bool getOrCreateArtboardRectPref(
294  const std::string& key_,
295  const ArtboardRect& default_,
296  ArtboardRectPref& abr__
297  );
298 
309  virtual bool getArtColorPref(const std::string& key_, ArtColorPref& ac__) const;
310 
323  virtual bool getOrCreateArtColorPref(
324  const std::string& key_,
325  const ArtColor& default_,
326  ArtColorPref& ac__
327  );
328 
339  virtual bool getBoolPref(const std::string& key_, BoolPref& b__) const;
340 
353  virtual bool getOrCreateBoolPref(const std::string& key_, const bool default_, BoolPref& b__);
354 
365  virtual bool getColorPref(const std::string& key_, ColorPref& c__) const;
366 
379  virtual bool getOrCreateColorPref(const std::string& key_, const Color& default_, ColorPref& c__);
380 
391  virtual bool getDashStylePref(const std::string& key_, DashStylePref& ds__);
392 
406  virtual bool getOrCreateDashStylePref(
407  const std::string& key_,
408  const DashStyle& default_,
409  DashStylePref& ds__
410  );
411 
422  virtual bool getDashStyleMapPref(const std::string& key_, DashStyleMapPref& ds__);
423 
437  virtual bool getOrCreateDashStyleMapPref(
438  const std::string& key_,
439  const DashStyle::Map& default_,
440  DashStyleMapPref& ds__
441  );
442 
453  virtual bool getDictPref(const std::string& key_, DictionaryPref& dict__) const;
454 
475  virtual bool getOrCreateDictPref(
476  const std::string& key_,
477  const PrefDataVector* members_,
478  DictionaryPref& dict__
479  );
480 
491  virtual bool getFillStylePref(const std::string& key_, FillStylePref& fs__);
492 
506  virtual bool getOrCreateFillStylePref(
507  const std::string& key_,
508  const FillStyle& default_,
509  FillStylePref& fs__
510  );
511 
522  virtual bool getFillStyleMapPref(const std::string& key_, FillStyleMapPref& fs__);
523 
537  virtual bool getOrCreateFillStyleMapPref(
538  const std::string& key_,
539  const FillStyle::Map& default_,
540  FillStyleMapPref& fs__
541  );
542 
553  virtual bool getFontPref(const std::string& key_, FontPref& font__) const;
554 
568  virtual bool getOrCreateFontPref(
569  const std::string& key_,
570  const Font& defaultFont_,
571  const double defaultSize_,
572  FontPref& font__
573  );
574 
585  virtual bool getTransformMatrixPref(const std::string& key_, TransformMatrixPref& tm__) const;
586 
599  virtual bool getOrCreateTransformMatrixPref(
600  const std::string& key_,
601  const TransformMatrix& default_,
602  TransformMatrixPref& tm__
603  );
604 
615  virtual bool getNumberPref(const std::string& key_, NumberPref& n__) const;
616 
629  virtual bool getOrCreateIntPref(const std::string& key_, const int64_t default_, NumberPref& n__);
630 
643  virtual bool getOrCreateFloatPref(const std::string& key_, const double default_, NumberPref& n__);
644 
655  virtual bool getPathStylePref(const std::string& key_, PathStylePref& ps__);
656 
670  virtual bool getOrCreatePathStylePref(
671  const std::string& key_,
672  const PathStyle& default_,
673  PathStylePref& ps__
674  );
675 
686  virtual bool getPathStyleMapPref(const std::string& key_, PathStyleMapPref& ps__);
687 
701  virtual bool getOrCreatePathStyleMapPref(
702  const std::string& key_,
703  const PathStyle::Map& default_,
704  PathStyleMapPref& ps__
705  );
706 
717  virtual bool getPointPref(const std::string& key_, PointPref& p__) const;
718 
731  virtual bool getOrCreatePointPref(const std::string& key_, const Point& default_, PointPref& p__);
732 
743  virtual bool getRectPref(const std::string& key_, RectPref& r__) const;
744 
757  virtual bool getOrCreateRectPref(const std::string& key_, const Rect& default_, RectPref& r__);
758 
769  virtual bool getSizePref(const std::string& key_, SizePref& s__) const;
770 
783  virtual bool getOrCreateSizePref(const std::string& key_, const Size& default_, SizePref& s__);
784 
795  virtual bool getStringPref(const std::string& key_, StringPref& str__) const;
796 
809  virtual bool getOrCreateStringPref(
810  const std::string& key_,
811  const std::string& default_,
812  StringPref& str__
813  );
814 
825  virtual bool getStrokeStylePref(const std::string& key_, StrokeStylePref& ss__);
826 
840  virtual bool getOrCreateStrokeStylePref(
841  const std::string& key_,
842  const StrokeStyle& default_,
843  StrokeStylePref& ss__
844  );
845 
856  virtual bool getStrokeStyleMapPref(const std::string& key_, StrokeStyleMapPref& ss__);
857 
871  virtual bool getOrCreateStrokeStyleMapPref(
872  const std::string& key_,
873  const StrokeStyle::Map& default_,
874  StrokeStyleMapPref& ss__
875  );
876 
884  virtual int32_t versionNumber() const;
885 
894  virtual bool setVersionNumber(const int32_t version_);
895 
903  virtual std::string versionString() const;
904 
913  virtual bool setVersionString(const std::string& version_);
914 
915 
916  protected:
920  void* __data;
921 
927  Preferences(const plugin::Preferences&);
928  };
929 
930  typedef std::auto_ptr<Preferences> PreferencesAP;
931  }
932 }
933 
934 #endif
935 // __HDI_CORE_PREFERENCES__
Allows for storage of path style maps.
Definition: hdicorePathStyleMapPref.h:20
Acts as a DashStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:30
std::string versionString()
Gets the version of the hdi_core library as a string.
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:24
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
Allows for storage of font faces and sizes.
Definition: hdicoreFontPref.h:21
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
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
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
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
Allows for 2-dimensional transformations in a single application via matrix math. ...
Definition: hdicoreTransformMatrix.h:26
Aids in preference storage by reading/writing the JSON data in a given file.
Definition: hdicorePreferences.h:60
Allows for storage of fill style maps.
Definition: hdicoreFillStyleMapPref.h:25
Allows for storage of stroke style maps.
Definition: hdicoreStrokeStyleMapPref.h:25
Allows for storage of fill styles.
Definition: hdicoreFillStylePref.h:25
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
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
void * __data
Private implementation data.
Definition: hdicorePreferences.h:920
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
Allows for storage of dash styles.
Definition: hdicoreDashStylePref.h:25
Definition: hdicoreaiArray.h:12
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
Allows for storage of 2D artboard points.
Definition: hdicoreArtboardPointPref.h:20
Describes the dash styling of a path.
Definition: hdicorePathStyle.h:19
Allows for the storage of numbers.
Definition: hdicoreNumberPref.h:19
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28
Describes the fill styling of a path.
Definition: hdicorePathStyle.h:140
Describes the color of art on the artboard.
Definition: hdicoreArtColor.h:32
Allows for storage of path styles.
Definition: hdicorePathStylePref.h:20