IApi.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  6. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Thomas Müller <thomas.mueller@tmit.eu>
  9. *
  10. * @license AGPL-3.0
  11. *
  12. * This code is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License, version 3,
  14. * as published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License, version 3,
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>
  23. *
  24. */
  25. /**
  26. * Public interface of ownCloud for apps to use.
  27. * AppFramework/IApi interface
  28. */
  29. namespace OCP\AppFramework;
  30. /**
  31. * A few very basic and frequently used API functions are combined in here
  32. * @deprecated 8.0.0
  33. */
  34. interface IApi {
  35. /**
  36. * Gets the userid of the current user
  37. * @return string the user id of the current user
  38. * @deprecated 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID()
  39. */
  40. function getUserId();
  41. /**
  42. * Adds a new javascript file
  43. * @deprecated 8.0.0 include javascript and css in template files
  44. * @param string $scriptName the name of the javascript in js/ without the suffix
  45. * @param string $appName the name of the app, defaults to the current one
  46. * @return void
  47. */
  48. function addScript($scriptName, $appName = null);
  49. /**
  50. * Adds a new css file
  51. * @deprecated 8.0.0 include javascript and css in template files
  52. * @param string $styleName the name of the css file in css/without the suffix
  53. * @param string $appName the name of the app, defaults to the current one
  54. * @return void
  55. */
  56. function addStyle($styleName, $appName = null);
  57. /**
  58. * @deprecated 8.0.0 include javascript and css in template files
  59. * shorthand for addScript for files in the 3rdparty directory
  60. * @param string $name the name of the file without the suffix
  61. * @return void
  62. */
  63. function add3rdPartyScript($name);
  64. /**
  65. * @deprecated 8.0.0 include javascript and css in template files
  66. * shorthand for addStyle for files in the 3rdparty directory
  67. * @param string $name the name of the file without the suffix
  68. * @return void
  69. */
  70. function add3rdPartyStyle($name);
  71. /**
  72. * Checks if an app is enabled
  73. * @deprecated 8.0.0 communication between apps should happen over built in
  74. * callbacks or interfaces (check the contacts and calendar managers)
  75. * Checks if an app is enabled
  76. * also use \OC::$server->getAppManager()->isEnabledForUser($appName)
  77. * @param string $appName the name of an app
  78. * @return bool true if app is enabled
  79. */
  80. public function isAppEnabled($appName);
  81. }