Updated to ManiaLink v3

This commit is contained in:
Jocy Wolff
2017-03-25 18:40:15 +01:00
parent 1010c1db6b
commit 120a0e2169
133 changed files with 16194 additions and 8949 deletions

View File

@ -6,52 +6,66 @@ namespace FML\Types;
* Interface for Elements that support the action attribute
*
* @author steeffeen
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Actionable {
/*
* Constants
*/
const ACTION_0 = '0';
const ACTION_BACK = 'back';
const ACTION_ENTER = 'enter';
const ACTION_HOME = 'home';
const ACTION_MENU_SOLO = 'menu_solo';
const ACTION_MENU_COMPETITIONS = 'menu_competitions';
const ACTION_MENU_LOCAL = 'menu_local';
const ACTION_MENU_INTERNET = 'menu_internet';
const ACTION_MENU_EDITORS = 'menu_editors';
const ACTION_MENU_PROFILE = 'menu_profile';
const ACTION_QUIT = 'quit';
const ACTION_QUITSERVER = 'maniaplanet:quitserver';
const ACTION_SAVEREPLAY = 'maniaplanet:savereplay';
const ACTION_TOGGLESPEC = 'maniaplanet:togglespec';
const ACTIONKEY_F5 = 1;
const ACTIONKEY_F6 = 2;
const ACTIONKEY_F7 = 3;
const ACTIONKEY_F8 = 4;
interface Actionable
{
/**
* Set action
*
* @param string $action Action name
* @return static
*/
public function setAction($action);
/*
* Constants
*/
const ACTION_0 = '0';
const ACTION_BACK = 'back';
const ACTION_ENTER = 'enter';
const ACTION_HOME = 'home';
const ACTION_MENU_SOLO = 'menu_solo';
const ACTION_MENU_COMPETITIONS = 'menu_competitions';
const ACTION_MENU_LOCAL = 'menu_local';
const ACTION_MENU_INTERNET = 'menu_internet';
const ACTION_MENU_EDITORS = 'menu_editors';
const ACTION_MENU_PROFILE = 'menu_profile';
const ACTION_QUIT = 'quit';
const ACTION_QUITSERVER = 'maniaplanet:quitserver';
const ACTION_SAVEREPLAY = 'maniaplanet:savereplay';
const ACTION_TOGGLESPEC = 'maniaplanet:togglespec';
const ACTIONKEY_F5 = 1;
const ACTIONKEY_F6 = 2;
const ACTIONKEY_F7 = 3;
const ACTIONKEY_F8 = 4;
/**
* Get the assigned action
*
* @return string
*/
public function getAction();
/**
* Set the action
*
* @api
* @param string $action Action name
* @return static
*/
public function setAction($action);
/**
* Get the action
*
* @api
* @return string
*/
public function getAction();
/**
* Get the action key
*
* @api
* @return int
*/
public function getActionKey();
/**
* Set the action key
*
* @api
* @param int $actionKey Action key
* @return static
*/
public function setActionKey($actionKey);
/**
* Set action key
*
* @param int $actionKey Action key
* @return static
*/
public function setActionKey($actionKey);
}

View File

@ -0,0 +1,32 @@
<?php
namespace FML\Types;
/**
* Interface for Elements with background color attribute
*
* @author steeffeen
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface BackgroundColorable
{
/**
* Get the background color
*
* @api
* @return string
*/
public function getBackgroundColor();
/**
* Set the background color
*
* @api
* @param string $backgroundColor Background color
* @return static
*/
public function setBackgroundColor($backgroundColor);
}

View File

@ -1,21 +0,0 @@
<?php
namespace FML\Types;
/**
* Interface for Elements with background color attribute
*
* @author steeffeen
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface BgColorable {
/**
* Set background color
*
* @param string $bgColor Background color
* @return static
*/
public function setBgColor($bgColor);
}

View File

@ -0,0 +1,32 @@
<?php
namespace FML\Types;
/**
* Interface for Elements with color attribute
*
* @author steeffeen
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Colorable
{
/**
* Get the color
*
* @api
* @return string
*/
public function getColor();
/**
* Set the color
*
* @api
* @param string $color Color
* @return static
*/
public function setColor($color);
}

View File

