Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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
12namespace hdi
13{
14 namespace plat
15 {
16 class PersistentData;
17 }
18
19 namespace core
20 {
25 {
26 public:
31 enum Type
32 {
33 UnknownType = 0,
34
35 ArrayType = 10,
36
37 #if defined(HDI_CORE_AIP_MODE)
38 ArtboardPointType = 20,
39 ArtboardRectType = 30,
40 ArtColorType = 40,
41 #endif
42
43 BoolType = 50,
44 ColorType = 60,
45
46 #if defined(HDI_CORE_AIP_MODE)
47 DashStyleType = 70,
48 DashStyleMapType = 80,
49 #endif
50
51 DictionaryType = 90,
52
53 #if defined(HDI_CORE_AIP_MODE)
54 FillStyleType = 100,
55 FillStyleMapType = 110,
56 #endif
57
58 FontType = 120,
59 NumberType = 130,
60
61 #if defined(HDI_CORE_AIP_MODE)
62 PathType = 140, // Reserved for future use
63 PathStyleType = 150,
64 PathStyleMapType = 160,
65 #endif
66
67 PointType = 170,
68 RectType = 180,
69 SizeType = 190,
70 StringType = 200,
71
72 #if defined(HDI_CORE_AIP_MODE)
73 StrokeStyleType = 210,
74 StrokeStyleMapType = 220,
75 TransformMatrixType = 230,
76 #endif
77
78 CustomTypeOffset = 10000
79 };
80
92
103 static std::unique_ptr<PrefData> parse(const std::string& jsonStr_);
104
110 virtual ~PrefData();
111
123 virtual PrefData& operator=(const PrefData& rhs_);
124
135 virtual PrefData* clone() const = 0;
136
144 virtual bool isEmpty() const;
145
158 virtual bool operator==(const PrefData& rhs_) const;
159
172 virtual bool operator!=(const PrefData& rhs_) const;
173
183 virtual Type dataType() const;
184
195 virtual std::string key() const;
196
207 virtual void setKey(const std::string& key_);
208
220 virtual std::string stringify() const;
221
222
223 protected:
224 friend plat::PersistentData* __accessImpl(const PrefData&);
225 friend PrefData* __accessCtor(plat::PersistentData*&);
226
230 void* _data;
231
237 void* __impl() const;
238
244 PrefData(plat::PersistentData*&);
245
253 PrefData(const PrefData& data_);
254 };
255
256 typedef std::unique_ptr<PrefData> PrefDataUP;
257 typedef std::shared_ptr<PrefData> PrefDataSP;
258 typedef std::weak_ptr<PrefData> PrefDataWP;
259
260 extern plat::PersistentData* __accessImpl(const PrefData&);
261 extern PrefData* __accessCtor(plat::PersistentData*&);
262 }
263}
264
265#endif
266// __HDI_CORE_PREF_DATA__
Base class for persistent data objects, stored via JSON.
Definition: hdicorePrefData.h:25
virtual ~PrefData()
Destructs a PrefData object.
Type
Describes the type of the data the PrefData object contains; useful for determining which subclass to...
Definition: hdicorePrefData.h:32
virtual std::string key() const
Gets the persistent data object's key.
PrefData(const PrefData &data_)
Constructs a new PrefData object from an existing PrefData object (copy constructor)
virtual PrefData * clone() const =0
Convenience method to clone a PrefData object, taking its subclass type into account for proper memor...
virtual std::string stringify() const
Recursively serializes the target object as a JSON data (sub)tree, returning the appropriate JSON str...
void * __impl() const
Internal use only.
PrefData()
Constructs an empty PrefData object.
virtual PrefData & operator=(const PrefData &rhs_)
Allows one PrefData object to be assigned from another.
virtual void setKey(const std::string &key_)
Sets the persistent data object's key.
virtual bool operator==(const PrefData &rhs_) const
Tests whether a given PrefData object is the same as another.
virtual bool isEmpty() const
Gets whether the target PrefData object is empty (constructed with the default ctor)
static std::unique_ptr< PrefData > parse(const std::string &jsonStr_)
Parses the given JSON string to a best-fit representation of PrefData subclass objects in a tree.
PrefData(plat::PersistentData *&)
Internal use only.
void * _data
Private implementation data.
Definition: hdicorePrefData.h:230
virtual bool operator!=(const PrefData &rhs_) const
Tests whether a given PrefData object is not the same as another.
virtual Type dataType() const
Gets the type of persistent data.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.