## NautilusFileInfo NautilusFileInfo — File interface for nautilus extensions |

## Functions

NautilusFileInfo * | nautilus_file_info_create ()
NautilusFileInfo * | nautilus_file_info_create_for_uri ()
NautilusFileInfo * | nautilus_file_info_lookup ()
NautilusFileInfo * | nautilus_file_info_lookup_for_uri ()
GList * | nautilus_file_info_list_copy ()
void | nautilus_file_info_list_free ()
gboolean | nautilus_file_info_is_gone ()
GFileType | nautilus_file_info_get_file_type ()
GFile * | nautilus_file_info_get_location ()
char * | nautilus_file_info_get_name ()
char * | nautilus_file_info_get_uri ()
char * | nautilus_file_info_get_activation_uri ()
GFile * | nautilus_file_info_get_parent_location ()
char * | nautilus_file_info_get_parent_uri ()
GMount * | nautilus_file_info_get_mount ()
char * | nautilus_file_info_get_uri_scheme ()
NautilusFileInfo * | nautilus_file_info_get_parent_info ()
char * | nautilus_file_info_get_mime_type ()
gboolean | nautilus_file_info_is_mime_type ()
gboolean | nautilus_file_info_is_directory ()
gboolean | nautilus_file_info_can_write ()
void | nautilus_file_info_add_emblem ()
char * | nautilus_file_info_get_string_attribute ()
void | nautilus_file_info_add_string_attribute ()
void | nautilus_file_info_invalidate_extension_info ()

## Types and Values

#define | NAUTILUS_FILE_DEFINED
typedef | NautilusFile
typedef | NautilusFileInfo
struct | NautilusFileInfoIface

## Object Hierarchy

        GInterface
        ╰── NautilusFileInfo

## Prerequisites

NautilusFileInfo requires GObject.

## Includes

    #include <libnautilus-extension/nautilus-file-info.h>

## Description

NautilusFileInfo provides methods to get and modify information about file objects in the file manager.

## Functions

### nautilus_file_info_create ()

    NautilusFileInfo *
    nautilus_file_info_create (GFile *location);

#### Parameters

location | the location to create the file info for |

#### Returns

a NautilusFileInfo.

[transfer full]

### nautilus_file_info_create_for_uri ()

    NautilusFileInfo *
    nautilus_file_info_create_for_uri (const char *uri);

#### Parameters

uri | the URI to lookup the file info for |

#### Returns

a NautilusFileInfo.

[transfer full]

### nautilus_file_info_lookup ()

    NautilusFileInfo *
    nautilus_file_info_lookup (GFile *location);

#### Parameters

location | the location to lookup the file info for |

#### Returns

a NautilusFileInfo.

[transfer full]

### nautilus_file_info_lookup_for_uri ()

    NautilusFileInfo *
    nautilus_file_info_lookup_for_uri (const char *uri);

#### Parameters

uri | the URI to lookup the file info for |

#### Returns

a NautilusFileInfo.

[transfer full]

### nautilus_file_info_list_copy ()

    GList *
    nautilus_file_info_list_copy (GList *files);

#### Parameters

files | the files to copy. | [element-type NautilusFileInfo]

#### Returns

a copy of `files` . Use nautilus_file_info_list_free to free the list and unref its contents.

[element-type NautilusFileInfo][transfer full]

### nautilus_file_info_list_free ()

    void
    nautilus_file_info_list_free (GList *files);

#### Parameters

files | a list created with nautilus_file_info_list_copy. | [element-type NautilusFileInfo]

### nautilus_file_info_is_gone ()

    gboolean
    nautilus_file_info_is_gone (NautilusFileInfo *file);

### nautilus_file_info_get_file_type ()

    GFileType
    nautilus_file_info_get_file_type (NautilusFileInfo *file);

### nautilus_file_info_get_location ()

    GFile *
    nautilus_file_info_get_location (NautilusFileInfo *file);

#### Parameters

file | a NautilusFileInfo |

#### Returns

a GFile for the location of `file` .

[transfer full]

### nautilus_file_info_get_name ()

    char *
    nautilus_file_info_get_name (NautilusFileInfo *file);

### nautilus_file_info_get_uri ()

    char *
    nautilus_file_info_get_uri (NautilusFileInfo *file);

### nautilus_file_info_get_activation_uri ()

    char *
    nautilus_file_info_get_activation_uri (NautilusFileInfo *file);

### nautilus_file_info_get_parent_location ()

    GFile *
    nautilus_file_info_get_parent_location
                                   (NautilusFileInfo *file);

#### Parameters

file | a NautilusFileInfo |

#### Returns

a GFile for the parent location of `file` , or `NULL` if `file` has no parent.

[allow-none][transfer full]

### nautilus_file_info_get_parent_uri ()

    char *
    nautilus_file_info_get_parent_uri (NautilusFileInfo *file);

### nautilus_file_info_get_mount ()

    GMount *
    nautilus_file_info_get_mount (NautilusFileInfo *file);

#### Parameters

file | a NautilusFileInfo |

#### Returns

a GMount for the mount of `file` , or `NULL` if `file` has no mount.

[allow-none][transfer full]

### nautilus_file_info_get_uri_scheme ()

    char *
    nautilus_file_info_get_uri_scheme (NautilusFileInfo *file);

### nautilus_file_info_get_parent_info ()

    NautilusFileInfo *
    nautilus_file_info_get_parent_info (NautilusFileInfo *file);

#### Parameters

file | a NautilusFileInfo |

#### Returns

a NautilusFileInfo for the parent of `file` , or `NULL` if `file` has no parent.