@ -8,39 +8,61 @@ use FML\Elements\Format;
* Interface for Element being able to contain other Controls
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Container {
interface Container
{
/**
* Add a new child Element
*
* @param Renderable $child Child Control to add
* @return static
*/
public function add(Renderable $child);
/**
* Get the children
*
* @api
* @return Renderable[]
*/
public function getChildren();
/**
* Remove all children
*
* @return static
*/
public function removeChildren();
/**
* Add a new child
*
* @api
* @param Renderable $child Child Control to add
* @return static
*/
public function addChild(Renderable $child);
/**
* Set the Format object of the Container
*
* @param Format $format New Format object
* @return static
*/
public function setFormat(Format $format);
/**
* Add new children
*
* @api
* @param Renderable[] $children Child Controls to add
* @return static
*/
public function addChildren(array $children);
/**
* Remove all children
*
* @api
* @return static
*/
public function removeAllChildren();
/**
* Get the Format
*
* @api
* @return Format
*/
public function getFormat();
/**
* Set the Format
*
* @api
* @param Format $format New Format
* @return static
*/
public function setFormat(Format $format = null);
/**
* Get the Format object of the Container
*
* @param bool $createIfEmpty (optional) Whether the Format object should be created if it's not set
* @return \FML\Elements\Format
*/
public function getFormat($createIfEmpty = true);
}

View File

@ -0,0 +1,39 @@
<?php
namespace FML\Types;
/**
* Interface for identifiable Elements
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Identifiable
{
/**
* Get the Id
*
* @api
* @return string
*/
public function getId();
/**
* Set the Id
*
* @api
* @param string $id ID
* @return static
*/
public function setId($id);
/**
* Check and return the Id
*
* @return string
*/
public function checkId();
}

View File

@ -0,0 +1,32 @@
<?php
namespace FML\Types;
/**
* Interface for Elements with image attribute
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Imageable
{
/**
* Get the image url
*
* @api
* @return string
*/
public function getImageUrl();
/**
* Set the image url
*
* @api
* @param string $imageUrl Image url
* @return static
*/
public function setImageUrl($imageUrl);
}

View File

@ -6,40 +6,78 @@ namespace FML\Types;
* Interface for Elements with url attributes
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Linkable {
interface Linkable
{
/**
* Set url
*
* @param string $url Link url
* @return static
*/
public function setUrl($url);
/**
* Get the url
*
* @api
* @return string
*/
public function getUrl();
/**
* Set url id to use from Dico
*
* @param string $urlId Url id
* @return static
*/
public function setUrlId($urlId);
/**
* Set the url
*
* @api
* @param string $url Link url
* @return static
*/
public function setUrl($url);
/**
* Set manialink
*
* @param string $manialink Manialink name
* @return static
*/
public function setManialink($manialink);
/**
* Get the url id to use from Dico
*
* @api
* @return string
*/
public function getUrlId();
/**
* Set the url id to use from Dico
*
* @api
* @param string $urlId Url id
* @return static
*/
public function setUrlId($urlId);
/**
* Get the manialink
*
* @api
* @return string
*/
public function getManialink();
/**
* Set the manialink
*
* @api
* @param string $manialink Manialink name
* @return static
*/
public function setManialink($manialink);
/**
* Get the manialink id to use from Dico
*
* @api
* @return string
*/
public function getManialinkId();
/**
* Set the manialink id to use from Dico
*
* @api
* @param string $manialinkId Manialink id
* @return static
*/
public function setManialinkId($manialinkId);
/**
* Set manialink id to use from Dico
*
* @param string $manialinkId Manialink id
* @return static
*/
public function setManialinkId($manialinkId);
}

View File

@ -0,0 +1,66 @@
<?php
namespace FML\Types;
/**
* Interface for Elements with multi line features
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface MultiLineable
{
/**
* Get auto new line
*
* @api
* @return bool
*/
public function getAutoNewLine();
/**
* Set auto new line
*
* @api
* @param bool $autoNewLine If the Element should insert new lines automatically
* @return static
*/
public function setAutoNewLine($autoNewLine);
/**
* Get line spacing
*
* @api
* @return float
*/
public function getLineSpacing();
/**
* Set line spacing
*
* @api
* @param float $lineSpacing Line spacing
* @return static
*/
public function setLineSpacing($lineSpacing);
/**
* Get the maximum number of lines
*
* @api
* @return int
*/
public function getMaxLines();
/**
* Set the maximum number of lines
*
* @api
* @param int $maxLines Maximum number of lines
* @return static
*/
public function setMaxLines($maxLines);
}

