#include <sbPropertyUnitConverter.h>
|
NS_DECL_ISUPPORTS
NS_DECL_SBIPROPERTYUNITCONVERTER | sbPropertyUnitConverter () |
|
virtual | ~sbPropertyUnitConverter () |
|
AString | convert (in AString aValue, in AString aFromUnitID, in AString aToUnitID, in long aMinDecimals, in long aMaxDecimals) |
| Convert a value to a different unit. Use -1 for aMinDecimals and aMaxDecimals if you do not wish to set any limits on the number of decimals in the returned value. More...
|
|
AString | autoFormat (in AString aValue, in long aMinDecimals, in long aMaxDecimals) |
| Formats a value using the most suitable unit. Use -1 for aMinDecimals and aMaxDecimals if you do not wish to set any limits on the number of decimals in the returned value. More...
|
|
|
void | RegisterUnit (PRUint32 aUnitInternalID, const nsAString &aUnitExternalID, const nsAString &aUnitName, const nsAString &aUnitShortName, PRBool isNative=PR_FALSE) |
|
void | SetStringBundle (const nsAString &aStringBundle) |
|
NS_IMETHOD | ConvertFromNativeToUnit (PRFloat64 aValue, PRUint32 aUnitID, PRFloat64 &_retVal)=0 |
|
NS_IMETHOD | ConvertFromUnitToNative (PRFloat64 aValue, PRUint32 aUnitID, PRFloat64 &_retVal)=0 |
|
virtual PRInt32 | GetAutoUnit (PRFloat64 aValue) |
|
nsresult | PerformConversion (PRFloat64 &aValue, PRUint32 aFromUnit, PRUint32 aToUnit) |
|
void | RemoveTrailingZeroes (nsAString &aValue) |
|
void | LimitToNDecimals (nsAString &aValue, PRUint32 aDecimals) |
|
void | ForceToNDecimals (nsAString &aValue, PRUint32 aDecimals) |
|
void | ApplyDecimalLimits (nsAString &aValue, PRInt32 aMinDecimals, PRInt32 aMaxDecimals) |
|
nsresult | SscanfFloat64 (const nsAString &aValue, PRFloat64 &aOutValue) |
|
nsresult | SprintfFloat64 (const PRFloat64 aValue, nsAString &aOutValue) |
|
|
readonly attribute
nsISimpleEnumerator | units |
| The list of available units for this property. More...
|
|
readonly attribute AString | nativeUnitId |
| The native unit for this property. This is the unit used for storage in the database, and that is implied when getting and setting the property. More...
|
|
readonly attribute AString | stringBundle |
| The url to the string bundle used to localize partial entities. More...
|
|
attribute sbIPropertyInfo | propertyInfo |
| The sbIPropertyInfo this converter is associated with. This attribute will be set automatically by the propertyinfo object when its converter is assigned. More...
|
|
Definition at line 67 of file sbPropertyUnitConverter.h.
sbPropertyUnitConverter::sbPropertyUnitConverter |
( |
| ) |
|
sbPropertyUnitConverter::~sbPropertyUnitConverter |
( |
| ) |
|
|
virtual |
void sbPropertyUnitConverter::ApplyDecimalLimits |
( |
nsAString & |
aValue, |
|
|
PRInt32 |
aMinDecimals, |
|
|
PRInt32 |
aMaxDecimals |
|
) |
| |
|
protected |
NS_IMETHOD sbPropertyUnitConverter::ConvertFromNativeToUnit |
( |
PRFloat64 |
aValue, |
|
|
PRUint32 |
aUnitID, |
|
|
PRFloat64 & |
_retVal |
|
) |
| |
|
protectedpure virtual |
NS_IMETHOD sbPropertyUnitConverter::ConvertFromUnitToNative |
( |
PRFloat64 |
aValue, |
|
|
PRUint32 |
aUnitID, |
|
|
PRFloat64 & |
_retVal |
|
) |
| |
|
protectedpure virtual |
void sbPropertyUnitConverter::ForceToNDecimals |
( |
nsAString & |
aValue, |
|
|
PRUint32 |
aDecimals |
|
) |
| |
|
protected |
virtual PRInt32 sbPropertyUnitConverter::GetAutoUnit |
( |
PRFloat64 |
aValue | ) |
|
|
inlineprotectedvirtual |
void sbPropertyUnitConverter::LimitToNDecimals |
( |
nsAString & |
aValue, |
|
|
PRUint32 |
aDecimals |
|
) |
| |
|
protected |
nsresult sbPropertyUnitConverter::PerformConversion |
( |
PRFloat64 & |
aValue, |
|
|
PRUint32 |
aFromUnit, |
|
|
PRUint32 |
aToUnit |
|
) |
| |
|
protected |
void sbPropertyUnitConverter::RegisterUnit |
( |
PRUint32 |
aUnitInternalID, |
|
|
const nsAString & |
aUnitExternalID, |
|
|
const nsAString & |
aUnitName, |
|
|
const nsAString & |
aUnitShortName, |
|
|
PRBool |
isNative = PR_FALSE |
|
) |
| |
|
protected |
void sbPropertyUnitConverter::RemoveTrailingZeroes |
( |
nsAString & |
aValue | ) |
|
|
protected |
void sbPropertyUnitConverter::SetStringBundle |
( |
const nsAString & |
aStringBundle | ) |
|
|
protected |
nsresult sbPropertyUnitConverter::SprintfFloat64 |
( |
const PRFloat64 |
aValue, |
|
|
nsAString & |
aOutValue |
|
) |
| |
|
protected |
nsresult sbPropertyUnitConverter::SscanfFloat64 |
( |
const nsAString & |
aValue, |
|
|
PRFloat64 & |
aOutValue |
|
) |
| |
|
protected |
PRUnichar sbPropertyUnitConverter::mDecimalPoint |
|
protected |
PRLock* sbPropertyUnitConverter::mLock |
|
protected |
nsString sbPropertyUnitConverter::mNative |
|
protected |
PRUint32 sbPropertyUnitConverter::mNativeInternal |
|
protected |
nsCOMPtr<nsIWeakReference> sbPropertyUnitConverter::mPropertyInfo |
|
protected |
nsString sbPropertyUnitConverter::mStringBundle |
|
protected |
nsCOMPtr<nsIStringBundle> sbPropertyUnitConverter::mStringBundleObject |
|
protected |
nsCOMPtr<nsIStringBundleService> sbPropertyUnitConverter::mStringBundleService |
|
protected |
The documentation for this class was generated from the following files: