iurlgenerator.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * @author Bart Visscher <bartv@thisnet.nl>
  4. * @author Joas Schilling <nickvergessen@owncloud.com>
  5. * @author Morris Jobke <hey@morrisjobke.de>
  6. * @author Thomas Müller <thomas.mueller@tmit.eu>
  7. *
  8. * @copyright Copyright (c) 2015, ownCloud, Inc.
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. /**
  25. * Public interface of ownCloud for apps to use.
  26. * URL generator interface
  27. *
  28. */
  29. // use OCP namespace for all classes that are considered public.
  30. // This means that they should be used by apps instead of the internal ownCloud classes
  31. namespace OCP;
  32. /**
  33. * Class to generate URLs
  34. * @since 6.0.0
  35. */
  36. interface IURLGenerator {
  37. /**
  38. * Returns the URL for a route
  39. * @param string $routeName the name of the route
  40. * @param array $arguments an array with arguments which will be filled into the url
  41. * @return string the url
  42. * @since 6.0.0
  43. */
  44. public function linkToRoute($routeName, $arguments = array());
  45. /**
  46. * Returns the absolute URL for a route
  47. * @param string $routeName the name of the route
  48. * @param array $arguments an array with arguments which will be filled into the url
  49. * @return string the absolute url
  50. * @since 8.0.0
  51. */
  52. public function linkToRouteAbsolute($routeName, $arguments = array());
  53. /**
  54. * Returns an URL for an image or file
  55. * @param string $appName the name of the app
  56. * @param string $file the name of the file
  57. * @param array $args array with param=>value, will be appended to the returned url
  58. * The value of $args will be urlencoded
  59. * @return string the url
  60. * @since 6.0.0
  61. */
  62. public function linkTo($appName, $file, $args = array());
  63. /**
  64. * Returns the link to an image, like linkTo but only with prepending img/
  65. * @param string $appName the name of the app
  66. * @param string $file the name of the file
  67. * @return string the url
  68. * @since 6.0.0
  69. */
  70. public function imagePath($appName, $file);
  71. /**
  72. * Makes an URL absolute
  73. * @param string $url the url in the ownCloud host
  74. * @return string the absolute version of the url
  75. * @since 6.0.0
  76. */
  77. public function getAbsoluteURL($url);
  78. /**
  79. * @param string $key
  80. * @return string url to the online documentation
  81. * @since 8.0.0
  82. */
  83. public function linkToDocs($key);
  84. }