Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
hdi::core::NumberPref Class Reference

Allows for the storage of numbers. More...

#include <hdicoreNumberPref.h>

Inheritance diagram for hdi::core::NumberPref:
Inheritance graph
[legend]
Collaboration diagram for hdi::core::NumberPref:
Collaboration graph
[legend]

Public Member Functions

 NumberPref ()
 Constructs an empty NumberPref object.
 
 NumberPref (const NumberPref &n_)
 Constructs a new NumberPref object from an existing NumberPref object (copy constructor)
 
 NumberPref (const int64_t value_, const std::string &name_="")
 Constructs a NumberPref object, with new data, to be added to a container at a later time.
 
 NumberPref (const double value_, const std::string &name_="")
 Constructs a NumberPref object, with new data, to be added to a container at a later time.
 
virtual ~NumberPref ()
 Destructs a NumberPref object.
 
virtual NumberPrefoperator= (const NumberPref &rhs_)
 Allows one NumberPref object to be assigned from another.
 
virtual NumberPrefclone () const
 Convenience method to clone an NumberPref object on the heap.
 
virtual int64_t intValue () const
 Gets the integer value for this object.
 
virtual bool setIntValue (const int64_t value_)
 Sets the integer value for this object.
 
virtual double floatValue () const
 Gets the floating point value for this object.
 
virtual bool setFloatValue (double value_)
 Sets the floating point value for this object.
 
- Public Member Functions inherited from hdi::core::PrefData
 PrefData ()
 Constructs an empty PrefData object.
 
virtual ~PrefData ()
 Destructs a PrefData object.
 
virtual PrefDataoperator= (const PrefData &rhs_)
 Allows one PrefData object to be assigned from another.
 
virtual PrefDataclone () const =0
 Convenience method to clone a PrefData object, taking its subclass type into account for proper memory management.
 
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 the same as another.
 
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.
 
virtual std::string key () const
 Gets the persistent data object's key.
 
virtual void setKey (const std::string &key_)
 Sets the persistent data object's key.
 
virtual std::string stringify () const
 Recursively serializes the target object as a JSON data (sub)tree, returning the appropriate JSON string.
 

Additional Inherited Members

- Public Types inherited from hdi::core::PrefData
enum  Type {
  UnknownType = 0 , ArrayType = 10 , ArtboardPointType = 20 , ArtboardRectType = 30 ,
  ArtColorType = 40 , BoolType = 50 , ColorType = 60 , DashStyleType = 70 ,
  DashStyleMapType = 80 , DictionaryType = 90 , FillStyleType = 100 , FillStyleMapType = 110 ,
  FontType = 120 , NumberType = 130 , PathType = 140 , PathStyleType = 150 ,
  PathStyleMapType = 160 , PointType = 170 , RectType = 180 , SizeType = 190 ,
  StringType = 200 , StrokeStyleType = 210 , StrokeStyleMapType = 220 , TransformMatrixType = 230 ,
  CustomTypeOffset = 10000
}
 Describes the type of the data the PrefData object contains; useful for determining which subclass to cast a PrefData object to.
 
- Static Public Member Functions inherited from hdi::core::PrefData
static std::unique_ptr< PrefDataparse (const std::string &jsonStr_)
 Parses the given JSON string to a best-fit representation of PrefData subclass objects in a tree.
 
- Protected Member Functions inherited from hdi::core::PrefData
void * __impl () const
 Internal use only.
 
 PrefData (plat::PersistentData *&)
 Internal use only.
 
 PrefData (const PrefData &data_)
 Constructs a new PrefData object from an existing PrefData object (copy constructor)
 
- Protected Attributes inherited from hdi::core::PrefData
void * _data
 Private implementation data.
 

Detailed Description

Allows for the storage of numbers.

Constructor & Destructor Documentation

◆ NumberPref() [1/4]

hdi::core::NumberPref::NumberPref ( )

Constructs an empty NumberPref object.

Author
GW
Date
09/2013
Note
To test if a NumberPref object is empty, call isEmpty() on it
Empty NumberPref objects do not relate to any actual preference data; they are designed to be "receivers" of some other NumberPref object via the overloaded assignment operator. Empty NumberPref objects are useless until such time (though it is safe to call any of their methods)

◆ NumberPref() [2/4]

hdi::core::NumberPref::NumberPref ( const NumberPref n_)

Constructs a new NumberPref object from an existing NumberPref object (copy constructor)

Author
GW
Date
09/2013
Parameters
n_Existing NumberPref object

◆ NumberPref() [3/4]

hdi::core::NumberPref::NumberPref ( const int64_t  value_,
const std::string &  name_ = "" 
)
explicit

Constructs a NumberPref object, with new data, to be added to a container at a later time.

Author
GW
Date
09/2013
Parameters
value_Initial integer value
name_Name for the data once it has been added to its container, as UTF-8
Note
The name_ argument can only be "" (omitted) if the object will be added directly to an ArrayPref object.

◆ NumberPref() [4/4]

hdi::core::NumberPref::NumberPref ( const double  value_,
const std::string &  name_ = "" 
)
explicit

Constructs a NumberPref object, with new data, to be added to a container at a later time.

Author
GW
Date
09/2013
Parameters
value_Initial double value
name_Name for the data once it has been added to its container, as UTF-8
Note
The name_ argument can only be "" (omitted) if the object will be added directly to an ArrayPref object.

◆ ~NumberPref()

virtual hdi::core::NumberPref::~NumberPref ( )
virtual

Destructs a NumberPref object.

Author
GW
Date
09/2013

Member Function Documentation

◆ clone()

virtual NumberPref * hdi::core::NumberPref::clone ( ) const
virtual

Convenience method to clone an NumberPref object on the heap.

Author
GW
Date
10/2013
Returns
A pointer to the new NumberPref object
Note
If you subclass NumberPref, you MUST overload this method yourself! If you don't and/or your clone() method does not return an instance of your NumberPref subclass, you will experience "object slicing" when adding the pref to a container.
Warning
The caller must manage the memory for the returned NumberPref object.

Implements hdi::core::PrefData.

◆ floatValue()

virtual double hdi::core::NumberPref::floatValue ( ) const
virtual

Gets the floating point value for this object.

Author
GW
Date
09/2013
Returns
The double value being described by this wrapper

◆ intValue()

virtual int64_t hdi::core::NumberPref::intValue ( ) const
virtual

Gets the integer value for this object.

Author
GW
Date
09/2013
Returns
The integer value being described by this wrapper

◆ operator=()

virtual NumberPref & hdi::core::NumberPref::operator= ( const NumberPref rhs_)
virtual

Allows one NumberPref object to be assigned from another.

Author
GW
Date
09/2013
Parameters
rhs_Righthand side of the = operator; the object to copy values from
Returns
The target NumberPref object, but with its value updated to match that of rhs_

◆ setFloatValue()

virtual bool hdi::core::NumberPref::setFloatValue ( double  value_)
virtual

Sets the floating point value for this object.

Author
GW
Date
09/2013
Parameters
value_New double value
Returns
true if the number is successfully updated, or false otherwise

◆ setIntValue()

virtual bool hdi::core::NumberPref::setIntValue ( const int64_t  value_)
virtual

Sets the integer value for this object.

Author
GW
Date
09/2013
Parameters
value_New integer value
Returns
true if the number is successfully updated, or false otherwise