# GnomeFileEntry

## Name

GnomeFileEntry --

## Synopsis

    #include <libgnomeui/libgnomeui.h>

    struct      GnomeFileEntry;
    GtkWidget*  gnome_file_entry_new            (const char *history_id,
                                                 const char *browse_dialog_title);
    void        gnome_file_entry_construct      (GnomeFileEntry *fentry,
                                                 const char *history_id,
                                                 const char *browse_dialog_title);
    GtkWidget*  gnome_file_entry_gnome_entry    (GnomeFileEntry *fentry);
    GtkWidget*  gnome_file_entry_gtk_entry      (GnomeFileEntry *fentry);
    void        gnome_file_entry_set_title      (GnomeFileEntry *fentry,
                                                 const char *browse_dialog_title);
    void        gnome_file_entry_set_default_path
                                                (GnomeFileEntry *fentry,
                                                 const char *path);
    void        gnome_file_entry_set_directory_entry
                                                (GnomeFileEntry *fentry,
                                                 gboolean directory_entry);
    gboolean    gnome_file_entry_get_directory_entry
                                                (GnomeFileEntry *fentry);
    char*       gnome_file_entry_get_full_path  (GnomeFileEntry *fentry,
                                                 gboolean file_must_exist);
    void        gnome_file_entry_set_filename   (GnomeFileEntry *fentry,
                                                 const char *filename);
    void        gnome_file_entry_set_modal      (GnomeFileEntry *fentry,
                                                 gboolean is_modal);
    gboolean    gnome_file_entry_get_modal      (GnomeFileEntry *fentry);
    void        gnome_file_entry_set_directory  (GnomeFileEntry *fentry,
                                                 gboolean directory_entry);

## Object Hierarchy

      GObject
       +----GtkObject
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBox
                               +----GtkVBox
                                     +----GnomeFileEntry

## Implemented Interfaces

GnomeFileEntry implements AtkImplementorIface and GtkEditable.

## Properties

      "browse-dialog-title"  gchararray           : Read / Write
      "default-path"         gchararray           : Read / Write
      "directory-entry"      gboolean             : Read / Write
      "filename"             gchararray           : Read / Write
      "gnome-entry"          GnomeEntry           : Read
      "gtk-entry"            GtkEntry             : Read
      "history-id"           gchararray           : Read / Write
      "modal"                gboolean             : Read / Write

## Signal Prototypes

    "activate"  void        user_function      (GnomeFileEntry *fileentry,
                                                gpointer user_data);
    "browse-clicked"
                void        user_function      (GnomeFileEntry *fileentry,
                                                gpointer user_data);

## Description

## Details

### struct GnomeFileEntry

    struct GnomeFileEntry;

### gnome_file_entry_new ()

    GtkWidget*  gnome_file_entry_new            (const char *history_id,
                                                 const char *browse_dialog_title);

Creates a new GnomeFileEntry widget.

`history_id` : | the id given to gnome_entry_new (see GnomeEntry).
`browse_dialog_title` : | Title for the file dialog window.
Returns : | A pointer to the widget, NULL if it cannot be created.

### gnome_file_entry_construct ()

    void        gnome_file_entry_construct      (GnomeFileEntry *fentry,
                                                 const char *history_id,
                                                 const char *browse_dialog_title);

Constructs a GnomeFileEntry

`fentry` : | A GnomeFileEntry to construct.
`history_id` : | the id given to gnome_entry_new (see GnomeEntry).
`browse_dialog_title` : | Title for the file dialog window.

### gnome_file_entry_gnome_entry ()

    GtkWidget*  gnome_file_entry_gnome_entry    (GnomeFileEntry *fentry);

It returns a pointer to the gnome entry widget of the widget (seeGnomeEntry).

`fentry` : | The GnomeFileEntry widget to work with.
Returns : | A pointer to the component GnomeEntry widget

### gnome_file_entry_gtk_entry ()

    GtkWidget*  gnome_file_entry_gtk_entry      (GnomeFileEntry *fentry);

Similar to gnome_file_entry_gnome_entry but returns the gtk entry instead of the Gnome entry widget.

`fentry` : | The GnomeFileEntry widget to work with.
Returns : | Returns the GtkEntry widget

