iservercontainer.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <?php
  2. /**
  3. * @author Bart Visscher <bartv@thisnet.nl>
  4. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  5. * @author Björn Schießle <schiessle@owncloud.com>
  6. * @author Christopher Schäpers <kondou@ts.unde.re>
  7. * @author Joas Schilling <nickvergessen@owncloud.com>
  8. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  9. * @author Lukas Reschke <lukas@owncloud.com>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Robin Appelman <icewind@owncloud.com>
  12. * @author Thomas Müller <thomas.mueller@tmit.eu>
  13. * @author Thomas Tanghus <thomas@tanghus.net>
  14. *
  15. * @copyright Copyright (c) 2015, ownCloud, Inc.
  16. * @license AGPL-3.0
  17. *
  18. * This code is free software: you can redistribute it and/or modify
  19. * it under the terms of the GNU Affero General Public License, version 3,
  20. * as published by the Free Software Foundation.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU Affero General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU Affero General Public License, version 3,
  28. * along with this program. If not, see <http://www.gnu.org/licenses/>
  29. *
  30. */
  31. /**
  32. * Public interface of ownCloud for apps to use.
  33. * Server container interface
  34. *
  35. */
  36. // use OCP namespace for all classes that are considered public.
  37. // This means that they should be used by apps instead of the internal ownCloud classes
  38. namespace OCP;
  39. /**
  40. * Class IServerContainer
  41. * @package OCP
  42. *
  43. * This container holds all ownCloud services
  44. * @since 6.0.0
  45. */
  46. interface IServerContainer {
  47. /**
  48. * The contacts manager will act as a broker between consumers for contacts information and
  49. * providers which actual deliver the contact information.
  50. *
  51. * @return \OCP\Contacts\IManager
  52. * @since 6.0.0
  53. */
  54. public function getContactsManager();
  55. /**
  56. * The current request object holding all information about the request currently being processed
  57. * is returned from this method.
  58. * In case the current execution was not initiated by a web request null is returned
  59. *
  60. * @return \OCP\IRequest
  61. * @since 6.0.0
  62. */
  63. public function getRequest();
  64. /**
  65. * Returns the preview manager which can create preview images for a given file
  66. *
  67. * @return \OCP\IPreview
  68. * @since 6.0.0
  69. */
  70. public function getPreviewManager();
  71. /**
  72. * Returns the tag manager which can get and set tags for different object types
  73. *
  74. * @see \OCP\ITagManager::load()
  75. * @return \OCP\ITagManager
  76. * @since 6.0.0
  77. */
  78. public function getTagManager();
  79. /**
  80. * Returns the root folder of ownCloud's data directory
  81. *
  82. * @return \OCP\Files\IRootFolder
  83. * @since 6.0.0 - between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
  84. */
  85. public function getRootFolder();
  86. /**
  87. * Returns a view to ownCloud's files folder
  88. *
  89. * @param string $userId user ID
  90. * @return \OCP\Files\Folder
  91. * @since 6.0.0 - parameter $userId was added in 8.0.0
  92. */
  93. public function getUserFolder($userId = null);
  94. /**
  95. * Returns an app-specific view in ownClouds data directory
  96. *
  97. * @return \OCP\Files\Folder
  98. * @since 6.0.0
  99. */
  100. public function getAppFolder();
  101. /**
  102. * Returns a user manager
  103. *
  104. * @return \OCP\IUserManager
  105. * @since 8.0.0
  106. */
  107. public function getUserManager();
  108. /**
  109. * Returns a group manager
  110. *
  111. * @return \OCP\IGroupManager
  112. * @since 8.0.0
  113. */
  114. public function getGroupManager();
  115. /**
  116. * Returns the user session
  117. *
  118. * @return \OCP\IUserSession
  119. * @since 6.0.0
  120. */
  121. public function getUserSession();
  122. /**
  123. * Returns the navigation manager
  124. *
  125. * @return \OCP\INavigationManager
  126. * @since 6.0.0
  127. */
  128. public function getNavigationManager();
  129. /**
  130. * Returns the config manager
  131. *
  132. * @return \OCP\IConfig
  133. * @since 6.0.0
  134. */
  135. public function getConfig();
  136. /**
  137. * Returns a Crypto instance
  138. *
  139. * @return \OCP\Security\ICrypto
  140. * @since 8.0.0
  141. */
  142. public function getCrypto();
  143. /**
  144. * Returns a Hasher instance
  145. *
  146. * @return \OCP\Security\IHasher
  147. * @since 8.0.0
  148. */
  149. public function getHasher();
  150. /**
  151. * Returns a SecureRandom instance
  152. *
  153. * @return \OCP\Security\ISecureRandom
  154. * @since 8.1.0
  155. */
  156. public function getSecureRandom();
  157. /**
  158. * Returns an instance of the db facade
  159. * @deprecated 8.1.0 use getDatabaseConnection, will be removed in ownCloud 10
  160. * @return \OCP\IDb
  161. * @since 7.0.0
  162. */
  163. public function getDb();
  164. /**
  165. * Returns the app config manager
  166. *
  167. * @return \OCP\IAppConfig
  168. * @since 7.0.0
  169. */
  170. public function getAppConfig();
  171. /**
  172. * get an L10N instance
  173. * @param string $app appid
  174. * @param string $lang
  175. * @return \OCP\IL10N
  176. * @since 6.0.0 - parameter $lang was added in 8.0.0
  177. */
  178. public function getL10N($app, $lang = null);
  179. /**
  180. * @return \OC\Encryption\Manager
  181. * @since 8.1.0
  182. */
  183. public function getEncryptionManager();
  184. /**
  185. * @return \OC\Encryption\File
  186. * @since 8.1.0
  187. */
  188. public function getEncryptionFilesHelper();
  189. /**
  190. * @return \OCP\Encryption\Keys\IStorage
  191. * @since 8.1.0
  192. */
  193. public function getEncryptionKeyStorage();
  194. /**
  195. * Returns the URL generator
  196. *
  197. * @return \OCP\IURLGenerator
  198. * @since 6.0.0
  199. */
  200. public function getURLGenerator();
  201. /**
  202. * Returns the Helper
  203. *
  204. * @return \OCP\IHelper
  205. * @since 6.0.0
  206. */
  207. public function getHelper();
  208. /**
  209. * Returns an ICache instance
  210. *
  211. * @return \OCP\ICache
  212. * @since 6.0.0
  213. */
  214. public function getCache();
  215. /**
  216. * Returns an \OCP\CacheFactory instance
  217. *
  218. * @return \OCP\ICacheFactory
  219. * @since 7.0.0
  220. */
  221. public function getMemCacheFactory();
  222. /**
  223. * Returns the current session
  224. *
  225. * @return \OCP\ISession
  226. * @since 6.0.0
  227. */
  228. public function getSession();
  229. /**
  230. * Returns the activity manager
  231. *
  232. * @return \OCP\Activity\IManager
  233. * @since 6.0.0
  234. */
  235. public function getActivityManager();
  236. /**
  237. * Returns the current session
  238. *
  239. * @return \OCP\IDBConnection
  240. * @since 6.0.0
  241. */
  242. public function getDatabaseConnection();
  243. /**
  244. * Returns an avatar manager, used for avatar functionality
  245. *
  246. * @return \OCP\IAvatarManager
  247. * @since 6.0.0
  248. */
  249. public function getAvatarManager();
  250. /**
  251. * Returns an job list for controlling background jobs
  252. *
  253. * @return \OCP\BackgroundJob\IJobList
  254. * @since 7.0.0
  255. */
  256. public function getJobList();
  257. /**
  258. * Returns a logger instance
  259. *
  260. * @return \OCP\ILogger
  261. * @since 8.0.0
  262. */
  263. public function getLogger();
  264. /**
  265. * Returns a router for generating and matching urls
  266. *
  267. * @return \OCP\Route\IRouter
  268. * @since 7.0.0
  269. */
  270. public function getRouter();
  271. /**
  272. * Returns a search instance
  273. *
  274. * @return \OCP\ISearch
  275. * @since 7.0.0
  276. */
  277. public function getSearch();
  278. /**
  279. * Get the certificate manager for the user
  280. *
  281. * @param string $userId (optional) if not specified the current loggedin user is used
  282. * @return \OCP\ICertificateManager | null if $userId is null and no user is logged in
  283. * @since 8.0.0
  284. */
  285. public function getCertificateManager($userId = null);
  286. /**
  287. * Create a new event source
  288. *
  289. * @return \OCP\IEventSource
  290. * @since 8.0.0
  291. */
  292. public function createEventSource();
  293. /**
  294. * Returns an instance of the HTTP helper class
  295. * @return \OC\HTTPHelper
  296. * @deprecated 8.1.0 Use \OCP\Http\Client\IClientService
  297. * @since 8.0.0
  298. */
  299. public function getHTTPHelper();
  300. /**
  301. * Returns an instance of the HTTP client service
  302. *
  303. * @return \OCP\Http\Client\IClientService
  304. * @since 8.1.0
  305. */
  306. public function getHTTPClientService();
  307. /**
  308. * Get the active event logger
  309. *
  310. * @return \OCP\Diagnostics\IEventLogger
  311. * @since 8.0.0
  312. */
  313. public function getEventLogger();
  314. /**
  315. * Get the active query logger
  316. *
  317. * The returned logger only logs data when debug mode is enabled
  318. *
  319. * @return \OCP\Diagnostics\IQueryLogger
  320. * @since 8.0.0
  321. */
  322. public function getQueryLogger();
  323. /**
  324. * Get the manager for temporary files and folders
  325. *
  326. * @return \OCP\ITempManager
  327. * @since 8.0.0
  328. */
  329. public function getTempManager();
  330. /**
  331. * Get the app manager
  332. *
  333. * @return \OCP\App\IAppManager
  334. * @since 8.0.0
  335. */
  336. public function getAppManager();
  337. /**
  338. * Get the webroot
  339. *
  340. * @return string
  341. * @since 8.0.0
  342. */
  343. public function getWebRoot();
  344. /**
  345. * @return \OCP\Files\Config\IMountProviderCollection
  346. * @since 8.0.0
  347. */
  348. public function getMountProviderCollection();
  349. /**
  350. * Get the IniWrapper
  351. *
  352. * @return \bantu\IniGetWrapper\IniGetWrapper
  353. * @since 8.0.0
  354. */
  355. public function getIniWrapper();
  356. /**
  357. * @return \OCP\Command\IBus
  358. * @since 8.1.0
  359. */
  360. public function getCommandBus();
  361. /**
  362. * Creates a new mailer
  363. *
  364. * @return \OCP\Mail\IMailer
  365. * @since 8.1.0
  366. */
  367. public function getMailer();
  368. /**
  369. * Get the locking provider
  370. *
  371. * @return \OCP\Lock\ILockingProvider
  372. * @since 8.1.0
  373. */
  374. public function getLockingProvider();
  375. }