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.

IServerContainer.php 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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. * @deprecated since 9.2.0 use IAppData
  108. */
  109. public function getAppFolder();
  110. /**
  111. * Returns a user manager
  112. *
  113. * @return \OCP\IUserManager
  114. * @since 8.0.0
  115. */
  116. public function getUserManager();
  117. /**
  118. * Returns a group manager
  119. *
  120. * @return \OCP\IGroupManager
  121. * @since 8.0.0
  122. */
  123. public function getGroupManager();
  124. /**
  125. * Returns the user session
  126. *
  127. * @return \OCP\IUserSession
  128. * @since 6.0.0
  129. */
  130. public function getUserSession();
  131. /**
  132. * Returns the navigation manager
  133. *
  134. * @return \OCP\INavigationManager
  135. * @since 6.0.0
  136. */
  137. public function getNavigationManager();
  138. /**
  139. * Returns the config manager
  140. *
  141. * @return \OCP\IConfig
  142. * @since 6.0.0
  143. */
  144. public function getConfig();
  145. /**
  146. * Returns a Crypto instance
  147. *
  148. * @return \OCP\Security\ICrypto
  149. * @since 8.0.0
  150. */
  151. public function getCrypto();
  152. /**
  153. * Returns a Hasher instance
  154. *
  155. * @return \OCP\Security\IHasher
  156. * @since 8.0.0
  157. */
  158. public function getHasher();
  159. /**
  160. * Returns a SecureRandom instance
  161. *
  162. * @return \OCP\Security\ISecureRandom
  163. * @since 8.1.0
  164. */
  165. public function getSecureRandom();
  166. /**
  167. * Returns a CredentialsManager instance
  168. *
  169. * @return \OCP\Security\ICredentialsManager
  170. * @since 9.0.0
  171. */
  172. public function getCredentialsManager();
  173. /**
  174. * Returns the app config manager
  175. *
  176. * @return \OCP\IAppConfig
  177. * @since 7.0.0
  178. */
  179. public function getAppConfig();
  180. /**
  181. * @return \OCP\L10N\IFactory
  182. * @since 8.2.0
  183. */
  184. public function getL10NFactory();
  185. /**
  186. * get an L10N instance
  187. * @param string $app appid
  188. * @param string $lang
  189. * @return \OCP\IL10N
  190. * @since 6.0.0 - parameter $lang was added in 8.0.0
  191. */
  192. public function getL10N($app, $lang = null);
  193. /**
  194. * @return \OC\Encryption\Manager
  195. * @since 8.1.0
  196. */
  197. public function getEncryptionManager();
  198. /**
  199. * @return \OC\Encryption\File
  200. * @since 8.1.0
  201. */
  202. public function getEncryptionFilesHelper();
  203. /**
  204. * @return \OCP\Encryption\Keys\IStorage
  205. * @since 8.1.0
  206. */
  207. public function getEncryptionKeyStorage();
  208. /**
  209. * Returns the URL generator
  210. *
  211. * @return \OCP\IURLGenerator
  212. * @since 6.0.0
  213. */
  214. public function getURLGenerator();
  215. /**
  216. * Returns the Helper
  217. *
  218. * @return \OCP\IHelper
  219. * @since 6.0.0
  220. */
  221. public function getHelper();
  222. /**
  223. * Returns an ICache instance
  224. *
  225. * @return \OCP\ICache
  226. * @since 6.0.0
  227. */
  228. public function getCache();
  229. /**
  230. * Returns an \OCP\CacheFactory instance
  231. *
  232. * @return \OCP\ICacheFactory
  233. * @since 7.0.0
  234. */
  235. public function getMemCacheFactory();
  236. /**
  237. * Returns the current session
  238. *
  239. * @return \OCP\ISession
  240. * @since 6.0.0
  241. */
  242. public function getSession();
  243. /**
  244. * Returns the activity manager
  245. *
  246. * @return \OCP\Activity\IManager
  247. * @since 6.0.0
  248. */
  249. public function getActivityManager();
  250. /**
  251. * Returns the current session
  252. *
  253. * @return \OCP\IDBConnection
  254. * @since 6.0.0
  255. */
  256. public function getDatabaseConnection();
  257. /**
  258. * Returns an avatar manager, used for avatar functionality
  259. *
  260. * @return \OCP\IAvatarManager
  261. * @since 6.0.0
  262. */
  263. public function getAvatarManager();
  264. /**
  265. * Returns an job list for controlling background jobs
  266. *
  267. * @return \OCP\BackgroundJob\IJobList
  268. * @since 7.0.0
  269. */
  270. public function getJobList();
  271. /**
  272. * Returns a logger instance
  273. *
  274. * @return \OCP\ILogger
  275. * @since 8.0.0
  276. */
  277. public function getLogger();
  278. /**
  279. * Returns a router for generating and matching urls
  280. *
  281. * @return \OCP\Route\IRouter
  282. * @since 7.0.0
  283. */
  284. public function getRouter();
  285. /**
  286. * Returns a search instance
  287. *
  288. * @return \OCP\ISearch
  289. * @since 7.0.0
  290. */
  291. public function getSearch();
  292. /**
  293. * Get the certificate manager for the user
  294. *
  295. * @param string $userId (optional) if not specified the current loggedin user is used, use null to get the system certificate manager
  296. * @return \OCP\ICertificateManager | null if $userId is null and no user is logged in
  297. * @since 8.0.0
  298. */
  299. public function getCertificateManager($userId = null);
  300. /**
  301. * Create a new event source
  302. *
  303. * @return \OCP\IEventSource
  304. * @since 8.0.0
  305. */
  306. public function createEventSource();
  307. /**
  308. * Returns an instance of the HTTP helper class
  309. * @return \OC\HTTPHelper
  310. * @deprecated 8.1.0 Use \OCP\Http\Client\IClientService
  311. * @since 8.0.0
  312. */
  313. public function getHTTPHelper();
  314. /**
  315. * Returns an instance of the HTTP client service
  316. *
  317. * @return \OCP\Http\Client\IClientService
  318. * @since 8.1.0
  319. */
  320. public function getHTTPClientService();
  321. /**
  322. * Get the active event logger
  323. *
  324. * @return \OCP\Diagnostics\IEventLogger
  325. * @since 8.0.0
  326. */
  327. public function getEventLogger();
  328. /**
  329. * Get the active query logger
  330. *
  331. * The returned logger only logs data when debug mode is enabled
  332. *
  333. * @return \OCP\Diagnostics\IQueryLogger
  334. * @since 8.0.0
  335. */
  336. public function getQueryLogger();
  337. /**
  338. * Get the manager for temporary files and folders
  339. *
  340. * @return \OCP\ITempManager
  341. * @since 8.0.0
  342. */
  343. public function getTempManager();
  344. /**
  345. * Get the app manager
  346. *
  347. * @return \OCP\App\IAppManager
  348. * @since 8.0.0
  349. */
  350. public function getAppManager();
  351. /**
  352. * Get the webroot
  353. *
  354. * @return string
  355. * @since 8.0.0
  356. */
  357. public function getWebRoot();
  358. /**
  359. * @return \OCP\Files\Config\IMountProviderCollection
  360. * @since 8.0.0
  361. */
  362. public function getMountProviderCollection();
  363. /**
  364. * Get the IniWrapper
  365. *
  366. * @return \bantu\IniGetWrapper\IniGetWrapper
  367. * @since 8.0.0
  368. */
  369. public function getIniWrapper();
  370. /**
  371. * @return \OCP\Command\IBus
  372. * @since 8.1.0
  373. */
  374. public function getCommandBus();
  375. /**
  376. * Creates a new mailer
  377. *
  378. * @return \OCP\Mail\IMailer
  379. * @since 8.1.0
  380. */
  381. public function getMailer();
  382. /**
  383. * Get the locking provider
  384. *
  385. * @return \OCP\Lock\ILockingProvider
  386. * @since 8.1.0
  387. */
  388. public function getLockingProvider();
  389. /**
  390. * @return \OCP\Files\Mount\IMountManager
  391. * @since 8.2.0
  392. */
  393. public function getMountManager();
  394. /**
  395. * Get the MimeTypeDetector
  396. *
  397. * @return \OCP\Files\IMimeTypeDetector
  398. * @since 8.2.0
  399. */
  400. public function getMimeTypeDetector();
  401. /**
  402. * Get the MimeTypeLoader
  403. *
  404. * @return \OCP\Files\IMimeTypeLoader
  405. * @since 8.2.0
  406. */
  407. public function getMimeTypeLoader();
  408. /**
  409. * Get the EventDispatcher
  410. *
  411. * @return EventDispatcherInterface
  412. * @since 8.2.0
  413. */
  414. public function getEventDispatcher();
  415. /**
  416. * Get the Notification Manager
  417. *
  418. * @return \OCP\Notification\IManager
  419. * @since 9.0.0
  420. */
  421. public function getNotificationManager();
  422. /**
  423. * @return \OCP\Comments\ICommentsManager
  424. * @since 9.0.0
  425. */
  426. public function getCommentsManager();
  427. /**
  428. * Returns the system-tag manager
  429. *
  430. * @return \OCP\SystemTag\ISystemTagManager
  431. *
  432. * @since 9.0.0
  433. */
  434. public function getSystemTagManager();
  435. /**
  436. * Returns the system-tag object mapper
  437. *
  438. * @return \OCP\SystemTag\ISystemTagObjectMapper
  439. *
  440. * @since 9.0.0
  441. */
  442. public function getSystemTagObjectMapper();
  443. /**
  444. * Returns the share manager
  445. *
  446. * @return \OCP\Share\IManager
  447. * @since 9.0.0
  448. */
  449. public function getShareManager();
  450. /**
  451. * @return IContentSecurityPolicyManager
  452. * @since 9.0.0
  453. */
  454. public function getContentSecurityPolicyManager();
  455. /**
  456. * @return \OCP\IDateTimeZone
  457. * @since 8.0.0
  458. */
  459. public function getDateTimeZone();
  460. /**
  461. * @return \OCP\IDateTimeFormatter
  462. * @since 8.0.0
  463. */
  464. public function getDateTimeFormatter();
  465. }