IAppManager.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Lukas Reschke <lukas@statuscode.ch>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Robin Appelman <robin@icewind.nl>
  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. namespace OCP\App;
  26. use OCP\IUser;
  27. /**
  28. * Interface IAppManager
  29. *
  30. * @package OCP\App
  31. * @since 8.0.0
  32. */
  33. interface IAppManager {
  34. /**
  35. * Check if an app is enabled for user
  36. *
  37. * @param string $appId
  38. * @param \OCP\IUser $user (optional) if not defined, the currently loggedin user will be used
  39. * @return bool
  40. * @since 8.0.0
  41. */
  42. public function isEnabledForUser($appId, $user = null);
  43. /**
  44. * Check if an app is installed in the instance
  45. *
  46. * @param string $appId
  47. * @return bool
  48. * @since 8.0.0
  49. */
  50. public function isInstalled($appId);
  51. /**
  52. * Enable an app for every user
  53. *
  54. * @param string $appId
  55. * @since 8.0.0
  56. */
  57. public function enableApp($appId);
  58. /**
  59. * Enable an app only for specific groups
  60. *
  61. * @param string $appId
  62. * @param \OCP\IGroup[] $groups
  63. * @since 8.0.0
  64. */
  65. public function enableAppForGroups($appId, $groups);
  66. /**
  67. * Disable an app for every user
  68. *
  69. * @param string $appId
  70. * @since 8.0.0
  71. */
  72. public function disableApp($appId);
  73. /**
  74. * List all apps enabled for a user
  75. *
  76. * @param \OCP\IUser $user
  77. * @return string[]
  78. * @since 8.1.0
  79. */
  80. public function getEnabledAppsForUser(IUser $user);
  81. /**
  82. * List all installed apps
  83. *
  84. * @return string[]
  85. * @since 8.1.0
  86. */
  87. public function getInstalledApps();
  88. /**
  89. * Clear the cached list of apps when enabling/disabling an app
  90. * @since 8.1.0
  91. */
  92. public function clearAppsCache();
  93. /**
  94. * @param string $appId
  95. * @return boolean
  96. * @since 9.0.0
  97. */
  98. public function isShipped($appId);
  99. /**
  100. * @return string[]
  101. * @since 9.0.0
  102. */
  103. public function getAlwaysEnabledApps();
  104. }