iurlgenerator.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. */
  35. interface IURLGenerator {
  36. /**
  37. * Returns the URL for a route
  38. * @param string $routeName the name of the route
  39. * @param array $arguments an array with arguments which will be filled into the url
  40. * @return string the url
  41. */
  42. public function linkToRoute($routeName, $arguments = array());
  43. /**
  44. * Returns the absolute URL for a route
  45. * @param string $routeName the name of the route
  46. * @param array $arguments an array with arguments which will be filled into the url
  47. * @return string the absolute url
  48. */
  49. public function linkToRouteAbsolute($routeName, $arguments = array());
  50. /**
  51. * Returns an URL for an image or file
  52. * @param string $appName the name of the app
  53. * @param string $file the name of the file
  54. * @return string the url
  55. */
  56. public function linkTo($appName, $file);
  57. /**
  58. * Returns the link to an image, like linkTo but only with prepending img/
  59. * @param string $appName the name of the app
  60. * @param string $file the name of the file
  61. * @return string the url
  62. */
  63. public function imagePath($appName, $file);
  64. /**
  65. * Makes an URL absolute
  66. * @param string $url the url in the ownCloud host
  67. * @return string the absolute version of the url
  68. */
  69. public function getAbsoluteURL($url);
  70. /**
  71. * @param string $key
  72. * @return string url to the online documentation
  73. */
  74. public function linkToDocs($key);
  75. }