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.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 an URL for an image or file
  43. * @param string $appName the name of the app
  44. * @param string $file the name of the file
  45. * @return string the url
  46. */
  47. public function linkTo($appName, $file);
  48. /**
  49. * Returns the link to an image, like linkTo but only with prepending img/
  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 imagePath($appName, $file);
  55. /**
  56. * Makes an URL absolute
  57. * @param string $url the url in the owncloud host
  58. * @return string the absolute version of the url
  59. */
  60. public function getAbsoluteURL($url);
  61. }