src/ptouch.h

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