IServerContainer.php 11 KB

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