You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

iurlgenerator.php 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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) 2016, 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. }