1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: namespace Xoops\Core\Service\Contract;
13:
14: use Xoops\Core\Service\Response;
15: use Xoops\Core\Service\Manager;
16:
17: /**
18: * Emoji service interface
19: *
20: * @category Xoops\Core\Service\Contract
21: * @package Xoops\Core
22: * @author Richard Griffith <richard@geekwright.com>
23: * @copyright 2015 The XOOPS Project https://github.com/XOOPS/XoopsCore
24: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
25: * @version Release: 1.0
26: * @link http://xoops.org
27: */
28: interface EmojiInterface
29: {
30: const MODE = Manager::MODE_EXCLUSIVE;
31:
32: /**
33: * renderEmoji - given a string of source text being built for display, perform any processing of Emoji
34: * references required to display the intended imagery.
35: *
36: * @param Response $response \Xoops\Core\Service\Response object
37: * @param string $buffer source text to be processed
38: *
39: * @return void - $response->value set to processed buffer
40: */
41: public function renderEmoji(Response $response, $buffer);
42:
43: /**
44: * getEmojiList - return a list of available emoji
45: *
46: * @param Response $response \Xoops\Core\Service\Response object
47: *
48: * @return void - $response->value set to array of emoji information
49: * 'name' => (string) code that represents the emoji, i.e. ":wink:"
50: * 'description' => (string) description
51: * 'rendered' => (string) valid HTML to display a rendering of the emoji
52: */
53: public function getEmojiList(Response $response);
54:
55: /**
56: * renderEmojiSelector - provide emoji selector support for editing
57: *
58: * This should return an HTML string that, when displayed, will provide a link to an emoji selector.
59: * Additionally, this should perform any additional tasks required to make the link function, such
60: * as adding script or stylesheet assets to the active theme.
61: *
62: * @param Response $response \Xoops\Core\Service\Response object
63: * @param string $identifier element identifier to receive emoji from selector
64: *
65: * @return void - $response->value (string) HTML code to launch the emoji selector, i.e. button
66: */
67: public function renderEmojiSelector(Response $response, $identifier);
68:
69: }
70: