2017-01-24 06:47:14 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @copyright 2017 Christoph Wurst <christoph@winzerhof-wurst.at>
|
|
|
|
*
|
2019-12-03 18:57:53 +00:00
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
2017-01-24 06:47:14 +00:00
|
|
|
*
|
|
|
|
* @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
|
2021-06-04 19:52:51 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2017-01-24 06:47:14 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
2019-12-03 18:57:53 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2017-01-24 06:47:14 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
namespace OC\Contacts\ContactsMenu\Actions;
|
|
|
|
|
|
|
|
use OCP\Contacts\ContactsMenu\ILinkAction;
|
|
|
|
|
|
|
|
class LinkAction implements ILinkAction {
|
2022-03-22 11:39:23 +00:00
|
|
|
private string $icon = '';
|
|
|
|
private string $name = '';
|
|
|
|
private string $href = '';
|
|
|
|
private int $priority = 10;
|
|
|
|
private string $appId = '';
|
2021-10-18 16:19:37 +00:00
|
|
|
|
2017-01-24 06:47:14 +00:00
|
|
|
/**
|
|
|
|
* @param string $icon absolute URI to an icon
|
|
|
|
*/
|
2023-06-25 08:26:58 +00:00
|
|
|
public function setIcon(string $icon): void {
|
2017-01-24 06:47:14 +00:00
|
|
|
$this->icon = $icon;
|
|
|
|
}
|
|
|
|
|
2023-06-25 08:26:58 +00:00
|
|
|
public function setName(string $name): void {
|
2017-01-24 06:47:14 +00:00
|
|
|
$this->name = $name;
|
|
|
|
}
|
|
|
|
|
2022-03-22 11:39:23 +00:00
|
|
|
public function getName(): string {
|
2017-01-24 06:47:14 +00:00
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
2023-06-25 08:26:58 +00:00
|
|
|
public function setPriority(int $priority): void {
|
2017-01-24 06:47:14 +00:00
|
|
|
$this->priority = $priority;
|
|
|
|
}
|
|
|
|
|
2022-03-22 11:39:23 +00:00
|
|
|
public function getPriority(): int {
|
2017-01-24 06:47:14 +00:00
|
|
|
return $this->priority;
|
|
|
|
}
|
|
|
|
|
2023-06-25 08:26:58 +00:00
|
|
|
public function setHref(string $href): void {
|
2017-01-24 06:47:14 +00:00
|
|
|
$this->href = $href;
|
|
|
|
}
|
|
|
|
|
2022-03-22 11:39:23 +00:00
|
|
|
public function getHref(): string {
|
2017-01-24 06:47:14 +00:00
|
|
|
return $this->href;
|
|
|
|
}
|
|
|
|
|
2021-10-18 16:19:37 +00:00
|
|
|
/**
|
|
|
|
* @since 23.0.0
|
|
|
|
*/
|
2023-06-25 08:26:58 +00:00
|
|
|
public function setAppId(string $appId): void {
|
2021-10-20 12:43:45 +00:00
|
|
|
$this->appId = $appId;
|
2021-10-18 16:19:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @since 23.0.0
|
|
|
|
*/
|
2021-10-20 12:43:45 +00:00
|
|
|
public function getAppId(): string {
|
|
|
|
return $this->appId;
|
2021-10-18 16:19:37 +00:00
|
|
|
}
|
|
|
|
|
2021-10-19 15:11:53 +00:00
|
|
|
public function jsonSerialize(): array {
|
2017-01-24 06:47:14 +00:00
|
|
|
return [
|
|
|
|
'title' => $this->name,
|
|
|
|
'icon' => $this->icon,
|
|
|
|
'hyperlink' => $this->href,
|
2021-10-20 12:43:45 +00:00
|
|
|
'appId' => $this->appId,
|
2017-01-24 06:47:14 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|