package zpl.model.element;

import zpl.constant.Correcion;
import zpl.constant.MagnificaFactor;
import zpl.constant.Modelo;
import zpl.model.PrinterOptions;
import zpl.utils.ZplUtils;

/**
 * Element to create a QR bar code
 *
 * Zpl command : ^BQ
 *
 * @author matthiasvets
 *
 */
public class ZebraQRBarCode extends ZebraBarCode {

    public ZebraQRBarCode(int positionX, int positionY, String text) {
        super(positionX, positionY, text);
    }

    public ZebraQRBarCode(int positionX, int positionY, String text, Modelo modelo, MagnificaFactor magnificaFactor, Correcion correcion) {
        super(positionX, positionY, text, modelo, magnificaFactor, correcion);
    }

    @Override
    public String getZplCode(PrinterOptions printerOptions) {
        StringBuilder zpl = getStartZplCodeBuilder();
        zpl.append(ZplUtils.zplCommandSautLigne("BQ", zebraRotation.getLetter(), modelo.getModelo(), magnificaFactor.getMagnificaFactor()));
        zpl.append("^FDM").append(correcion.getCorrecion());
        zpl.append(text);
        zpl.append(ZplUtils.zplCommandSautLigne("FS"));
        return zpl.toString();
    }

}
