## FpPrint

FpPrint — Fingerprint handling

## Functions

FpPrint * | fp_print_new ()
const gchar * | fp_print_get_driver ()
const gchar * | fp_print_get_device_id ()
gboolean | fp_print_get_device_stored ()
FpImage * | fp_print_get_image ()
FpFinger | fp_print_get_finger ()
const gchar * | fp_print_get_username ()
const gchar * | fp_print_get_description ()
const GDate * | fp_print_get_enroll_date ()
void | fp_print_set_finger ()
void | fp_print_set_username ()
void | fp_print_set_description ()
void | fp_print_set_enroll_date ()
gboolean | fp_print_compatible ()
gboolean | fp_print_equal ()
gboolean | fp_print_serialize ()
FpPrint * | fp_print_deserialize ()

## Properties

char * | description | Read / Write
char * | device-id | Read / Write / Construct Only
gboolean | device-stored | Read / Write / Construct Only
char * | driver | Read / Write / Construct Only
GDate * | enroll-date | Read / Write
FpFinger | finger | Read / Write
GVariant * | fpi-data | Read / Write
gpointer | fpi-prints | Read / Write
FpiPrintType | fpi-type | Read / Write
FpImage * | image | Read
char * | username | Read / Write

## Types and Values

#define | FP_TYPE_PRINT
enum | FpFinger
| FpPrint

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── FpPrint

## Description

Interaction with prints and their storage.

## Functions

### fp_print_new ()

    FpPrint *
    fp_print_new (FpDevice *device);

Create a new FpPrint. This is only useful to prepare an enrollment of a new print using `fp_device_enroll()`. For this you should first create a new print, fill in the relevant metadata, and then start enrollment.

#### Parameters

device | A FpDevice |

#### Returns

A newly created FpPrint.

[transfer floating]

### fp_print_get_driver ()

    const gchar *
    fp_print_get_driver (FpPrint *print);

Returns the driver that the print was created for.

#### Parameters

print | A FpPrint |

#### Returns

The driver.

[transfer none]

### fp_print_get_device_id ()

    const gchar *
    fp_print_get_device_id (FpPrint *print);

Returns the device ID that the print was created for.

#### Parameters

print | A FpPrint |

#### Returns

The device ID.

[transfer none]

### fp_print_get_device_stored ()

    gboolean
    fp_print_get_device_stored (FpPrint *print);

Whether the print is actually stored on the device and this is just a handle to use that references the device stored data.

#### Parameters

print | A FpPrint |

#### Returns

Whether the print is stored on the device

### fp_print_get_image ()

    FpImage *
    fp_print_get_image (FpPrint *print);

Returns the image that the print was created from, or `NULL`

#### Parameters

print | A FpPrint |

#### Returns

The FpImage.

[transfer none][nullable]

### fp_print_get_finger ()

    FpFinger
    fp_print_get_finger (FpPrint *print);

Returns the finger that the print was created for.

#### Parameters

print | A FpPrint |

#### Returns

The FpFinger

### fp_print_get_username ()

    const gchar *
    fp_print_get_username (FpPrint *print);

Returns the user defined username for the print.

#### Parameters

print | A FpPrint |

#### Returns

The username.

[transfer none][nullable]

### fp_print_get_description ()

    const gchar *
    fp_print_get_description (FpPrint *print);

Returns the user defined description for the print.

#### Parameters

print | A FpPrint |

#### Returns

The description.

[transfer none][nullable]

### fp_print_get_enroll_date ()

    const GDate *
    fp_print_get_enroll_date (FpPrint *print);

Returns the user defined enroll date for the print.

#### Parameters

print | A FpPrint |

#### Returns

The GDate.

[transfer none][nullable]

### fp_print_set_finger ()

    void
    fp_print_set_finger (FpPrint *print,
                         FpFinger finger);

Set the finger that the print is for.

#### Parameters

print | A FpPrint |
finger | The FpFinger |

### fp_print_set_username ()

    void
    fp_print_set_username (FpPrint *print,
                           const gchar *username);

Set the username for the print.

#### Parameters

print | A FpPrint |
username | The new username. | [transfer none]

### fp_print_set_description ()

    void
    fp_print_set_description (FpPrint *print,
                              const gchar *description);

Set the description for the print.

#### Parameters

print | A FpPrint |
description | The new description. | [transfer none]

### fp_print_set_enroll_date ()

    void
    fp_print_set_enroll_date (FpPrint *print,
                              const GDate *enroll_date);

Set the enroll date for the print.

#### Parameters

