tmgmt.plugin.interface.source.inc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /**
  3. * @file
  4. * Contains the source plugin interface.
  5. */
  6. /**
  7. * Interface for source plugin controllers.
  8. *
  9. * @ingroup tmgmt_source
  10. */
  11. interface TMGMTSourcePluginControllerInterface extends TMGMTPluginBaseInterface {
  12. /**
  13. * Returns an array with the data structured for translation.
  14. *
  15. * @param TMGMTJobItem $job_item
  16. * The job item entity.
  17. *
  18. * @see TMGMTJobItem::getData()
  19. */
  20. public function getData(TMGMTJobItem $job_item);
  21. /**
  22. * Saves a translation.
  23. *
  24. * @param TMGMTJobItem $job_item
  25. * The job item entity.
  26. *
  27. * @return boolean
  28. * TRUE if the translation was saved successfully, FALSE otherwise.
  29. */
  30. public function saveTranslation(TMGMTJobItem $job_item);
  31. /**
  32. * Return a title for this job item.
  33. *
  34. * @param TMGMTJobItem $job_item
  35. * The job item entity.
  36. */
  37. public function getLabel(TMGMTJobItem $job_item);
  38. /**
  39. * Returns the Uri for this job item.
  40. *
  41. * @param TMGMTJobItem $job_item
  42. * The job item entity.
  43. *
  44. * @see entity_uri()
  45. */
  46. public function getUri(TMGMTJobItem $job_item);
  47. /**
  48. * Returns an array of translatable source item types.
  49. */
  50. public function getItemTypes();
  51. /**
  52. * Returns the label of a source item type.
  53. *
  54. * @param $type
  55. * The identifier of a source item type.
  56. */
  57. public function getItemTypeLabel($type);
  58. /**
  59. * Returns the type of a job item.
  60. *
  61. * @param TMGMTJobItem $job_item
  62. * The job item.
  63. *
  64. * @return string
  65. * A type that describes the job item.
  66. */
  67. public function getType(TMGMTJobItem $job_item);
  68. /**
  69. * Gets language code of the job item source.
  70. *
  71. * @param TMGMTJobItem $job_item
  72. * The job item.
  73. *
  74. * @return string
  75. * Language code.
  76. */
  77. public function getSourceLangCode(TMGMTJobItem $job_item);
  78. /**
  79. * Gets existing translation language codes of the job item source.
  80. *
  81. * Returns language codes that can be used as the source language for a
  82. * translation job.
  83. *
  84. * @param TMGMTJobItem $job_item
  85. * The job item.
  86. *
  87. * @return array
  88. * Array of language codes.
  89. */
  90. public function getExistingLangCodes(TMGMTJobItem $job_item);
  91. }