### gnome_file_entry_set_title ()

    void        gnome_file_entry_set_title      (GnomeFileEntry *fentry,
                                                 const char *browse_dialog_title);

Set the title of the browse dialog to `browse_dialog_title`. The new title will go into effect the next time the browse button is pressed.

`fentry` : | The GnomeFileEntry widget to work with.
`browse_dialog_title` : | The new title for the file browse dialog window.

### gnome_file_entry_set_default_path ()

    void        gnome_file_entry_set_default_path
                                                (GnomeFileEntry *fentry,
                                                 const char *path);

Set the default path of browse dialog to `path`. The default path is only used if the entry is empty or if the current path of the entry is not an absolute path, in which case the default path is prepended to it before the dialog is started.

`fentry` : | The GnomeFileEntry widget to work with.
`path` : | A path string.

### gnome_file_entry_set_directory_entry ()

    void        gnome_file_entry_set_directory_entry
                                                (GnomeFileEntry *fentry,
                                                 gboolean directory_entry);

Sets whether this is a directory only entry. If `directory_entry` is true, then gnome_file_entry_get_full_path will check for the file being a directory, and the browse dialog will have the file list disabled.

`fentry` : | The GnomeFileEntry widget to work with.
`directory_entry` : | boolean

### gnome_file_entry_get_directory_entry ()

    gboolean    gnome_file_entry_get_directory_entry
                                                (GnomeFileEntry *fentry);

Gets whether this is a directory only entry. See also gnome_file_entry_set_directory_entry.

`fentry` : | The GnomeFileEntry widget to work with.
Returns : | A boolean.

### gnome_file_entry_get_full_path ()

    char*       gnome_file_entry_get_full_path  (GnomeFileEntry *fentry,
                                                 gboolean file_must_exist);

Gets the full absolute path of the file from the entry. If `file_must_exist` is false, nothing is tested and the path is returned. If `file_must_exist` is true, then the path is only returned if the path actually exists. In case the entry is a directory entry (see gnome_file_entry_set_directory_entry), then if the path exists and is a directory then it's returned; if not, it is assumed it was a file so we try to strip it, and try again. It allocates memory for the returned string.

`fentry` : | The GnomeFileEntry widget to work with.
`file_must_exist` : | boolean
Returns : | a newly allocated string with the path or NULL if something went wrong

### gnome_file_entry_set_filename ()

    void        gnome_file_entry_set_filename   (GnomeFileEntry *fentry,
                                                 const char *filename);

Sets the internal entry to this string.

`fentry` : | The GnomeFileEntry widget to work with.
`filename` : |

### gnome_file_entry_set_modal ()

    void        gnome_file_entry_set_modal      (GnomeFileEntry *fentry,
                                                 gboolean is_modal);

Sets the modality of the browse dialog.

`fentry` : | The GnomeFileEntry widget to work with.
`is_modal` : | true if the window is to be modal, false otherwise.

### gnome_file_entry_get_modal ()

    gboolean    gnome_file_entry_get_modal      (GnomeFileEntry *fentry);

This function gets the boolean which specifies if the browsing dialog is modal or not

`fentry` : | The GnomeFileEntry widget to work with.
Returns : | A boolean.

### gnome_file_entry_set_directory ()

    void        gnome_file_entry_set_directory  (GnomeFileEntry *fentry,
                                                 gboolean directory_entry);

Warning
`gnome_file_entry_set_directory` is deprecated and should not be used in newly-written code.

Deprecated, use gnome_file_entry_set_directory_entry

`fentry` : | The GnomeFileEntry widget to work with.
`directory_entry` : | boolean

## Properties

"`browse-dialog-title`" (gchararray : Read / Write) |
"`default-path`" (gchararray : Read / Write) |
"`directory-entry`" (gboolean : Read / Write) |
"`filename`" (gchararray : Read / Write) |
"`gnome-entry`" (GnomeEntry : Read) |
"`gtk-entry`" (GtkEntry : Read) |
"`history-id`" (gchararray : Read / Write) |
"`modal`" (gboolean : Read / Write) |

## Signals

### The "activate" signal

    void        user_function                  (GnomeFileEntry *fileentry,
                                                gpointer user_data);

`fileentry` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The "browse-clicked" signal

    void        user_function                  (GnomeFileEntry *fileentry,
                                                gpointer user_data);

`fileentry` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.