View File

@ -5,17 +5,32 @@ namespace FML\Types;
/**
* Interface for Elements with autonewline attribute
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
* @deprecated Use MultiLineable
* @see MultiLineable
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface NewLineable {
interface NewLineable
{
/**
* Get auto new line
*
* @api
* @deprecated
* @return bool
*/
public function getAutoNewLine();
/**
* Set auto new line
*
* @api
* @deprecated
* @param bool $autoNewLine If the Element should insert new lines automatically
* @return static
*/
public function setAutoNewLine($autoNewLine);
/**
* Set auto new line
*
* @param bool $autoNewLine Whether the Control should insert new lines automatically
* @return static
*/
public function setAutoNewLine($autoNewLine);
}

View File

@ -6,56 +6,112 @@ namespace FML\Types;
* Interface for Elements with media attributes
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Playable {
interface Playable
{
/**
* Set data
*
* @param string $data Media url
* @return static
*/
public function setData($data);
/**
* Get the data url
*
* @api
* @return string
*/
public function getData();
/**
* Set data id to use from Dico
*
* @param string $dataId Data id
* @return static
*/
public function setDataId($dataId);
/**
* Set the data url
*
* @api
* @param string $data Data url
* @return static
*/
public function setData($data);
/**
* Set play
*
* @param bool $play Whether the Control should start playing automatically
* @return static
*/
public function setPlay($play);
/**
* Get the data id to use from Dico
*
* @api
* @return string
*/
public function getDataId();
/**
* Set looping
*
* @param bool $looping Whether the Control should play looping
* @return static
*/
public function setLooping($looping);
/**
* Set the data id to use from Dico
*
* @api
* @param string $dataId Data id
* @return static
*/
public function setDataId($dataId);
/**
* Set music
*
* @param bool $music Whether the Control represents background music
* @return static
*/
public function setMusic($music);
/**
* Get play
*
* @api
* @return bool
*/
public function getPlay();
/**
* Set play
*
* @api
* @param bool $play If the Control should start playing automatically
* @return static
*/
public function setPlay($play);
/**
* Get looping
*
* @api
* @return bool
*/
public function getLooping();
/**
* Set looping
*
* @api
* @param bool $looping If the Control should play looping
* @return static
*/
public function setLooping($looping);
/**
* Get music
*
* @api
* @return bool
*/
public function getMusic();
/**
* Set music
*
* @api
* @param bool $music If the Control represents background music
* @return static
*/
public function setMusic($music);
/**
* Get the volume
*
* @api
* @return float
*/
public function getVolume();
/**
* Set the volume
*
* @api
* @param float $volume Media volume
* @return static
*/
public function setVolume($volume);
/**
* Set volume
*
* @param float $volume Media volume
* @return static
*/
public function setVolume($volume);
}

View File

@ -6,16 +6,18 @@ namespace FML\Types;
* Interface for renderable Elements
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Renderable {
interface Renderable
{
/**
* Render the XML element
*
* @param \DOMDocument $domDocument DOMDocument for which the XML element should be rendered
* @return \DOMElement
*/
public function render(\DOMDocument $domDocument);
/**
* Render the XML element
*
* @param \DOMDocument $domDocument DOMDocument for which the XML element should be rendered
* @return \DOMElement
*/
public function render(\DOMDocument $domDocument);
}

View File

@ -2,19 +2,23 @@
namespace FML\Types;
use FML\Script\Features\ScriptFeature;
/**
* Interface for Elements supporting ScriptFeatures
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface ScriptFeatureable {
interface ScriptFeatureable
{
/**
* Get the Script Features
*
* @return ScriptFeature[]
*/
public function getScriptFeatures();
/**
* Get the assigned Script Features of the Element
*
* @return \FML\Script\Features\ScriptFeature[]
*/
public function getScriptFeatures();
}

View File

@ -3,19 +3,65 @@
namespace FML\Types;
/**
* Interface for Elements with scriptevents attribute
* Interface for Elements with script event attributes
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Scriptable {
interface Scriptable
{
/**
* Get script events
*
* @api
* @return bool
*/
public function getScriptEvents();
/**
* Set script events
*
* @api
* @param bool $scriptEvents If script events should be enabled
* @return static
*/
public function setScriptEvents($scriptEvents);
/**
* Get script action
*
* @api
* @return string
*/
public function getScriptAction();
/**
* Set script action
*
* @api
* @param string $scriptAction Script action to be triggered
* @param string[] $scriptActionParameters (optional) Script action parameters
* @return static
*/
public function setScriptAction($scriptAction, array $scriptActionParameters = null);
/**
* Get script action parameters
*
* @api
* @return string[]
*/
public function getScriptActionParameters();
/**
* Set script action parameters
*
* @api
* @param string[] $scriptActionParameters (optional) Script action parameters
* @return static
*/
public function setScriptActionParameters(array $scriptActionParameters = null);
/**
* Set script events
*
* @param bool $scriptEvents Whether script events should be enabled
* @return static
*/
public function setScriptEvents($scriptEvents);
}

