## NATimeout NATimeout — The NATimeout Structure |

## Synopsis

    #include <nautilus-actions/na-timeout.h>

                        NATimeout;
    void                NATimeoutFunc                       (void *user_data);
    void                na_timeout_event                    (NATimeout *timeout);

## Description

The NATimeout structure is a convenience structure to manage timeout functions.

## Details

### NATimeout

    typedef struct {
    	guint         timeout;
    	NATimeoutFunc handler;
    	gpointer      user_data;
    } NATimeout;

This structure let the user (i.e. the code which uses it) manage functions which should only be called after some time of inactivity, which is typically the case of 'item-change' handlers.

The structure is supposed to be initialized at construction time with `timeout` in milliseconds, `handler` and `user_data` input parameters. The private data should be set to `NULL`.

Such a structure must be allocated for each managed event.

When an event is detected, the `na_timeout_event()` function must be called with this structure. The function makes sure that the `handler` callback will be triggered as soon as no event will be recorded after `timeout` milliseconds of inactivity.

guint `timeout`; | (i) timeout configurable parameter (ms)
NATimeoutFunc `handler`; | (i) handler function
gpointer `user_data`; | (i) user data

Since 3.1

### NATimeoutFunc ()

    void                NATimeoutFunc                       (void *user_data);

Prototype of the callback function.

`user_data` : | data to be passed to the callback function.

Since 3.1

### na_timeout_event ()

    void                na_timeout_event                    (NATimeout *timeout);

`timeout` : | the NATimeout structure which will handle this event.