aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/App/Events
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/App/Events')
-rw-r--r--lib/public/App/Events/AppDisableEvent.php36
-rw-r--r--lib/public/App/Events/AppEnableEvent.php47
-rw-r--r--lib/public/App/Events/AppUpdateEvent.php34
3 files changed, 117 insertions, 0 deletions
diff --git a/lib/public/App/Events/AppDisableEvent.php b/lib/public/App/Events/AppDisableEvent.php
new file mode 100644
index 00000000000..5d16d42785e
--- /dev/null
+++ b/lib/public/App/Events/AppDisableEvent.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\App\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * This event is triggered when an app is disabled.
+ *
+ * @since 27.0.0
+ */
+class AppDisableEvent extends Event {
+ private string $appId;
+
+ /**
+ * @since 27.0.0
+ */
+ public function __construct(string $appId) {
+ parent::__construct();
+
+ $this->appId = $appId;
+ }
+
+ /**
+ * @since 27.0.0
+ */
+ public function getAppId(): string {
+ return $this->appId;
+ }
+}
diff --git a/lib/public/App/Events/AppEnableEvent.php b/lib/public/App/Events/AppEnableEvent.php
new file mode 100644
index 00000000000..fe1523d6a83
--- /dev/null
+++ b/lib/public/App/Events/AppEnableEvent.php
@@ -0,0 +1,47 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\App\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * This event is triggered when an app is enabled.
+ *
+ * @since 27.0.0
+ */
+class AppEnableEvent extends Event {
+ private string $appId;
+ /** @var string[] */
+ private array $groupIds;
+
+ /**
+ * @param string[] $groupIds
+ * @since 27.0.0
+ */
+ public function __construct(string $appId, array $groupIds = []) {
+ parent::__construct();
+
+ $this->appId = $appId;
+ $this->groupIds = $groupIds;
+ }
+
+ /**
+ * @since 27.0.0
+ */
+ public function getAppId(): string {
+ return $this->appId;
+ }
+
+ /**
+ * @since 27.0.0
+ */
+ public function getGroupIds(): array {
+ return $this->groupIds;
+ }
+}
diff --git a/lib/public/App/Events/AppUpdateEvent.php b/lib/public/App/Events/AppUpdateEvent.php
new file mode 100644
index 00000000000..2cf59ff7949
--- /dev/null
+++ b/lib/public/App/Events/AppUpdateEvent.php
@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\App\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * This event is triggered when an app is updated.
+ *
+ * @since 27.0.0
+ */
+class AppUpdateEvent extends Event {
+ /**
+ * @since 27.0.0
+ */
+ public function __construct(
+ private readonly string $appId,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 27.0.0
+ */
+ public function getAppId(): string {
+ return $this->appId;
+ }
+}