11#include <KLocalizedString>
13namespace KUnitConversion
15class PhotoUnitPrivate :
public UnitPrivate
18 PhotoUnitPrivate(CategoryId categoryId,
27 : UnitPrivate(categoryId, id, multiplier, symbol, description, matchString, symbolString, realString, integerString)
31 qreal toDefault(qreal value)
const override
33 return (2.99792458e+08 * 6.62606896e-34) / (value * 1e-09);
36 qreal fromDefault(qreal value)
const override
38 return ((2.99792458e+08 * 6.62606896e-34) / value) / 1e-09;
42UnitCategory Energy::makeCategory()
44 auto c = UnitCategoryPrivate::makeCategory(EnergyCategory,
i18n(
"Energy"),
i18n(
"Energy"));
45 auto d = UnitCategoryPrivate::get(c);
48 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
51 i18nc(
"energy unit symbol",
"YJ"),
52 i18nc(
"unit description in lists",
"yottajoules"),
53 i18nc(
"unit synonyms for matching user input",
"yottajoule;yottajoules;YJ"),
55 ki18nc(
"amount in units (real)",
"%1 yottajoules"),
56 ki18ncp(
"amount in units (integer)",
"%1 yottajoule",
"%1 yottajoules")));
58 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
61 i18nc(
"energy unit symbol",
"ZJ"),
62 i18nc(
"unit description in lists",
"zettajoules"),
63 i18nc(
"unit synonyms for matching user input",
"zettajoule;zettajoules;ZJ"),
65 ki18nc(
"amount in units (real)",
"%1 zettajoules"),
66 ki18ncp(
"amount in units (integer)",
"%1 zettajoule",
"%1 zettajoules")));
68 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
71 i18nc(
"energy unit symbol",
"EJ"),
72 i18nc(
"unit description in lists",
"exajoules"),
73 i18nc(
"unit synonyms for matching user input",
"exajoule;exajoules;EJ"),
75 ki18nc(
"amount in units (real)",
"%1 exajoules"),
76 ki18ncp(
"amount in units (integer)",
"%1 exajoule",
"%1 exajoules")));
78 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
81 i18nc(
"energy unit symbol",
"PJ"),
82 i18nc(
"unit description in lists",
"petajoules"),
83 i18nc(
"unit synonyms for matching user input",
"petajoule;petajoules;PJ"),
85 ki18nc(
"amount in units (real)",
"%1 petajoules"),
86 ki18ncp(
"amount in units (integer)",
"%1 petajoule",
"%1 petajoules")));
88 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
91 i18nc(
"energy unit symbol",
"TJ"),
92 i18nc(
"unit description in lists",
"terajoules"),
93 i18nc(
"unit synonyms for matching user input",
"terajoule;terajoules;TJ"),
95 ki18nc(
"amount in units (real)",
"%1 terajoules"),
96 ki18ncp(
"amount in units (integer)",
"%1 terajoule",
"%1 terajoules")));
98 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
101 i18nc(
"energy unit symbol",
"GJ"),
102 i18nc(
"unit description in lists",
"gigajoules"),
103 i18nc(
"unit synonyms for matching user input",
"gigajoule;gigajoules;GJ"),
105 ki18nc(
"amount in units (real)",
"%1 gigajoules"),
106 ki18ncp(
"amount in units (integer)",
"%1 gigajoule",
"%1 gigajoules")));
108 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
111 i18nc(
"energy unit symbol",
"MJ"),
112 i18nc(
"unit description in lists",
"megajoules"),
113 i18nc(
"unit synonyms for matching user input",
"megajoule;megajoules;MJ"),
115 ki18nc(
"amount in units (real)",
"%1 megajoules"),
116 ki18ncp(
"amount in units (integer)",
"%1 megajoule",
"%1 megajoules")));
118 d->addCommonUnit(UnitPrivate::makeUnit(EnergyCategory,
121 i18nc(
"energy unit symbol",
"kJ"),
122 i18nc(
"unit description in lists",
"kilojoules"),
123 i18nc(
"unit synonyms for matching user input",
"kilojoule;kilojoules;kJ"),
125 ki18nc(
"amount in units (real)",
"%1 kilojoules"),
126 ki18ncp(
"amount in units (integer)",
"%1 kilojoule",
"%1 kilojoules")));
128 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
131 i18nc(
"energy unit symbol",
"hJ"),
132 i18nc(
"unit description in lists",
"hectojoules"),
133 i18nc(
"unit synonyms for matching user input",
"hectojoule;hectojoules;hJ"),
135 ki18nc(
"amount in units (real)",
"%1 hectojoules"),
136 ki18ncp(
"amount in units (integer)",
"%1 hectojoule",
"%1 hectojoules")));
138 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
141 i18nc(
"energy unit symbol",
"daJ"),
142 i18nc(
"unit description in lists",
"decajoules"),
143 i18nc(
"unit synonyms for matching user input",
"decajoule;decajoules;daJ"),
145 ki18nc(
"amount in units (real)",
"%1 decajoules"),
146 ki18ncp(
"amount in units (integer)",
"%1 decajoule",
"%1 decajoules")));
148 d->addDefaultUnit(UnitPrivate::makeUnit(EnergyCategory,
151 i18nc(
"energy unit symbol",
"J"),
152 i18nc(
"unit description in lists",
"joules"),
153 i18nc(
"unit synonyms for matching user input",
"joule;joules;J"),
155 ki18nc(
"amount in units (real)",
"%1 joules"),
156 ki18ncp(
"amount in units (integer)",
"%1 joule",
"%1 joules")));
158 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
161 i18nc(
"energy unit symbol",
"dJ"),
162 i18nc(
"unit description in lists",
"decijoules"),
163 i18nc(
"unit synonyms for matching user input",
"decijoule;decijoules;dJ"),
165 ki18nc(
"amount in units (real)",
"%1 decijoules"),
166 ki18ncp(
"amount in units (integer)",
"%1 decijoule",
"%1 decijoules")));
168 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
171 i18nc(
"energy unit symbol",
"cJ"),
172 i18nc(
"unit description in lists",
"centijoules"),
173 i18nc(
"unit synonyms for matching user input",
"centijoule;centijoules;cJ"),
175 ki18nc(
"amount in units (real)",
"%1 centijoules"),
176 ki18ncp(
"amount in units (integer)",
"%1 centijoule",
"%1 centijoules")));
178 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
181 i18nc(
"energy unit symbol",
"mJ"),
182 i18nc(
"unit description in lists",
"millijoules"),
183 i18nc(
"unit synonyms for matching user input",
"millijoule;millijoules;mJ"),
185 ki18nc(
"amount in units (real)",
"%1 millijoules"),
186 ki18ncp(
"amount in units (integer)",
"%1 millijoule",
"%1 millijoules")));
188 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
191 i18nc(
"energy unit symbol",
"µJ"),
192 i18nc(
"unit description in lists",
"microjoules"),
193 i18nc(
"unit synonyms for matching user input",
"microjoule;microjoules;µJ;uJ"),
195 ki18nc(
"amount in units (real)",
"%1 microjoules"),
196 ki18ncp(
"amount in units (integer)",
"%1 microjoule",
"%1 microjoules")));
198 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
201 i18nc(
"energy unit symbol",
"nJ"),
202 i18nc(
"unit description in lists",
"nanojoules"),
203 i18nc(
"unit synonyms for matching user input",
"nanojoule;nanojoules;nJ"),
205 ki18nc(
"amount in units (real)",
"%1 nanojoules"),
206 ki18ncp(
"amount in units (integer)",
"%1 nanojoule",
"%1 nanojoules")));
208 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
211 i18nc(
"energy unit symbol",
"pJ"),
212 i18nc(
"unit description in lists",
"picojoules"),
213 i18nc(
"unit synonyms for matching user input",
"picojoule;picojoules;pJ"),
215 ki18nc(
"amount in units (real)",
"%1 picojoules"),
216 ki18ncp(
"amount in units (integer)",
"%1 picojoule",
"%1 picojoules")));
218 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
221 i18nc(
"energy unit symbol",
"fJ"),
222 i18nc(
"unit description in lists",
"femtojoules"),
223 i18nc(
"unit synonyms for matching user input",
"femtojoule;femtojoules;fJ"),
225 ki18nc(
"amount in units (real)",
"%1 femtojoules"),
226 ki18ncp(
"amount in units (integer)",
"%1 femtojoule",
"%1 femtojoules")));
228 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
231 i18nc(
"energy unit symbol",
"aJ"),
232 i18nc(
"unit description in lists",
"attojoules"),
233 i18nc(
"unit synonyms for matching user input",
"attojoule;attojoules;aJ"),
235 ki18nc(
"amount in units (real)",
"%1 attojoules"),
236 ki18ncp(
"amount in units (integer)",
"%1 attojoule",
"%1 attojoules")));
238 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
241 i18nc(
"energy unit symbol",
"zJ"),
242 i18nc(
"unit description in lists",
"zeptojoules"),
243 i18nc(
"unit synonyms for matching user input",
"zeptojoule;zeptojoules;zJ"),
245 ki18nc(
"amount in units (real)",
"%1 zeptojoules"),
246 ki18ncp(
"amount in units (integer)",
"%1 zeptojoule",
"%1 zeptojoules")));
248 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
251 i18nc(
"energy unit symbol",
"yJ"),
252 i18nc(
"unit description in lists",
"yoctojoules"),
253 i18nc(
"unit synonyms for matching user input",
"yoctojoule;yoctojoules;yJ"),
255 ki18nc(
"amount in units (real)",
"%1 yoctojoules"),
256 ki18ncp(
"amount in units (integer)",
"%1 yoctojoule",
"%1 yoctojoules")));
258 d->addCommonUnit(UnitPrivate::makeUnit(EnergyCategory,
259 GuidelineDailyAmount,
261 i18nc(
"energy unit symbol",
"GDA"),
262 i18nc(
"unit description in lists",
"guideline daily amount"),
263 i18nc(
"unit synonyms for matching user input",
"guideline daily amount;guideline daily amount;GDA"),
265 ki18nc(
"amount in units (real)",
"%1 guideline daily amount"),
266 ki18ncp(
"amount in units (integer)",
"%1 guideline daily amount",
"%1 guideline daily amount")));
268 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
271 i18nc(
"energy unit symbol",
"eV"),
272 i18nc(
"unit description in lists",
"electronvolts"),
273 i18nc(
"unit synonyms for matching user input",
"electronvolt;electronvolts;eV"),
275 ki18nc(
"amount in units (real)",
"%1 electronvolts"),
276 ki18ncp(
"amount in units (integer)",
"%1 electronvolt",
"%1 electronvolts")));
278 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
281 i18nc(
"energy unit symbol",
"J/mol"),
282 i18nc(
"unit description in lists",
"joule per mole"),
283 i18nc(
"unit synonyms for matching user input",
"joule per mole;joulepermole;joulemol;jmol;j/mol"),
285 ki18nc(
"amount in units (real)",
"%1 joules per mole"),
286 ki18ncp(
"amount in units (integer)",
"%1 joule per mole",
"%1 joules per mole")));
288 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
291 i18nc(
"energy unit symbol",
"kJ/mol"),
292 i18nc(
"unit description in lists",
"kilojoule per mole"),
293 i18nc(
"unit synonyms for matching user input",
"kilojoule per mole;kilojoulepermole;kilojoule per mole;kilojoulemol;kjmol;kj/mol"),
295 ki18nc(
"amount in units (real)",
"%1 kilojoules per mole"),
296 ki18ncp(
"amount in units (integer)",
"%1 kilojoule per mole",
"%1 kilojoules per mole")));
298 d->addUnit(UnitPrivate::makeUnit(EnergyCategory,
301 i18nc(
"energy unit symbol",
"Ry"),
302 i18nc(
"unit description in lists",
"rydbergs"),
303 i18nc(
"unit synonyms for matching user input",
"rydberg;rydbergs;Ry"),
305 ki18nc(
"amount in units (real)",
"%1 rydbergs"),
306 ki18ncp(
"amount in units (integer)",
"%1 rydberg",
"%1 rydbergs")));
308 d->addCommonUnit(UnitPrivate::makeUnit(EnergyCategory,
311 i18nc(
"energy unit symbol",
"kcal"),
312 i18nc(
"unit description in lists",
"kilocalories"),
313 i18nc(
"unit synonyms for matching user input",
"kilocalorie;kilocalories;kcal"),
315 ki18nc(
"amount in units (real)",
"%1 kilocalories"),
316 ki18ncp(
"amount in units (integer)",
"%1 kilocalorie",
"%1 kilocalories")));
318 d->addCommonUnit(UnitPrivate::makeUnit(EnergyCategory,
321 i18nc(
"energy unit symbol",
"BTU"),
322 i18nc(
"unit description in lists",
"British Thermal Unit"),
323 i18nc(
"unit synonyms for matching user input",
"Btu;BTU;Btus;BTUs"),
325 ki18nc(
"amount in units (real)",
"%1 BTU"),
326 ki18ncp(
"amount in units (integer)",
"%1 BTU",
"%1 BTU")));
328 d->addCommonUnit(UnitPrivate::makeUnit(EnergyCategory,
331 i18nc(
"energy unit symbol",
"Erg"),
332 i18nc(
"unit description in lists",
"ergs"),
333 i18nc(
"unit synonyms for matching user input",
"Erg;erg;Ergs;ergs"),
335 ki18nc(
"amount in units (real)",
"%1 ergs"),
336 ki18ncp(
"amount in units (integer)",
"%1 erg",
"%1 erg")));
338 d->addUnit(UnitPrivate::makeUnit(
new PhotoUnitPrivate(EnergyCategory,
341 i18nc(
"energy unit symbol",
"nm"),
342 i18nc(
"unit description in lists",
"photon wavelength in nanometers"),
343 i18nc(
"unit synonyms for matching user input",
"nm;photon wavelength"),
345 ki18nc(
"amount in units (real)",
"%1 nanometers"),
346 ki18ncp(
"amount in units (integer)",
"%1 nanometer",
"%1 nanometers"))));
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text)
QString i18n(const char *text, const TYPE &arg...)