CAPS Universe documentation  1.0.4
All you need to know to be successful
Data Structures | Enumerations

Definitions related dealing with printers. More...

Data Structures

struct  caps_supported_mime_list
 

Enumerations

enum  caps_printing_provider_state {
  LIBCAPS_PP_STATE_UNKNOWN = 0 ,
  LIBCAPS_PP_STATE_INVISIBLE ,
  LIBCAPS_PP_STATE_STOPPED ,
  LIBCAPS_PP_STATE_IDLE ,
  LIBCAPS_PP_STATE_PREPARING ,
  LIBCAPS_PP_STATE_PROCESSING ,
  LIBCAPS_PP_STATE_PRINTING ,
  LIBCAPS_PP_STATE_SHUTDOWN ,
  LIBCAPS_PP_STATE_OFFLINE
}
 
enum  caps_printing_provider_reason {
  LIBCAPS_PP_REASON_NONE = 0x10U ,
  LIBCAPS_PP_REASON_ATTENTION ,
  LIBCAPS_PP_REASON_MEDIA_NEEDED ,
  LIBCAPS_PP_REASON_MEDIA_JAM ,
  LIBCAPS_PP_REASON_SHUTDOWN
}
 

Detailed Description

Each printer provider has a state and maybe a reason why it is in this state. And maybe a descriptive message (refer caps_cl_printer_state).

The states a printing provider can be in (refer caps_printing_provider_state):

InternalState

The LIBCAPS_PP_STATE_INVISIBLE is an internal state in the printing coordinator only. This state is used, when a printing provider starts to register itself, but the information about this provider is still incomplete at the printing coordinator. In this case it makes no sense to show this printing provider to any client. That's what the "invisible" means.

ActiveState

In these states a printer is visible to the public and clients can retrieve its information or start print jobs on it.

Note
After changing the state to one of these visible states, there is no way back to the invisible state again.

The LIBCAPS_PP_STATE_STOPPED state always means the printing provider/driver or its device is in a special state. Something prevents the printing provider/driver or its device from doing its job. In this state, the caps_printing_provider_reason gives some more hints what prevents the printing provider/driver/device from printing.

LIBCAPS_PP_STATE_IDLE means the printing provider/driver and its device just consume electrical power - and nothing else.

LIBCAPS_PP_STATE_PREPARING means the printing provider/driver is doing some preparation in order to make its device working. Waiting for warm up/wake up the sleeping device for example.

LIBCAPS_PP_STATE_PROCESSING means a page is being processed. It depends on the complexity of the page and the available processing power to render it, how long the printing provider is in this state.

LIBCAPS_PP_STATE_PRINTING means the printing provider transfers the data to the printer and expect a printed media after that.

Note
If a printing provider/driver is very verbose, it can change between LIBCAPS_PP_STATE_PROCESSING and LIBCAPS_PP_STATE_PRINTING at every page it renders. If it is less verbose, it might start with LIBCAPS_PP_STATE_PROCESSING for the first page and then switches to LIBCAPS_PP_STATE_PRINTING for the remaining pages of the print job.
If you monitor the printing provider, you can treat LIBCAPS_PP_STATE_PROCESSING and LIBCAPS_PP_STATE_PRINTING the same: the printing provider/driver and its device are doing their job.
The state of a printer can change from every state in this group to every other state of this group. There are no transition restrictions between them.

TearDownState

In these states a printer is still visible for a short period of time. It is possible for a client to retrieve the state of an offline printer exactly once for example. After this, the printer disappears forever.

Note
After changing the state to one of the tear down states, there is no way back to the active state again.

LIBCAPS_PP_STATE_SHUTDOWN means the printing provider is going offline right now. This is a visible state, e.g. it is still listed in the list of known printers.

LIBCAPS_PP_STATE_OFFLINE means this printing provider is already gone offline. Such a printer isn't listed in the list of known printers (refer caps_cl_printer_list_get()), you will get this state only on a specific request (e.g. you still know its unique ID).

Enumeration Type Documentation

◆ caps_printing_provider_state

The state a printing driver/provider can be in

Refer Printer State Definitions for details.

Enumerator
LIBCAPS_PP_STATE_UNKNOWN 

Not available to the public, so never seen by an external client

LIBCAPS_PP_STATE_INVISIBLE 

Not available to the public, so never seen by an external client

LIBCAPS_PP_STATE_STOPPED 

Available to the public, but doesn't accept jobs (paper empty for example)

LIBCAPS_PP_STATE_IDLE 

Nothing to do, waits for printing jobs

LIBCAPS_PP_STATE_PREPARING 

Is preparing to print (warming up for example)

LIBCAPS_PP_STATE_PROCESSING 

Is processing data (a page for example)

LIBCAPS_PP_STATE_PRINTING 

Is printing

LIBCAPS_PP_STATE_SHUTDOWN 

Tear down state: provider or printer is going offline

LIBCAPS_PP_STATE_OFFLINE 

Tear down state: printer is offline, not reachable

◆ caps_printing_provider_reason

The more detailed state reason description a printing provider can be in

These values makes sense if the caps_printing_provider_state is LIBCAPS_PP_STATE_STOPPED

Enumerator
LIBCAPS_PP_REASON_NONE 

Default, means nothing special

LIBCAPS_PP_REASON_ATTENTION 

User's attention is required. This reason requires a detailed message why

LIBCAPS_PP_REASON_MEDIA_NEEDED 

Printer device needs printing media

LIBCAPS_PP_REASON_MEDIA_JAM 

Printer device needs recovery

LIBCAPS_PP_REASON_SHUTDOWN 

Printer device/driver is going to shut down