1<?php
2/**
3 * @author Joas Schilling <coding@schilljs.com>
4 *
5 * @copyright Copyright (c) 2018, ownCloud GmbH
6 * @license AGPL-3.0
7 *
8 * This code is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License, version 3,
10 * as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License, version 3,
18 * along with this program.  If not, see <http://www.gnu.org/licenses/>
19 *
20 */
21
22/**
23 * Public interface of ownCloud for apps to use.
24 * Activity/IEvent interface
25 */
26
27// use OCP namespace for all classes that are considered public.
28// This means that they should be used by apps instead of the internal ownCloud classes
29namespace OCP\Activity;
30
31/**
32 * Interface IEvent
33 *
34 * @package OCP\Activity
35 * @since 8.2.0
36 */
37interface IEvent {
38	public const AUTOMATION_AUTHOR = 'auto:automation';
39
40	/**
41	 * Set the app of the activity
42	 *
43	 * @param string $app
44	 * @return IEvent
45	 * @since 8.2.0
46	 */
47	public function setApp($app);
48
49	/**
50	 * Set the type of the activity
51	 *
52	 * @param string $type
53	 * @return IEvent
54	 * @since 8.2.0
55	 */
56	public function setType($type);
57
58	/**
59	 * Set the affected user of the activity
60	 *
61	 * @param string $user
62	 * @return IEvent
63	 * @since 8.2.0
64	 */
65	public function setAffectedUser($user);
66
67	/**
68	 * Set the author of the activity
69	 *
70	 * @param string $author
71	 * @return IEvent
72	 * @since 8.2.0
73	 */
74	public function setAuthor($author);
75
76	/**
77	 * Set the author of the activity
78	 *
79	 * @param int $timestamp
80	 * @return IEvent
81	 * @since 8.2.0
82	 */
83	public function setTimestamp($timestamp);
84
85	/**
86	 * Set the subject of the activity
87	 *
88	 * @param string $subject
89	 * @param array $parameters
90	 * @return IEvent
91	 * @since 8.2.0
92	 */
93	public function setSubject($subject, array $parameters = []);
94
95	/**
96	 * Set the message of the activity
97	 *
98	 * @param string $message
99	 * @param array $parameters
100	 * @return IEvent
101	 * @since 8.2.0
102	 */
103	public function setMessage($message, array $parameters = []);
104
105	/**
106	 * Set the object of the activity
107	 *
108	 * @param string $objectType
109	 * @param int $objectId
110	 * @param string $objectName
111	 * @return IEvent
112	 * @since 8.2.0
113	 */
114	public function setObject($objectType, $objectId, $objectName = '');
115
116	/**
117	 * Set the link of the activity
118	 *
119	 * @param string $link
120	 * @return IEvent
121	 * @since 8.2.0
122	 */
123	public function setLink($link);
124
125	/**
126	 * @return string
127	 * @since 8.2.0
128	 */
129	public function getApp();
130
131	/**
132	 * @return string
133	 * @since 8.2.0
134	 */
135	public function getType();
136
137	/**
138	 * @return string
139	 * @since 8.2.0
140	 */
141	public function getAffectedUser();
142
143	/**
144	 * @return string
145	 * @since 8.2.0
146	 */
147	public function getAuthor();
148
149	/**
150	 * @return int
151	 * @since 8.2.0
152	 */
153	public function getTimestamp();
154
155	/**
156	 * @return string
157	 * @since 8.2.0
158	 */
159	public function getSubject();
160
161	/**
162	 * @return array
163	 * @since 8.2.0
164	 */
165	public function getSubjectParameters();
166
167	/**
168	 * @return string
169	 * @since 8.2.0
170	 */
171	public function getMessage();
172
173	/**
174	 * @return array
175	 * @since 8.2.0
176	 */
177	public function getMessageParameters();
178
179	/**
180	 * @return string
181	 * @since 8.2.0
182	 */
183	public function getObjectType();
184
185	/**
186	 * @return string
187	 * @since 8.2.0
188	 */
189	public function getObjectId();
190
191	/**
192	 * @return string
193	 * @since 8.2.0
194	 */
195	public function getObjectName();
196
197	/**
198	 * @return string
199	 * @since 8.2.0
200	 */
201	public function getLink();
202}
203