#include <sbBitratePropertyUnitConverter.h>
Public Types | |
enum | { BITRATE_UNIT_BPS, BITRATE_UNIT_KBPS, BITRATE_UNIT_MBPS } |
Public Member Functions | |
sbBitratePropertyUnitConverter () | |
virtual | ~sbBitratePropertyUnitConverter () |
virtual PRInt32 | GetAutoUnit (PRFloat64 aValue) |
Public Member Functions inherited from sbPropertyUnitConverter | |
NS_DECL_ISUPPORTS NS_DECL_SBIPROPERTYUNITCONVERTER | sbPropertyUnitConverter () |
virtual | ~sbPropertyUnitConverter () |
Public Member Functions inherited from sbIPropertyUnitConverter | |
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... | |
Protected Member Functions | |
NS_IMETHOD | ConvertFromNativeToUnit (PRFloat64 aValue, PRUint32 aUnitID, PRFloat64 &_retVal) |
NS_IMETHOD | ConvertFromUnitToNative (PRFloat64 aValue, PRUint32 aUnitID, PRFloat64 &_retVal) |
Protected Member Functions inherited from sbPropertyUnitConverter | |
void | RegisterUnit (PRUint32 aUnitInternalID, const nsAString &aUnitExternalID, const nsAString &aUnitName, const nsAString &aUnitShortName, PRBool isNative=PR_FALSE) |
void | SetStringBundle (const nsAString &aStringBundle) |
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) |
Additional Inherited Members | |
Public Attributes inherited from sbIPropertyUnitConverter | |
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... | |
Protected Attributes inherited from sbPropertyUnitConverter | |
PRLock * | mLock |
nsString | mNative |
PRUint32 | mNativeInternal |
nsString | mStringBundle |
nsCOMPtr< nsIStringBundleService > | mStringBundleService |
nsCOMPtr< nsIStringBundle > | mStringBundleObject |
propertyUnitMap | mUnitsMap |
propertyUnitMapInternal | mUnitsMapInternal |
propertyUnitList | mUnits |
PRUnichar | mDecimalPoint |
nsCOMPtr< nsIWeakReference > | mPropertyInfo |
Definition at line 32 of file sbBitratePropertyUnitConverter.h.
anonymous enum |
Enumerator | |
---|---|
BITRATE_UNIT_BPS | |
BITRATE_UNIT_KBPS | |
BITRATE_UNIT_MBPS |
Definition at line 37 of file sbBitratePropertyUnitConverter.h.
sbBitratePropertyUnitConverter::sbBitratePropertyUnitConverter | ( | ) |
Definition at line 34 of file sbBitratePropertyUnitConverter.cpp.
|
virtual |
Definition at line 53 of file sbBitratePropertyUnitConverter.cpp.
|
protectedvirtual |
Implements sbPropertyUnitConverter.
Definition at line 59 of file sbBitratePropertyUnitConverter.cpp.
|
protectedvirtual |
Implements sbPropertyUnitConverter.
Definition at line 80 of file sbBitratePropertyUnitConverter.cpp.
|
virtual |
Reimplemented from sbPropertyUnitConverter.
Definition at line 99 of file sbBitratePropertyUnitConverter.cpp.