src/ptouch.h

changeset 14
088286f9e1e4
parent 9
ebce4a7615e9
child 16
57eff547e4f1
     1.1 --- a/src/ptouch.h	Wed Aug 05 15:02:31 2009 +0100
     1.2 +++ b/src/ptouch.h	Wed Aug 05 15:04:55 2009 +0100
     1.3 @@ -59,13 +59,25 @@
     1.4  /// Label image is too large for this label tape
     1.5  	PT_ERR_LABEL_TOO_WIDE		= -3,
     1.6  
     1.7 +/// Label has a length of zero
     1.8 +	PT_ERR_LABEL_ZERO_LENGTH	= -4,
     1.9 +
    1.10  /// Printer is not ready
    1.11 -	PT_ERR_PRINTER_NOT_READY	= -4
    1.12 +	PT_ERR_PRINTER_NOT_READY	= -5
    1.13  };
    1.14  
    1.15 +/*
    1.16 + * Job options
    1.17 + */
    1.18 +typedef enum {
    1.19 +/// Mirror -- mirror the printed label along the long edge
    1.20 +	PT_OPTION_MIRROR,
    1.21 +/// Auto-cutter -- enable or disable automatic label cutting
    1.22 +	PT_OPTION_AUTOCUT
    1.23 +} PT_E_OPTION;
    1.24  
    1.25  /**
    1.26 - * @brief	Initialise the printer
    1.27 + * @brief	Initialise the printer.
    1.28   * 
    1.29   * Initialises the printer and returns a pointer to a pt_Device struct
    1.30   * describing it.
    1.31 @@ -77,7 +89,7 @@
    1.32  pt_Device *pt_Initialise(char *path);
    1.33  
    1.34  /**
    1.35 - * @brief	Close a printer device
    1.36 + * @brief	Close a printer device.
    1.37   *
    1.38   * Closes the connection to the printer, and destroys the pt_Device struct.
    1.39   *
    1.40 @@ -86,7 +98,7 @@
    1.41  void pt_Close(pt_Device *dev);
    1.42  
    1.43  /**
    1.44 - * @brief	Get the current status of the printer
    1.45 + * @brief	Get the current status of the printer.
    1.46   *
    1.47   * Queries the printer for its current status, then returns the result.
    1.48   *
    1.49 @@ -97,7 +109,45 @@
    1.50  int pt_GetStatus(pt_Device *dev);
    1.51  
    1.52  /**
    1.53 - * @brief	Print one or more labels
    1.54 + * @brief	Set a job option for the next print job.
    1.55 + *
    1.56 + * Sets a job option (specified by <b>option</b>) for the next print job.
    1.57 + * These options include printer features like auto-cutting and mirroring
    1.58 + * of the label image.
    1.59 + *
    1.60 + * @param	dev		A pt_Device struct created by pt_Initialise.
    1.61 + * @param	option	One of the PT_OPTION_* constants specifying the parameter
    1.62 + * 	that is to be set.
    1.63 + * @param	value	The value to assign to the job option.
    1.64 + * @return	<b>PT_ERR_BAD_PARAMETER:</b> Either <b>dev</b> was equal to NULL,
    1.65 + * 	or the option value specified in <b>option</b> was invalid.<br>
    1.66 + * 	<b>PT_ERR_SUCCESS:</b> Operation completed successfully, the current value
    1.67 + * 	of the option parameter is now set to the contents of <b>value</b>.
    1.68 + */
    1.69 +int pt_SetOption(pt_Device *dev, PT_E_OPTION option, int value);
    1.70 +
    1.71 +/**
    1.72 + * @brief	Get the current value of a job option for the next print job.
    1.73 + *
    1.74 + * Returns the current value of a job option (specified by <b>option</b>)
    1.75 + * for the next print job.
    1.76 + * These options include printer features like auto-cutting and mirroring
    1.77 + * of the label image.
    1.78 + *
    1.79 + * @param	dev		A pt_Device struct created by pt_Initialise.
    1.80 + * @param	option	One of the PT_OPTION_* constants specifying the parameter
    1.81 + * 	that is to be returned.
    1.82 + * @param	value	A pointer to an <b>int</b> that will contain the value
    1.83 + * 	of the job option.
    1.84 + * @return	<b>PT_ERR_BAD_PARAMETER:</b> Either <b>dev</b> or <b>value</b> was
    1.85 + * 	equal to NULL, or the option value specified in <b>option</b> was invalid.<br>
    1.86 + * 	<b>PT_ERR_SUCCESS:</b> Operation completed successfully, the current value
    1.87 + * 	of the option parameter is now stored in <b>value</b>.
    1.88 + */
    1.89 +int pt_GetOption(pt_Device *dev, PT_E_OPTION option, int *value);
    1.90 +
    1.91 +/**
    1.92 + * @brief	Print one or more labels.
    1.93   *
    1.94   * Takes a pointer to an array of Libgd images, and prints each of them.
    1.95   *