iservercontainer.php 11 KB

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