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.

100 lines
2.7 KiB

3 years ago
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Joas Schilling <coding@schilljs.com>
  8. * @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  9. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  10. * @author Julius Härtl <jus@bitgrid.net>
  11. * @author Morris Jobke <hey@morrisjobke.de>
  12. * @author Roeland Jago Douma <roeland@famdouma.nl>
  13. * @author Thomas Müller <thomas.mueller@tmit.eu>
  14. *
  15. * @license AGPL-3.0
  16. *
  17. * This code is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU Affero General Public License, version 3,
  19. * as published by the Free Software Foundation.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License, version 3,
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>
  28. *
  29. */
  30. /**
  31. * Public interface of ownCloud for apps to use.
  32. * Navigation manager interface
  33. *
  34. */
  35. // use OCP namespace for all classes that are considered public.
  36. // This means that they should be used by apps instead of the internal ownCloud classes
  37. namespace OCP;
  38. /**
  39. * Manages the ownCloud navigation
  40. * @since 6.0.0
  41. */
  42. interface INavigationManager {
  43. /**
  44. * Navigation entries of the app navigation
  45. * @since 16.0.0
  46. */
  47. public const TYPE_APPS = 'link';
  48. /**
  49. * Navigation entries of the settings navigation
  50. * @since 16.0.0
  51. */
  52. public const TYPE_SETTINGS = 'settings';
  53. /**
  54. * Navigation entries for public page footer navigation
  55. * @since 16.0.0
  56. */
  57. public const TYPE_GUEST = 'guest';
  58. /**
  59. * Creates a new navigation entry
  60. *
  61. * @param array|\Closure $entry Array containing: id, name, order, icon and href key
  62. * The use of a closure is preferred, because it will avoid
  63. * loading the routing of your app, unless required.
  64. * @return void
  65. * @since 6.0.0
  66. */
  67. public function add($entry);
  68. /**
  69. * Sets the current navigation entry of the currently running app
  70. * @param string $appId id of the app entry to activate (from added $entry)
  71. * @return void
  72. * @since 6.0.0
  73. */
  74. public function setActiveEntry($appId);
  75. /**
  76. * Get the current navigation entry of the currently running app
  77. * @return string
  78. * @since 20.0.0
  79. */
  80. public function getActiveEntry();
  81. /**
  82. * Get a list of navigation entries
  83. *
  84. * @param string $type type of the navigation entries
  85. * @return array
  86. * @since 14.0.0
  87. */
  88. public function getAll(string $type = self::TYPE_APPS): array;
  89. }