View File

@ -6,16 +6,27 @@ namespace FML\Types;
* Interface for Elements with style attribute
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Styleable {
interface Styleable
{
/**
* Get the style
*
* @api
* @return string
*/
public function getStyle();
/**
* Set the style
*
* @api
* @param string $style Style name
* @return static
*/
public function setStyle($style);
/**
* Set style
*
* @param string $style Style name
* @return static
*/
public function setStyle($style);
}

View File

@ -6,25 +6,37 @@ namespace FML\Types;
* Interface for Elements with substyle attribute
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface SubStyleable {
interface SubStyleable
{
/**
* Set sub style
*
* @param string $subStyle SubStyle name
* @return static
*/
public function setSubStyle($subStyle);
/**
* Get the sub style
*
* @api
* @return string
*/
public function getSubStyle();
/**
* Set the sub style
*
* @api
* @param string $subStyle SubStyle name
* @return static
*/
public function setSubStyle($subStyle);
/**
* Set the style and the sub style
*
* @api
* @param string $style Style name
* @param string $subStyle SubStyle name
* @return static
*/
public function setStyles($style, $subStyle);
/**
* Set style and sub style
*
* @param string $style Style name
* @param string $subStyle SubStyle name
* @return static
*/
public function setStyles($style, $subStyle);
}

View File

@ -6,48 +6,95 @@ namespace FML\Types;
* Interface for Elements with formatable text
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface TextFormatable {
interface TextFormatable
{
/**
* Set text size
*
* @param int $textSize Text size
* @return static
*/
public function setTextSize($textSize);
/**
* Get the text size
*
* @api
* @return int
*/
public function getTextSize();
/**
* Set text font
*
* @param string $textFont
* @return static
*/
public function setTextFont($textFont);
/**
* Set the text size
*
* @api
* @param int $textSize Text size
* @return static
*/
public function setTextSize($textSize);
/**
* Set text color
*
* @param string $textColor Text color
* @return static
*/
public function setTextColor($textColor);
/**
* Get the text font
*
* @api
* @return string
*/
public function getTextFont();
/**
* Set area color
*
* @param string $areaColor Area color
* @return static
*/
public function setAreaColor($areaColor);
/**
* Set the text font
*
* @api
* @param string $textFont
* @return static
*/
public function setTextFont($textFont);
/**
* Get the text color
*
* @api
* @return string
*/
public function getTextColor();
/**
* Set the text color
*
* @api
* @param string $textColor Text color
* @return static
*/
public function setTextColor($textColor);
/**
* Get the area color
*
* @api
* @return string
*/
public function getAreaColor();
/**
* Set the area color
*
* @api
* @param string $areaColor Area color
* @return static
*/
public function setAreaColor($areaColor);
/**
* Get the area focus color
*
* @api
* @return string
*/
public function getAreaFocusColor();
/**
* Set the area focus color
*
* @api
* @param string $areaFocusColor Area focus color
* @return static
*/
public function setAreaFocusColor($areaFocusColor);
/**
* Set area focus color
*
* @param string $areaFocusColor Area focus color
* @return static
*/
public function setAreaFocusColor($areaFocusColor);
}