Reland r146295 - [Font Settings API]: Rename fontName and localizedName to fontId...
[chromium-blink-merge.git] / chrome / common / extensions / api / experimental_font_settings.json
blob6538991f8dd10edefb39d5c4eed70691f2bff664
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6   {
7     "namespace": "experimental.fontSettings",
8     "types": [
9       {
10         "id": "FontName",
11         "type": "object",
12         "description": "Represents a font name.",
13         "properties": {
14           "fontId": {
15             "type": "string",
16             "description": "The font ID."
17           },
18           "displayName": {
19             "type": "string",
20             "description": "The display name of the font."
21           }
22         }
23       },
24       {
25         "id": "ScriptCode",
26         "type": "string",
27         "enum": [ "Afak", "Arab", "Armi", "Armn", "Avst", "Bali", "Bamu", "Bass", "Batk",
28                   "Beng", "Blis", "Bopo", "Brah", "Brai", "Bugi", "Buhd", "Cakm", "Cans",
29                   "Cari", "Cham", "Cher", "Cirt", "Copt", "Cprt", "Cyrl", "Cyrs", "Deva",
30                   "Dsrt", "Dupl", "Egyd", "Egyh", "Egyp", "Elba", "Ethi", "Geor", "Geok",
31                   "Glag", "Goth", "Gran", "Grek", "Gujr", "Guru", "Hang", "Hani", "Hano",
32                   "Hans", "Hant", "Hebr", "Hluw", "Hmng", "Hung", "Inds", "Ital", "Java",
33                   "Jpan", "Jurc", "Kali", "Khar", "Khmr", "Khoj", "Knda", "Kpel", "Kthi",
34                   "Lana", "Laoo", "Latf", "Latg", "Latn", "Lepc", "Limb", "Lina", "Linb",
35                   "Lisu", "Loma", "Lyci", "Lydi", "Mand", "Mani", "Maya", "Mend", "Merc",
36                   "Mero", "Mlym", "Moon", "Mong", "Mroo", "Mtei", "Mymr", "Narb", "Nbat",
37                   "Nkgb", "Nkoo", "Nshu", "Ogam", "Olck", "Orkh", "Orya", "Osma", "Palm",
38                   "Perm", "Phag", "Phli", "Phlp", "Phlv", "Phnx", "Plrd", "Prti", "Rjng",
39                   "Roro", "Runr", "Samr", "Sara", "Sarb", "Saur", "Sgnw", "Shaw", "Shrd",
40                   "Sind", "Sinh", "Sora", "Sund", "Sylo", "Syrc", "Syre", "Syrj", "Syrn",
41                   "Tagb", "Takr", "Tale", "Talu", "Taml", "Tang", "Tavt", "Telu", "Teng",
42                   "Tfng", "Tglg", "Thaa", "Thai", "Tibt", "Tirh", "Ugar", "Vaii", "Visp",
43                   "Wara", "Wole", "Xpeo", "Xsux", "Yiii", "Zmth", "Zsym", "Zyyy" ],
44         "description": "An ISO 15924 script code. The default, or global, script is represented by script code \"Zyyy\"."
45       },
46       {
47         "id": "GenericFamily",
48         "type": "string",
49         "enum": ["standard", "sansserif", "serif", "fixed", "cursive", "fantasy"],
50         "description": "A CSS generic font family."
51       },
52       {
53         "id": "LevelOfControl",
54         "description": "One of<br><var>not_controllable</var>: cannot be controlled by any extension<br><var>controlled_by_other_extensions</var>: controlled by extensions with higher precedence<br><var>controllable_by_this_extension</var>: can be controlled by this extension<br><var>controlled_by_this_extension</var>: controlled by this extension",
55         "type": "string",
56         "enum": ["not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", "controlled_by_this_extension"]
57       }
58     ],
59     "functions": [
60       {
61         "name": "clearFont",
62         "description": "Clears the font set by this extension, if any.",
63         "parameters": [
64           {
65             "name": "details",
66             "type": "object",
67             "properties": {
68               "script": {
69                 "$ref": "ScriptCode",
70                 "description": "The script for which the font should be cleared. If omitted, the global script font setting is cleared.",
71                 "optional": true
72               },
73               "genericFamily": {
74                 "$ref": "GenericFamily",
75                 "description": "The generic font family for which the font should be cleared."
76               }
77             }
78           },
79           {
80             "type": "function",
81             "name": "callback",
82             "optional": true,
83             "parameters": []
84           }
85         ]
86       },
87       {
88         "name": "getFont",
89         "description": "Gets the font for a given script and generic font family.",
90         "parameters": [
91           {
92             "name": "details",
93             "type": "object",
94             "properties": {
95               "script": {
96                 "$ref": "ScriptCode",
97                 "description": "The script for which the font should be retrieved. If omitted, the font setting for the global script (script code \"Zyyy\") is retrieved.",
98                 "optional": true
99               },
100               "genericFamily": {
101                 "$ref": "GenericFamily",
102                 "description": "The generic font family for which the font should be retrieved."
103               }
104             }
105           },
106           {
107             "type": "function",
108             "name": "callback",
109             "optional": true,
110             "parameters": [
111               {
112                 "name": "details",
113                 "type": "object",
114                 "properties": {
115                   "fontId": {
116                     "type": "string",
117                     "description": "The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, <var>fontId</var> can differ from the font passed to <code>setFont</code>, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting."
118                   },
119                   "levelOfControl": {
120                     "$ref": "LevelOfControl",
121                     "description": "The level of control this extension has over the setting."
122                   }
123                 }
124               }
125             ]
126           }
127         ]
128       },
129       {
130         "name": "setFont",
131         "description": "Sets the font for a given script and generic font family.",
132         "parameters": [
133           {
134             "name": "details",
135             "type": "object",
136             "properties": {
137               "script": {
138                 "$ref": "ScriptCode",
139                 "description": "The script code which the font should be set. If omitted, the font setting for the global script (script code \"Zyyy\") is set.",
140                 "optional": true
141               },
142               "genericFamily": {
143                 "$ref": "GenericFamily",
144                 "description": "The generic font family for which the font should be set."
145               },
146               "fontId": {
147                 "type": "string",
148                 "description": "The font ID. The empty string means to fallback to the global script font setting."
149               }
150             }
151           },
152           {
153             "type": "function",
154             "name": "callback",
155             "optional": true,
156             "parameters": []
157           }
158         ]
159       },
160       {
161         "name": "getFontList",
162         "description": "Gets a list of fonts on the system.",
163         "parameters": [
164           {
165             "type": "function",
166             "name": "callback",
167             "parameters": [
168               {
169                 "name": "results",
170                 "type": "array",
171                 "items": { "$ref": "FontName" }
172               }
173             ]
174           }
175         ]
176       },
177       {
178         "name": "clearDefaultFontSize",
179         "description": "Clears the default font size set by this extension, if any.",
180         "parameters": [
181           {
182             "name": "details",
183             "type": "object",
184             "optional": true,
185             "description": "This parameter is currently unused.",
186             "properties": {}
187           },
188           {
189             "type": "function",
190             "name": "callback",
191             "optional": true,
192             "parameters": []
193           }
194         ]
195       },
196       {
197         "name": "getDefaultFontSize",
198         "description": "Gets the default font size.",
199         "parameters": [
200           {
201             "name": "details",
202             "type": "object",
203             "optional": true,
204             "description": "This parameter is currently unused.",
205             "properties": {}
206           },
207           {
208             "name": "callback",
209             "type": "function",
210             "optional": true,
211             "parameters": [
212               {
213                 "name": "details",
214                 "type": "object",
215                 "properties": {
216                   "pixelSize": {
217                     "type": "integer",
218                     "description": "The font size in pixels."
219                   },
220                   "levelOfControl": {
221                     "$ref": "LevelOfControl",
222                     "description": "The level of control this extension has over the setting."
223                   }
224                 }
225               }
226             ]
227           }
228         ]
229       },
230       {
231         "name": "setDefaultFontSize",
232         "description": "Sets the default font size.",
233         "parameters": [
234           {
235             "name": "details",
236             "type": "object",
237             "properties": {
238               "pixelSize": {
239                 "type": "integer",
240                 "description": "The font size in pixels."
241               }
242             }
243           },
244           {
245             "type": "function",
246             "name": "callback",
247             "optional": true,
248             "parameters": []
249           }
250         ]
251       },
252       {
253         "name": "clearDefaultFixedFontSize",
254         "description": "Clears the default fixed font size set by this extension, if any.",
255         "parameters": [
256           {
257             "name": "details",
258             "type": "object",
259             "optional": true,
260             "description": "This parameter is currently unused.",
261             "properties": {}
262           },
263           {
264             "type": "function",
265             "name": "callback",
266             "optional": true,
267             "parameters": []
268           }
269         ]
270       },
271       {
272         "name": "getDefaultFixedFontSize",
273         "description": "Gets the default size for fixed width fonts.",
274         "parameters": [
275           {
276             "name": "details",
277             "type": "object",
278             "optional": true,
279             "description": "This parameter is currently unused.",
280             "properties": {}
281           },
282           {
283             "name": "callback",
284             "type": "function",
285             "optional": true,
286             "parameters": [
287               {
288                 "name": "details",
289                 "type": "object",
290                 "properties": {
291                   "pixelSize": {
292                     "type": "integer",
293                     "description": "The font size in pixels."
294                   },
295                   "levelOfControl": {
296                     "$ref": "LevelOfControl",
297                     "description": "The level of control this extension has over the setting."
298                   }
299                 }
300               }
301             ]
302           }
303         ]
304       },
305       {
306         "name": "setDefaultFixedFontSize",
307         "description": "Sets the default size for fixed width fonts.",
308         "parameters": [
309           {
310             "name": "details",
311             "type": "object",
312             "properties": {
313               "pixelSize": {
314                 "type": "integer",
315                 "description": "The font size in pixels."
316               }
317             }
318           },
319           {
320             "type": "function",
321             "name": "callback",
322             "optional": true,
323             "parameters": []
324           }
325         ]
326       },
327       {
328         "name": "clearMinimumFontSize",
329         "description": "Clears the minimum font size set by this extension, if any.",
330         "parameters": [
331           {
332             "name": "details",
333             "type": "object",
334             "optional": true,
335             "description": "This parameter is currently unused.",
336             "properties": {}
337           },
338           {
339             "type": "function",
340             "name": "callback",
341             "optional": true,
342             "parameters": []
343           }
344         ]
345       },
346       {
347         "name": "getMinimumFontSize",
348         "description": "Gets the minimum font size.",
349         "parameters": [
350           {
351             "name": "details",
352             "type": "object",
353             "optional": true,
354             "description": "This parameter is currently unused.",
355             "properties": {}
356           },
357           {
358             "name": "callback",
359             "type": "function",
360             "optional": true,
361             "parameters": [
362               {
363                 "name": "details",
364                 "type": "object",
365                 "properties": {
366                   "pixelSize": {
367                     "type": "integer",
368                     "description": "The font size in pixels."
369                   },
370                   "levelOfControl": {
371                     "$ref": "LevelOfControl",
372                     "description": "The level of control this extension has over the setting."
373                   }
374                 }
375               }
376             ]
377           }
378         ]
379       },
380       {
381         "name": "setMinimumFontSize",
382         "description": "Sets the minimum font size.",
383         "parameters": [
384           {
385             "name": "details",
386             "type": "object",
387             "properties": {
388               "pixelSize": {
389                 "type": "integer",
390                 "description": "The font size in pixels."
391               }
392             }
393           },
394           {
395             "type": "function",
396             "name": "callback",
397             "optional": true,
398             "parameters": []
399           }
400         ]
401       }
402     ],
403     "events": [
404       {
405         "name": "onFontChanged",
406         "description": "Fired when a font setting changes.",
407         "parameters": [
408           {
409             "type": "object",
410             "name": "details",
411             "properties": {
412               "fontId": {
413                 "type": "string",
414                 "description": "The font ID. See the description in <code>getFont</code>."
415               },
416               "script": {
417                 "$ref": "ScriptCode",
418                 "description": "The script code for which the font setting has changed.",
419                 "optional": true
420               },
421               "genericFamily": {
422                 "$ref": "GenericFamily",
423                 "description": "The generic font family for which the font setting has changed."
424               },
425               "levelOfControl": {
426                 "$ref": "LevelOfControl",
427                 "description": "The level of control this extension has over the setting."
428               }
429             }
430           }
431         ]
432       },
433       {
434         "name": "onDefaultFontSizeChanged",
435         "description": "Fired when the default font size setting changes.",
436         "parameters": [
437           {
438             "type": "object",
439             "name": "details",
440             "properties": {
441               "pixelSize": {
442                 "type": "integer",
443                 "description": "The font size in pixels."
444               },
445               "levelOfControl": {
446                 "$ref": "LevelOfControl",
447                 "description": "The level of control this extension has over the setting."
448               }
449             }
450           }
451         ]
452       },
453       {
454         "name": "onDefaultFixedFontSizeChanged",
455         "description": "Fired when the default fixed font size setting changes.",
456         "parameters": [
457           {
458             "type": "object",
459             "name": "details",
460             "properties": {
461               "pixelSize": {
462                 "type": "integer",
463                 "description": "The font size in pixels."
464               },
465               "levelOfControl": {
466                 "$ref": "LevelOfControl",
467                 "description": "The level of control this extension has over the setting."
468               }
469             }
470           }
471         ]
472       },
473       {
474         "name": "onMinimumFontSizeChanged",
475         "description": "Fired when the minimum font size setting changes.",
476         "parameters": [
477           {
478             "type": "object",
479             "name": "details",
480             "properties": {
481               "pixelSize": {
482                 "type": "integer",
483                 "description": "The font size in pixels."
484               },
485               "levelOfControl": {
486                 "$ref": "LevelOfControl",
487                 "description": "The level of control this extension has over the setting."
488               }
489             }
490           }
491         ]
492       }
493     ]
494   }