iurlgenerator.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Bart Visscher
  6. * @copyright 2013 Bart Visscher bartv@thisnet.nl
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * Public interface of ownCloud for apps to use.
  24. * URL generator interface
  25. *
  26. */
  27. // use OCP namespace for all classes that are considered public.
  28. // This means that they should be used by apps instead of the internal ownCloud classes
  29. namespace OCP;
  30. /**
  31. * Class to generate URLs
  32. */
  33. interface IURLGenerator {
  34. /**
  35. * Returns the URL for a route
  36. * @param string $routeName the name of the route
  37. * @param array $arguments an array with arguments which will be filled into the url
  38. * @return string the url
  39. */
  40. public function linkToRoute($routeName, $arguments = array());
  41. /**
  42. * Returns the absolute URL for a route
  43. * @param string $routeName the name of the route
  44. * @param array $arguments an array with arguments which will be filled into the url
  45. * @return string the absolute url
  46. */
  47. public function linkToRouteAbsolute($routeName, $arguments = array());
  48. /**
  49. * Returns an URL for an image or file
  50. * @param string $appName the name of the app
  51. * @param string $file the name of the file
  52. * @return string the url
  53. */
  54. public function linkTo($appName, $file);
  55. /**
  56. * Returns the link to an image, like linkTo but only with prepending img/
  57. * @param string $appName the name of the app
  58. * @param string $file the name of the file
  59. * @return string the url
  60. */
  61. public function imagePath($appName, $file);
  62. /**
  63. * Makes an URL absolute
  64. * @param string $url the url in the ownCloud host
  65. * @return string the absolute version of the url
  66. */
  67. public function getAbsoluteURL($url);
  68. /**
  69. * @param string $key
  70. * @return string url to the online documentation
  71. */
  72. public function linkToDocs($key);
  73. }