summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-08-10 10:41:59 +0200
committerJulius Härtl <jus@bitgrid.net>2022-08-31 16:20:05 +0200
commitde3e541fde5c1ac2f71368127474341e730e4030 (patch)
tree9b4a925f6df1c5c6c3d80b89ff9aae9818461075 /lib/public
parent650b809a03017bd624fe31c92387c91c1122a393 (diff)
downloadnextcloud-server-de3e541fde5c1ac2f71368127474341e730e4030.tar.gz
nextcloud-server-de3e541fde5c1ac2f71368127474341e730e4030.zip
API for fetching reference metadata
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Collaboration/Reference/IReference.php31
-rw-r--r--lib/public/Collaboration/Reference/IReferenceManager.php31
-rw-r--r--lib/public/Collaboration/Reference/IReferenceProvider.php27
3 files changed, 89 insertions, 0 deletions
diff --git a/lib/public/Collaboration/Reference/IReference.php b/lib/public/Collaboration/Reference/IReference.php
new file mode 100644
index 00000000000..1f4bf04c796
--- /dev/null
+++ b/lib/public/Collaboration/Reference/IReference.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace OCP\Collaboration\Reference;
+
+use OC\Collaboration\Reference\Reference;
+
+interface IReference {
+ public function getRichObject(): array;
+
+ public static function toCache(Reference $reference): array;
+}
diff --git a/lib/public/Collaboration/Reference/IReferenceManager.php b/lib/public/Collaboration/Reference/IReferenceManager.php
new file mode 100644
index 00000000000..baf75d74838
--- /dev/null
+++ b/lib/public/Collaboration/Reference/IReferenceManager.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace OCP\Collaboration\Reference;
+
+interface IReferenceManager {
+ public function extractReferences(string $text): array;
+
+ public function resolveReference(string $reference): ?IReference;
+
+ public function registerReferenceProvider(IReferenceProvider $provider): void;
+}
diff --git a/lib/public/Collaboration/Reference/IReferenceProvider.php b/lib/public/Collaboration/Reference/IReferenceProvider.php
new file mode 100644
index 00000000000..232874709c2
--- /dev/null
+++ b/lib/public/Collaboration/Reference/IReferenceProvider.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace OCP\Collaboration\Reference;
+
+interface IReferenceProvider {
+ public function resolveReference(string $referenceText): ?IReference;
+}