## XfceFilenameInput XfceFilenameInput — widget for filename input |

## Stability Level

Stable, unless otherwise indicated

## Functions

const gchar * | xfce_filename_input_get_text ()
void | xfce_filename_input_check ()
GtkEntry * | xfce_filename_input_get_entry ()
void | xfce_filename_input_sensitise_widget ()
void | xfce_filename_input_desensitise_widget ()

## Properties

int | max-text-length | Write / Construct Only
char * | original-filename | Write / Construct Only

## Signals

void | text-invalid | Run Last
void | text-valid | Run Last

## Types and Values

| XfceFilenameInput

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBox
                        ╰── XfceFilenameInput

## Implemented Interfaces

XfceFilenameInput implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Includes

    #include <libxfce4ui/libxfce4ui.h>

## Description

A widget to allow filename input for creating or renaming files, with as-you-type checking for invalid filenames.

## Functions

### xfce_filename_input_get_text ()

    const gchar *
    xfce_filename_input_get_text (XfceFilenameInput *filename_input);

Gets the current text of the widget.

#### Parameters

filename_input | a XfceFilenameInput instance. |

#### Returns

the string representing the current text.

[transfer none]

Since: 4.16

### xfce_filename_input_check ()

    void
    xfce_filename_input_check (XfceFilenameInput *filename_input);

Forces a check of the current input text even when it has not changed. This is useful to force the appropriate signal to be sent to indicate whether the text is a valid filename or not, so that for example any GtkWidgets whose sensitivity is controlled by this can be correctly updated when they are first created.

#### Parameters

filename_input | a XfceFilenameInput instance. |

Since: 4.16

### xfce_filename_input_get_entry ()

    GtkEntry *
    xfce_filename_input_get_entry (XfceFilenameInput *filename_input);

Gets the GtkEntry associated to filename_input

#### Parameters

filename_input | a XfceFilenameInput instance. |

#### Returns

A GtkEntry.

[transfer none]

Since: 4.16

### xfce_filename_input_sensitise_widget ()

    void
    xfce_filename_input_sensitise_widget (GtkWidget *widget);

A convenience function to be connected as a callback for the "text-valid" signal (for example, using g_connect_swapped) for the simple case where the desired effect of this signal is to set the sensitivity of a single GtkWidget (for example, a GtkButton).

#### Parameters

widget | a GtkWidget |

Since: 4.16

### xfce_filename_input_desensitise_widget ()

    void
    xfce_filename_input_desensitise_widget
                                   (GtkWidget *widget);

A convenience function to be connected as a callback for the "text-invalid" signal (for example, using g_connect_swapped) for the simple case where the desired effect of this signal is to set the sensitivity of a single GtkWidget (for example, a GtkButton).

#### Parameters

widget | a GtkWidget |

Since: 4.16

## Types and Values

### XfceFilenameInput

    typedef struct _XfceFilenameInput XfceFilenameInput;

An opaque structure with only private fields.

## Property Details

### The `“max-text-length”` property

      “max-text-length”          int

The maximum permitted length of a filename. A value of -1 indicates no maximum length.

Owner: XfceFilenameInput

Flags: Write / Construct Only

Allowed values: >= -1

Default value: -1

Since: 4.16

### The `“original-filename”` property

      “original-filename”        char *

The original name of the file, to be used as the initial text displayed in the GtkEntry. A NULL value indicates no original filename.

Owner: XfceFilenameInput

Flags: Write / Construct Only

Default value: NULL

Since: 4.16

## Signal Details

### The `“text-invalid”` signal

    void
    user_function (XfceFilenameInput *filename_input,
                   gpointer           user_data)

Signals that the current text is not a valid filename. This signal is emitted whenever the user changes the text and the result is not a valid filename.

#### Parameters

filename_input | An XfceFilenameInput |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 4.16

### The `“text-valid”` signal

    void
    user_function (XfceFilenameInput *filename_input,
                   gpointer           user_data)

Signals that the current text is a valid filename. This signal is emitted whenever the user changes the text and the result is a valid filename.

#### Parameters

filename_input | An XfceFilenameInput |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 4.16