iapi.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * ownCloud - App Framework
  4. *
  5. * @author Bernhard Posselt
  6. * @copyright 2012 Bernhard Posselt nukeawhale@gmail.com
  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. * AppFramework/IApi interface
  25. */
  26. namespace OCP\AppFramework;
  27. /**
  28. * A few very basic and frequently used API functions are combined in here
  29. */
  30. interface IApi {
  31. /**
  32. * Gets the userid of the current user
  33. * @return string the user id of the current user
  34. */
  35. function getUserId();
  36. /**
  37. * Adds a new javascript file
  38. * @param string $scriptName the name of the javascript in js/ without the suffix
  39. * @param string $appName the name of the app, defaults to the current one
  40. */
  41. function addScript($scriptName, $appName = null);
  42. /**
  43. * Adds a new css file
  44. * @param string $styleName the name of the css file in css/without the suffix
  45. * @param string $appName the name of the app, defaults to the current one
  46. */
  47. function addStyle($styleName, $appName = null);
  48. /**
  49. * shorthand for addScript for files in the 3rdparty directory
  50. * @param string $name the name of the file without the suffix
  51. */
  52. function add3rdPartyScript($name);
  53. /**
  54. * shorthand for addStyle for files in the 3rdparty directory
  55. * @param string $name the name of the file without the suffix
  56. */
  57. function add3rdPartyStyle($name);
  58. /**
  59. * Checks if an app is enabled
  60. * @param string $appName the name of an app
  61. * @return bool true if app is enabled
  62. */
  63. public function isAppEnabled($appName);
  64. }