summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-02-02 18:19:16 +0100
committerRobin Appelman <robin@icewind.nl>2017-02-28 14:24:18 +0100
commit706131b394eef4d346f8019b4978f9a735139b03 (patch)
tree5ae8a1769ebb073f29b106d3a4af1bcccf3d544f /lib/public
parentb5a6f03362794460222a1fc2d949882884df249d (diff)
downloadnextcloud-server-706131b394eef4d346f8019b4978f9a735139b03.tar.gz
nextcloud-server-706131b394eef4d346f8019b4978f9a735139b03.zip
add icewind/searchdav
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Files/Search/ISearchBinaryOperator.php46
-rw-r--r--lib/public/Files/Search/ISearchComparison.php54
-rw-r--r--lib/public/Files/Search/ISearchOperator.php26
-rw-r--r--lib/public/Files/Search/ISearchOrder.php46
-rw-r--r--lib/public/Files/Search/ISearchQuery.php33
5 files changed, 205 insertions, 0 deletions
diff --git a/lib/public/Files/Search/ISearchBinaryOperator.php b/lib/public/Files/Search/ISearchBinaryOperator.php
new file mode 100644
index 00000000000..248e3de56b8
--- /dev/null
+++ b/lib/public/Files/Search/ISearchBinaryOperator.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @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\Files\Search;
+
+interface ISearchBinaryOperator extends ISearchOperator {
+ const OPERATOR_AND = 'and';
+ const OPERATOR_OR = 'or';
+ const OPERATOR_NOT = 'not';
+
+ /**
+ * The type of binary operator
+ *
+ * One of the ISearchBinaryOperator::OPERATOR_* constants
+ *
+ * @return string
+ */
+ public function getType();
+
+ /**
+ * The arguments for the binary operator
+ *
+ * One argument for the 'not' operator and two for 'and' and 'or'
+ *
+ * @return ISearchOperator[]
+ */
+ public function getArguments();
+}
diff --git a/lib/public/Files/Search/ISearchComparison.php b/lib/public/Files/Search/ISearchComparison.php
new file mode 100644
index 00000000000..05342218616
--- /dev/null
+++ b/lib/public/Files/Search/ISearchComparison.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @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\Files\Search;
+
+interface ISearchComparison extends ISearchOperator {
+ const COMPARE_EQUAL = 'eq';
+ const COMPARE_GREATER_THAN = 'gt';
+ const COMPARE_GREATER_THAN_EQUAL = 'gte';
+ const COMPARE_LESS_THAN = 'lt';
+ const COMPARE_LESS_THAN_EQUAL = 'lte';
+ const COMPARE_LIKE = 'like';
+
+ /**
+ * Get the type of comparison, one of the ISearchComparison::COMPARE_* constants
+ *
+ * @return string
+ */
+ public function getType();
+
+ /**
+ * Get the name of the field to compare with
+ *
+ * i.e. 'size', 'name' or 'mimetype'
+ *
+ * @return string
+ */
+ public function getField();
+
+ /**
+ * Get the value to compare the field with
+ *
+ * @return string|integer|\DateTime
+ */
+ public function getValue();
+}
diff --git a/lib/public/Files/Search/ISearchOperator.php b/lib/public/Files/Search/ISearchOperator.php
new file mode 100644
index 00000000000..fc1db57f4ca
--- /dev/null
+++ b/lib/public/Files/Search/ISearchOperator.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @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\Files\Search;
+
+interface ISearchCondition {
+
+}
diff --git a/lib/public/Files/Search/ISearchOrder.php b/lib/public/Files/Search/ISearchOrder.php
new file mode 100644
index 00000000000..1abfd7506d5
--- /dev/null
+++ b/lib/public/Files/Search/ISearchOrder.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @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\Files\Search;
+
+/**
+ * @since 12.0.0
+ */
+interface ISearchOrder {
+ const DIRECTION_ASCENDING = 'asc';
+ const DIRECTION_DESCENDING = 'desc';
+
+ /**
+ * The direction to sort in, either ISearchOrder::DIRECTION_ASCENDING or ISearchOrder::DIRECTION_DESCENDING
+ *
+ * @return string
+ * @since 12.0.0
+ */
+ public function getDirection();
+
+ /**
+ * The field to sort on
+ *
+ * @return string
+ * @since 12.0.0
+ */
+ public function getField();
+}
diff --git a/lib/public/Files/Search/ISearchQuery.php b/lib/public/Files/Search/ISearchQuery.php
new file mode 100644
index 00000000000..f9c07533a1e
--- /dev/null
+++ b/lib/public/Files/Search/ISearchQuery.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @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\Files\Search;
+
+/**
+ * @since 12.0.0
+ */
+interface ISearchQuery {
+ /**
+ * @return ISearchOperator
+ * @since 12.0.0
+ */
+ public function getSearchOperation();
+}