GluonCore::MetaInfo Class Reference

#include <metainfo.h>

Inheritance diagram for GluonCore::MetaInfo:
QObject

List of all members.

Classes

class  MetaInfoPrivate

Public Member Functions

 MetaInfo (GluonObject *parent)
 MetaInfo (const MetaInfo &other)
 ~MetaInfo ()
Q_INVOKABLE void setPropertyRange (const QString &property, qreal min, qreal max)
Q_INVOKABLE bool hasPropertyRange (const QString &property) const
Q_INVOKABLE qreal propertyRangeMin (const QString &property) const
Q_INVOKABLE qreal propertyRangeMax (const QString &property) const
Q_INVOKABLE void removePropertyRange (const QString &property)
Q_INVOKABLE qreal applyRange (const QString &property, qreal newValue) const
Q_INVOKABLE void setPropertySteps (const QString &property, quint32 steps)
Q_INVOKABLE bool hasPropertySteps (const QString &property) const
Q_INVOKABLE quint32 propertySteps (const QString &property) const
Q_INVOKABLE void removePropertySteps (const QString &property)
Q_INVOKABLE qreal applySteps (const QString &property, qreal newValue) const
Q_INVOKABLE qreal applyRangeAndStep (const QString &property, qreal newValue) const

Detailed Description

Definition at line 28 of file metainfo.h.


Constructor & Destructor Documentation

MetaInfo::MetaInfo ( GluonObject parent  ) 

Definition at line 36 of file metainfo.cpp.

MetaInfo::MetaInfo ( const MetaInfo other  ) 

Definition at line 42 of file metainfo.cpp.

MetaInfo::~MetaInfo (  ) 

Definition at line 47 of file metainfo.cpp.


Member Function Documentation

qreal MetaInfo::applyRange ( const QString &  property,
qreal  newValue 
) const

Cap the passed value to the range for the given property, if it is set. If no range exists, the value is returned without change.

Parameters:
property The property to apply the range for
Parameters:
newValue The value which should be capped
Returns:
The capped value
See also:
applyRangeAndStep() applyStep()

Definition at line 88 of file metainfo.cpp.

qreal MetaInfo::applyRangeAndStep ( const QString &  property,
qreal  newValue 
) const

Cap the new value to the range for the given property, and round it off to the nearest step. The rules for applying both are as given in the functions for applying range and step separately

Parameters:
property The property to apply range and step for
Parameters:
newValue The value to cap and step
Returns:
The adjusted value
See also:
applyRange() applyStep()

Definition at line 134 of file metainfo.cpp.

qreal MetaInfo::applySteps ( const QString &  property,
qreal  newValue 
) const

Round off the given value to the nearest step for the named property If no value has been set, the value will be returned with no change

Parameters:
property The property to apply steps for
Parameters:
newValue The value to adjust
Returns:
The adjusted value
See also:
applyRangeAndStep() applyRange()

Definition at line 123 of file metainfo.cpp.

bool MetaInfo::hasPropertyRange ( const QString &  property  )  const

Whether a range has been set for the named property

Parameters:
property The name of the property to check
Returns:
Whether a range has been set for the property

Definition at line 59 of file metainfo.cpp.

bool MetaInfo::hasPropertySteps ( const QString &  property  )  const

Whether a step has been set for the named property

Parameters:
property The name of the property to check
Returns:
Whether a step value is defined

Definition at line 103 of file metainfo.cpp.

qreal MetaInfo::propertyRangeMax ( const QString &  property  )  const

The maximum value allowed for the property. Note: If the property does not have a range set, this will return 0

Parameters:
property The name of the property to fetch the maximum value for
Returns:
The maximum allowed value for the property

Definition at line 73 of file metainfo.cpp.

qreal MetaInfo::propertyRangeMin ( const QString &  property  )  const

The minimum value allowed for the property. Note: If the property does not have a range set, this will return 0

Parameters:
property The name of the property to fetch the minimum value for
Returns:
The minimum allowed value for the property

Definition at line 65 of file metainfo.cpp.

quint32 MetaInfo::propertySteps ( const QString &  property  )  const

The number of steps the property is separated into If no value is set, this function will return 0

Parameters:
property The property in question
Returns:
The number of steps for the named property

Definition at line 109 of file metainfo.cpp.

void MetaInfo::removePropertyRange ( const QString &  property  ) 

Remove the range for the property

Parameters:
property The property to remove the range values for

Definition at line 81 of file metainfo.cpp.

void MetaInfo::removePropertySteps ( const QString &  property  ) 

Remove the step value set for the named property

Parameters:
property The property to remove the steps for

Definition at line 117 of file metainfo.cpp.

void MetaInfo::setPropertyRange ( const QString &  property,
qreal  min,
qreal  max 
)

Set a range for the named property, from a minimum and maximum range, both inclusive

Parameters:
property The name of the property to set a range for
Parameters:
min The minimum allowed value for the property
Parameters:
max The maximum allowed value for the property

Definition at line 52 of file metainfo.cpp.

void MetaInfo::setPropertySteps ( const QString &  property,
quint32  steps 
)

Set the number of steps the property's range should be separated into.

Parameters:
property The property to set steps for
Parameters:
step The number of steps steps

Definition at line 97 of file metainfo.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Dec 27 13:13:42 2010 for Gluon by  doxygen 1.6.3