print | A FpPrint |
enroll_date | The new enroll date. | [transfer none]

### fp_print_compatible ()

    gboolean
    fp_print_compatible (FpPrint *self,
                         FpDevice *device);

Tests whether the prints is compatible with the given device.

#### Parameters

self | A FpPrint |
device | A FpDevice |

#### Returns

`TRUE` if the print is compatible with the device

### fp_print_equal ()

    gboolean
    fp_print_equal (FpPrint *self,
                    FpPrint *other);

Tests whether the prints can be considered equal. This only compares the actual information about the print, not the metadata.

#### Parameters

self | First FpPrint |
other | Second FpPrint |

#### Returns

`TRUE` if the prints are equal

### fp_print_serialize ()

    gboolean
    fp_print_serialize (FpPrint *print,
                        guchar **data,
                        gsize *length,
                        GError **error);

Serialize a print definition for permanent storage. Note that this is lossy in the sense that e.g. the image data is discarded.

#### Parameters

print | A FpPrint |
data | Return location for data pointer. | [array length=length][transfer full][out]
length | Length of `data` . | [transfer full][out]
error | Return location for error |

#### Returns

`TRUE` on success.

[type void]

### fp_print_deserialize ()

    FpPrint *
    fp_print_deserialize (const guchar *data,
                          gsize length,
                          GError **error);

Deserialize a print definition from permanent storage.

#### Parameters

data | The binary data. | [array length=length]
length | Length of the data |
error | Return location for error |

#### Returns

A newly created FpPrint on success.

[transfer full]

## Types and Values

### FP_TYPE_PRINT

    #define FP_TYPE_PRINT (fp_print_get_type ())

### enum FpFinger

#### Members

FP_FINGER_UNKNOWN | The finger is unknown |
FP_FINGER_LEFT_THUMB | Left thumb |
FP_FINGER_LEFT_INDEX | Left index finger |
FP_FINGER_LEFT_MIDDLE | Left middle finger |
FP_FINGER_LEFT_RING | Left ring finger |
FP_FINGER_LEFT_LITTLE | Left little finger |
FP_FINGER_RIGHT_THUMB | Right thumb |
FP_FINGER_RIGHT_INDEX | Right index finger |
FP_FINGER_RIGHT_MIDDLE | Right middle finger |
FP_FINGER_RIGHT_RING | Right ring finger |
FP_FINGER_RIGHT_LITTLE | Right little finger |
FP_FINGER_FIRST | The first finger in the fp-print order |
FP_FINGER_LAST | The last finger in the fp-print order |

### FpPrint

    typedef struct _FpPrint FpPrint;

## Property Details

### The `“description”` property

      “description”              char *

A user defined description for the print.

Owner: FpPrint

Flags: Read / Write

Default value: NULL

### The `“device-id”` property

      “device-id”                char *

Unique ID allowing to check if a device is compatible with the print.

Owner: FpPrint

Flags: Read / Write / Construct Only

Default value: NULL

### The `“device-stored”` property

      “device-stored”            gboolean

Whether the print is a handle for data that is stored on the device.

Owner: FpPrint

Flags: Read / Write / Construct Only

Default value: FALSE

### The `“driver”` property

      “driver”                   char *

The name of the driver that created the print.

Owner: FpPrint

Flags: Read / Write / Construct Only

Default value: NULL

### The `“enroll-date”` property

      “enroll-date”              GDate *

The date of enrollment.

Owner: FpPrint

Flags: Read / Write

### The `“finger”` property

      “finger”                   FpFinger

The enrolled finger.

Owner: FpPrint

Flags: Read / Write

Default value: FP_FINGER_UNKNOWN

### The `“fpi-data”` property

      “fpi-data”                 GVariant *

The raw data for internal use only.

Owner: FpPrint

Flags: Read / Write

Allowed values: GVariant<*>

Default value: NULL

### The `“fpi-prints”` property

      “fpi-prints”               gpointer

Prints for internal use only.

Owner: FpPrint

Flags: Read / Write

### The `“fpi-type”` property

      “fpi-type”                 FpiPrintType

Private: The type of the print data.

Owner: FpPrint

Flags: Read / Write

Default value: FPI_PRINT_UNDEFINED

### The `“image”` property

      “image”                    FpImage *

The image that was used for the print, only valid for newly enrolled prints on image based devices.

Owner: FpPrint

Flags: Read

### The `“username”` property

      “username”                 char *

The username that the enrolled print belongs to.

Owner: FpPrint

Flags: Read / Write

Default value: NULL