| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Interface QRDataModeInterface |
| 5 |
* |
| 6 |
* @created 01.12.2015 |
| 7 |
* @author Smiley <[email protected]> |
| 8 |
* @copyright 2015 Smiley |
| 9 |
* @license MIT |
| 10 |
*/ |
| 11 |
namespace WCPOS\Vendor\chillerlan\QRCode\Data; |
| 12 |
|
| 13 |
use WCPOS\Vendor\chillerlan\QRCode\Common\BitBuffer; |
| 14 |
/** |
| 15 |
* Specifies the methods reqired for the data modules (Number, Alphanum, Byte and Kanji) |
| 16 |
*/ |
| 17 |
interface QRDataModeInterface |
| 18 |
{ |
| 19 |
/** |
| 20 |
* the current data mode: Number, Alphanum, Kanji, Hanzi, Byte, ECI |
| 21 |
* |
| 22 |
* tbh I hate this constant here, but it's part of the interface, so I can't just declare it in the abstract class. |
| 23 |
* (phan will complain about a PhanAccessOverridesFinalConstant) |
| 24 |
* |
| 25 |
* @see https://wiki.php.net/rfc/final_class_const |
| 26 |
* |
| 27 |
* @var int |
| 28 |
* @see \chillerlan\QRCode\Common\Mode |
| 29 |
* @internal do not call this constant from the interface, but rather from one of the child classes |
| 30 |
*/ |
| 31 |
public const DATAMODE = -1; |
| 32 |
/** |
| 33 |
* retruns the length in bits of the data string |
| 34 |
*/ |
| 35 |
public function getLengthInBits() : int; |
| 36 |
/** |
| 37 |
* encoding conversion helper |
| 38 |
* |
| 39 |
* @throws \chillerlan\QRCode\Data\QRCodeDataException |
| 40 |
*/ |
| 41 |
public static function convertEncoding(string $string) : string; |
| 42 |
/** |
| 43 |
* checks if the given string qualifies for the encoder module |
| 44 |
*/ |
| 45 |
public static function validateString(string $string) : bool; |
| 46 |
/** |
| 47 |
* writes the actual data string to the BitBuffer, uses the given version to determine the length bits |
| 48 |
* |
| 49 |
* @see \chillerlan\QRCode\Data\QRData::writeBitBuffer() |
| 50 |
*/ |
| 51 |
public function write(BitBuffer $bitBuffer, int $versionNumber) : QRDataModeInterface; |
| 52 |
/** |
| 53 |
* reads a segment from the BitBuffer and decodes in the current data mode |
| 54 |
*/ |
| 55 |
public static function decodeSegment(BitBuffer $bitBuffer, int $versionNumber) : string; |
| 56 |
} |
| 57 |
|