35 SetStringBundle(NS_LITERAL_STRING(
"chrome://songbird/locale/songbird.properties"));
37 NS_LITERAL_STRING(
"us"),
38 NS_LITERAL_STRING(
"&duration.unit.microseconds"),
39 NS_LITERAL_STRING(
"&duration.unit.microseconds.short"),
42 NS_LITERAL_STRING(
"ms"),
43 NS_LITERAL_STRING(
"&duration.unit.milliseconds"),
44 NS_LITERAL_STRING(
"&duration.unit.milliseconds.short"));
46 NS_LITERAL_STRING(
"sec"),
47 NS_LITERAL_STRING(
"&duration.unit.seconds"),
48 NS_LITERAL_STRING(
"&duration.unit.seconds.short"));
50 NS_LITERAL_STRING(
"min"),
51 NS_LITERAL_STRING(
"&duration.unit.minutes"),
52 NS_LITERAL_STRING(
"&duration.unit.minutes.short"));
54 NS_LITERAL_STRING(
"h"),
55 NS_LITERAL_STRING(
"&duration.unit.hours"),
56 NS_LITERAL_STRING(
"&duration.unit.hours.short"));
58 NS_LITERAL_STRING(
"d"),
59 NS_LITERAL_STRING(
"&duration.unit.days"),
60 NS_LITERAL_STRING(
"&duration.unit.days.short"));
62 NS_LITERAL_STRING(
"w"),
63 NS_LITERAL_STRING(
"&duration.unit.weeks"),
64 NS_LITERAL_STRING(
"&duration.unit.weeks.short"));
66 NS_LITERAL_STRING(
"m"),
67 NS_LITERAL_STRING(
"&duration.unit.months"),
68 NS_LITERAL_STRING(
"&duration.unit.months.short"));
70 NS_LITERAL_STRING(
"y"),
71 NS_LITERAL_STRING(
"&duration.unit.years"),
72 NS_LITERAL_STRING(
"&duration.unit.years.short"));
94 aValue /= (1000.0*1000.0);
97 aValue /= (1000.0*1000.0*60.0);
100 aValue /= (1000.0*1000.0*60.0*60.0);
103 aValue /= (1000.0*1000.0*60.0*60.0*24.0);
106 aValue /= (1000.0*1000.0*60.0*60.0*24.0*7.0);
109 aValue /= (1000.0*1000.0*60.0*60.0*24.0*30.0);
112 aValue /= (1000.0*1000.0*60.0*60.0*24.0*365.0);
115 return NS_ERROR_INVALID_ARG;
135 aValue *= (1000.0*1000.0);
138 aValue *= (1000.0*1000.0*60.0);
141 aValue *= (1000.0*1000.0*60.0*60.0);
144 aValue *= (1000.0*1000.0*60*60.0*24.0);
147 aValue *= (1000.0*1000.0*60.0*60.0*24.0*7.0);
150 aValue *= (1000.0*1000.0*60.0*60.0*24.0*30.0);
153 aValue *= (1000.0*1000.0*60.0*60.0*24.0*365.0);
156 return NS_ERROR_INVALID_ARG;
NS_IMETHOD ConvertFromNativeToUnit(PRFloat64 aValue, PRUint32 aUnitID, PRFloat64 &_retVal)
NS_IMETHOD ConvertFromUnitToNative(PRFloat64 aValue, PRUint32 aUnitID, PRFloat64 &_retVal)
sbDurationPropertyUnitConverter()
void RegisterUnit(PRUint32 aUnitInternalID, const nsAString &aUnitExternalID, const nsAString &aUnitName, const nsAString &aUnitShortName, PRBool isNative=PR_FALSE)
virtual ~sbDurationPropertyUnitConverter()
void SetStringBundle(const nsAString &aStringBundle)