sbDurationPropertyUnitConverter Class Reference

#include <sbDurationPropertyUnitConverter.h>

Inheritance diagram for sbDurationPropertyUnitConverter:
[legend]
Collaboration diagram for sbDurationPropertyUnitConverter:
[legend]

Public Types

enum  {
  DURATION_UNIT_MICROSECONDS, DURATION_UNIT_MILLISECONDS, DURATION_UNIT_SECONDS, DURATION_UNIT_MINUTES,
  DURATION_UNIT_HOURS, DURATION_UNIT_DAYS, DURATION_UNIT_WEEKS, DURATION_UNIT_MONTHS,
  DURATION_UNIT_YEARS
}
 

Public Member Functions

 sbDurationPropertyUnitConverter ()
 
virtual ~sbDurationPropertyUnitConverter ()
 
- 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)
 
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)
 

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
 

Detailed Description

Definition at line 32 of file sbDurationPropertyUnitConverter.h.

Member Enumeration Documentation

anonymous enum
Enumerator
DURATION_UNIT_MICROSECONDS 
DURATION_UNIT_MILLISECONDS 
DURATION_UNIT_SECONDS 
DURATION_UNIT_MINUTES 
DURATION_UNIT_HOURS 
DURATION_UNIT_DAYS 
DURATION_UNIT_WEEKS 
DURATION_UNIT_MONTHS 
DURATION_UNIT_YEARS 

Definition at line 37 of file sbDurationPropertyUnitConverter.h.

Constructor & Destructor Documentation

sbDurationPropertyUnitConverter::sbDurationPropertyUnitConverter ( )

Definition at line 33 of file sbDurationPropertyUnitConverter.cpp.

Here is the call graph for this function:

sbDurationPropertyUnitConverter::~sbDurationPropertyUnitConverter ( )
virtual

Definition at line 76 of file sbDurationPropertyUnitConverter.cpp.

Member Function Documentation

NS_IMETHODIMP sbDurationPropertyUnitConverter::ConvertFromNativeToUnit ( PRFloat64  aValue,
PRUint32  aUnitID,
PRFloat64 &  _retVal 
)
protectedvirtual

Implements sbPropertyUnitConverter.

Definition at line 82 of file sbDurationPropertyUnitConverter.cpp.

NS_IMETHODIMP sbDurationPropertyUnitConverter::ConvertFromUnitToNative ( PRFloat64  aValue,
PRUint32  aUnitID,
PRFloat64 &  _retVal 
)
protectedvirtual

Implements sbPropertyUnitConverter.

Definition at line 123 of file sbDurationPropertyUnitConverter.cpp.


The documentation for this class was generated from the following files: