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

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