[allow-none][transfer full]

### nautilus_file_info_get_mime_type ()

    char *
    nautilus_file_info_get_mime_type (NautilusFileInfo *file);

### nautilus_file_info_is_mime_type ()

    gboolean
    nautilus_file_info_is_mime_type (NautilusFileInfo *file,
                                     const char *mime_type);

### nautilus_file_info_is_directory ()

    gboolean
    nautilus_file_info_is_directory (NautilusFileInfo *file);

### nautilus_file_info_can_write ()

    gboolean
    nautilus_file_info_can_write (NautilusFileInfo *file);

### nautilus_file_info_add_emblem ()

    void
    nautilus_file_info_add_emblem (NautilusFileInfo *file,
                                   const char *emblem_name);

### nautilus_file_info_get_string_attribute ()

    char *
    nautilus_file_info_get_string_attribute
                                   (NautilusFileInfo *file,
                                    const char *attribute_name);

### nautilus_file_info_add_string_attribute ()

    void
    nautilus_file_info_add_string_attribute
                                   (NautilusFileInfo *file,
                                    const char *attribute_name,
                                    const char *value);

### nautilus_file_info_invalidate_extension_info ()

    void
    nautilus_file_info_invalidate_extension_info
                                   (NautilusFileInfo *file);

## Types and Values

### NAUTILUS_FILE_DEFINED

    #define NAUTILUS_FILE_DEFINED

### NautilusFile

    typedef struct NautilusFile          NautilusFile;

### NautilusFileInfo

    typedef NautilusFile                  NautilusFileInfo;

### struct NautilusFileInfoIface

    struct NautilusFileInfoIface {
    	GTypeInterface g_iface;

    	gboolean          (*is_gone)              (NautilusFileInfo *file);

    	char *            (*get_name)             (NautilusFileInfo *file);
    	char *            (*get_uri)              (NautilusFileInfo *file);
    	char *            (*get_parent_uri)       (NautilusFileInfo *file);
    	char *            (*get_uri_scheme)       (NautilusFileInfo *file);

    	char *            (*get_mime_type)        (NautilusFileInfo *file);
    	gboolean          (*is_mime_type)         (NautilusFileInfo *file,
    						   const char       *mime_Type);
    	gboolean          (*is_directory)         (NautilusFileInfo *file);

    	void              (*add_emblem)           (NautilusFileInfo *file,
    						   const char       *emblem_name);
    	char *            (*get_string_attribute) (NautilusFileInfo *file,
    						   const char       *attribute_name);
    	void              (*add_string_attribute) (NautilusFileInfo *file,
    						   const char       *attribute_name,
    						   const char       *value);
    	void              (*invalidate_extension_info) (NautilusFileInfo *file);

    	char *            (*get_activation_uri)   (NautilusFileInfo *file);

    	GFileType         (*get_file_type)        (NautilusFileInfo *file);
    	GFile *           (*get_location)         (NautilusFileInfo *file);
    	GFile *           (*get_parent_location)  (NautilusFileInfo *file);
    	NautilusFileInfo* (*get_parent_info)      (NautilusFileInfo *file);
    	GMount *          (*get_mount)            (NautilusFileInfo *file);
    	gboolean          (*can_write)            (NautilusFileInfo *file);
    };

Interface for extensions to provide additional menu items.

#### Members

GTypeInterface `g_iface`; | The parent interface. |
`is_gone` () | Returns whether the file info is gone. See `nautilus_file_info_is_gone()` for details. |
`get_name` () | Returns the file name as a string. See `nautilus_file_info_get_name()` for details. |
`get_uri` () | Returns the file URI as a string. See `nautilus_file_info_get_uri()` for details. |
`get_parent_uri` () | Returns the file parent URI as a string. See `nautilus_file_info_get_parent_uri()` for details. |
`get_uri_scheme` () | Returns the file URI scheme as a string. See `nautilus_file_info_get_uri_scheme()` for details. |
`get_mime_type` () | Returns the file mime type as a string. See `nautilus_file_info_get_mime_type()` for details. |
`is_mime_type` () | Returns whether the file is the given mime type. See `nautilus_file_info_is_mime_type()` for details. |
`is_directory` () | Returns whether the file is a directory. See `nautilus_file_info_is_directory()` for details. |
`add_emblem` () | Adds an emblem to this file. See `nautilus_file_info_add_emblem()` for details. |
`get_string_attribute` () | Returns the specified file attribute as a string. See `nautilus_file_info_get_string_attribute()` for details. |
`add_string_attribute` () | Sets the specified string file attribute value. See `nautilus_file_info_add_string_attribute()` for details. |
`invalidate_extension_info` () | Invalidates information of the file provided by extensions. See `nautilus_file_info_invalidate_extension_info()` for details. |
`get_activation_uri` () | Returns the file activation URI as a string. See `nautilus_file_info_get_activation_uri()` for details. |
`get_file_type` () | Returns the file type. See `nautilus_file_info_get_file_type()` for details. |
`get_location` () | Returns the file location as a GFile. See `nautilus_file_info_get_location()` for details. |
`get_parent_location` () | Returns the file parent location as a GFile. See `nautilus_file_info_get_parent_location()` for details. |
`get_parent_info` () | Returns the file parent NautilusFileInfo. See `nautilus_file_info_get_parent_info()` for details. |
`get_mount` () | Returns the file mount as a GMount. See `nautilus_file_info_get_mount()` for details. |
`can_write` () | Returns whether the file is writable. See `nautilus_file_info_can_write()` for details. |