namefetcher.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2012 The Closure Library Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS-IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * @fileoverview Definition of the goog.i18n.CharNameFetcher interface. This
  16. * interface is used to retrieve individual character names.
  17. */
  18. goog.provide('goog.i18n.uChar.NameFetcher');
  19. /**
  20. * NameFetcher interface. Implementations of this interface are used to retrieve
  21. * Unicode character names.
  22. *
  23. * @interface
  24. */
  25. goog.i18n.uChar.NameFetcher = function() {};
  26. /**
  27. * Retrieves the names of a given set of characters and stores them in a cache
  28. * for fast retrieval. Offline implementations can simply provide an empty
  29. * implementation.
  30. *
  31. * @param {string} characters The list of characters in base 88 to fetch. These
  32. * lists are stored by category and subcategory in the
  33. * goog.i18n.charpickerdata class.
  34. */
  35. goog.i18n.uChar.NameFetcher.prototype.prefetch = function(characters) {};
  36. /**
  37. * Retrieves the name of a particular character.
  38. *
  39. * @param {string} character The character to retrieve.
  40. * @param {function(?string)} callback The callback function called when the
  41. * name retrieval is complete, contains a single string parameter with the
  42. * codepoint name, this parameter will be null if the character name is not
  43. * defined.
  44. */
  45. goog.i18n.uChar.NameFetcher.prototype.getName = function(character, callback) {
  46. };
  47. /**
  48. * Tests whether the name of a given character is available to be retrieved by
  49. * the getName() function.
  50. *
  51. * @param {string} character The character to test.
  52. * @return {boolean} True if the fetcher can retrieve or has a name available
  53. * for the given character.
  54. */
  55. goog.i18n.uChar.NameFetcher.prototype.isNameAvailable = function(character) {};