Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicorePrefData.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_PREF_DATA__
8 #define __HDI_CORE_PREF_DATA__
9 
10 #include "hdicoreTypes.h"
11 
12 namespace hdi
13 {
14  namespace plugin
15  {
16  class PersistentData;
17  }
18 
19  namespace core
20  {
24  class PrefData
25  {
26  public:
31  enum Type
32  {
33  UnknownType = 0,
34 
35  ArrayType = 10,
36  ArtboardPointType = 20,
37  ArtboardRectType = 30,
38  ArtColorType = 40,
39  BoolType = 50,
40  ColorType = 60,
41  DashStyleType = 70,
42  DashStyleMapType = 80,
43  DictionaryType = 90,
44  FillStyleType = 100,
45  FillStyleMapType = 110,
46  FontType = 120,
47  NumberType = 130,
48  PathType = 140, // Reserved for future use
49  PathStyleType = 150,
50  PathStyleMapType = 160,
51  PointType = 170,
52  RectType = 180,
53  SizeType = 190,
54  StringType = 200,
55  StrokeStyleType = 210,
56  StrokeStyleMapType = 220,
57  TransformMatrixType = 230,
58 
59  CustomTypeOffset = 10000
60  };
61 
72  PrefData();
73 
83  PrefData(const PrefData& data_);
84 
95  static std::auto_ptr<PrefData> parse(const std::string& jsonStr_);
96 
102  virtual ~PrefData();
103 
115  virtual PrefData& operator=(const PrefData& rhs_);
116 
127  virtual PrefData* clone() const = 0;
128 
136  virtual bool isEmpty() const;
137 
150  virtual bool operator==(const PrefData& rhs_) const;
151 
164  virtual bool operator!=(const PrefData& rhs_) const;
165 
175  virtual Type dataType() const;
176 
187  virtual std::string key() const;
188 
199  virtual void setKey(const std::string& key_);
200 
212  virtual std::string stringify() const;
213 
214 
215  protected:
216  friend plugin::PersistentData* __accessImpl(const PrefData&);
217  friend PrefData* __accessCtor(plugin::PersistentData*&);
218 
222  void* _data;
223 
229  void* __impl() const;
230 
236  PrefData(plugin::PersistentData*&);
237  };
238 
239  typedef std::auto_ptr<PrefData> PrefDataAP;
240 
241  extern plugin::PersistentData* __accessImpl(const PrefData&);
242  extern PrefData* __accessCtor(plugin::PersistentData*&);
243  }
244 }
245 
246 #endif
247 // __HDI_CORE_PREF_DATA__
virtual PrefData & operator=(const PrefData &rhs_)
Allows one PrefData object to be assigned from another.
virtual std::string key() const
Gets the persistent data object's key.
virtual bool isEmpty() const
Gets whether the target PrefData object is empty (constructed with the default ctor) ...
virtual bool operator!=(const PrefData &rhs_) const
Tests whether a given PrefData object is not the same as another.
virtual ~PrefData()
Destructs a PrefData object.
void * _data
Private implementation data.
Definition: hdicorePrefData.h:222
virtual Type dataType() const
Gets the type of persistent data.
virtual bool operator==(const PrefData &rhs_) const
Tests whether a given PrefData object is the same as another.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
static std::auto_ptr< PrefData > parse(const std::string &jsonStr_)
Parses the given JSON string to a best-fit representation of PrefData subclass objects in a tree...
Base class for persistent data objects, stored via JSON.
Definition: hdicorePrefData.h:24
Definition: hdicoreaiArray.h:12
Type
Describes the type of the data the PrefData object contains; useful for determining which subclass to...
Definition: hdicorePrefData.h:31
virtual std::string stringify() const
Recursively serializes the target object as a JSON data (sub)tree, returning the appropriate JSON str...
PrefData()
Constructs an empty PrefData object.
virtual void setKey(const std::string &key_)
Sets the persistent data object's key.
virtual PrefData * clone() const =0
Convenience method to clone a PrefData object, taking its subclass type into account for proper memor...
void * __impl() const
Internal use only.