summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-03 12:54:37 +0200
committernpmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>2020-08-03 11:26:03 +0000
commit1a1b3e20e470a945dd9f5fab1d99174b10cbb141 (patch)
treeaacff8872bcfd47685e9a9fb3e5e3a423e498f59 /lib/public
parent4987fe9a51f0b889d2b99428c967014d95bb13ae (diff)
downloadnextcloud-server-1a1b3e20e470a945dd9f5fab1d99174b10cbb141.tar.gz
nextcloud-server-1a1b3e20e470a945dd9f5fab1d99174b10cbb141.zip
Fix unified search
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Search/ASearchResultEntry.php22
-rw-r--r--lib/public/Search/IProvider.php11
2 files changed, 32 insertions, 1 deletions
diff --git a/lib/public/Search/ASearchResultEntry.php b/lib/public/Search/ASearchResultEntry.php
index 45d62525abd..584ae79de4d 100644
--- a/lib/public/Search/ASearchResultEntry.php
+++ b/lib/public/Search/ASearchResultEntry.php
@@ -69,21 +69,39 @@ abstract class ASearchResultEntry implements JsonSerializable {
protected $resourceUrl;
/**
+ * @var string
+ * @since 20.0.0
+ */
+ protected $iconClass;
+
+ /**
+ * @var boolean
+ * @since 20.0.0
+ */
+ protected $rounded;
+
+ /**
* @param string $thumbnailUrl a relative or absolute URL to the thumbnail or icon of the entry
* @param string $title a main title of the entry
* @param string $subline the secondary line of the entry
* @param string $resourceUrl the URL where the user can find the detail, like a deep link inside the app
+ * @param string $iconClass the icon class fallback
+ * @param boolean $rounded is the thumbnail rounded
*
* @since 20.0.0
*/
public function __construct(string $thumbnailUrl,
string $title,
string $subline,
- string $resourceUrl) {
+ string $resourceUrl,
+ string $iconClass = '',
+ bool $rounded = false) {
$this->thumbnailUrl = $thumbnailUrl;
$this->title = $title;
$this->subline = $subline;
$this->resourceUrl = $resourceUrl;
+ $this->iconClass = $iconClass;
+ $this->rounded = $rounded;
}
/**
@@ -97,6 +115,8 @@ abstract class ASearchResultEntry implements JsonSerializable {
'title' => $this->title,
'subline' => $this->subline,
'resourceUrl' => $this->resourceUrl,
+ 'iconClass' => $this->iconClass,
+ 'rounded' => $this->rounded,
];
}
}
diff --git a/lib/public/Search/IProvider.php b/lib/public/Search/IProvider.php
index 080f5089f1f..bdff0a66e0e 100644
--- a/lib/public/Search/IProvider.php
+++ b/lib/public/Search/IProvider.php
@@ -54,6 +54,17 @@ interface IProvider {
public function getId(): string;
/**
+ * Get the translated name of this search provider
+ *
+ * Example: 'Mail', 'Contacts'...
+ *
+ * @return string
+ *
+ * @since 20.0.0
+ */
+ public function getName(): string;
+
+ /**
* Find matching search entries in an app
*
* Search results can either be a complete list of all the matches the app can