NemoFileInfo: Nemo Extension Reference Manual

## NemoFileInfo NemoFileInfo — A wrapper interface for extensions to access NemoFile info. |

## Functions

NemoFileInfo * | nemo_file_info_create ()
NemoFileInfo * | nemo_file_info_create_for_uri ()
NemoFileInfo * | (*nemo_file_info_getter) ()
NemoFileInfo * | nemo_file_info_lookup ()
NemoFileInfo * | nemo_file_info_lookup_for_uri ()
GList * | nemo_file_info_list_copy ()
void | nemo_file_info_list_free ()
gboolean | nemo_file_info_is_gone ()
GFileType | nemo_file_info_get_file_type ()
GFile * | nemo_file_info_get_location ()
char * | nemo_file_info_get_name ()
char * | nemo_file_info_get_uri ()
char * | nemo_file_info_get_activation_uri ()
GFile * | nemo_file_info_get_parent_location ()
char * | nemo_file_info_get_parent_uri ()
GMount * | nemo_file_info_get_mount ()
char * | nemo_file_info_get_uri_scheme ()
NemoFileInfo * | nemo_file_info_get_parent_info ()
char * | nemo_file_info_get_mime_type ()
gboolean | nemo_file_info_is_mime_type ()
gboolean | nemo_file_info_is_directory ()
gboolean | nemo_file_info_can_write ()
void | nemo_file_info_add_emblem ()
char * | nemo_file_info_get_string_attribute ()
void | nemo_file_info_add_string_attribute ()
void | nemo_file_info_invalidate_extension_info ()

## Types and Values

#define | NEMO_FILE_DEFINED
typedef | NemoFile
typedef | NemoFileInfo

## Object Hierarchy

        GInterface
        ╰── NemoFileInfo

## Prerequisites

NemoFileInfo requires GObject.

## Description

This inteface is implemented by NemoFile and provides access to certain information regarding a given file object. It is also used to add file attributes and notify a file of changes to those attribues when using a NemoInfoProvider.

## Functions

### nemo_file_info_create ()

    NemoFileInfo *
    nemo_file_info_create (GFile *location);

#### Parameters

location | the location to create the file info for |

#### Returns

a NemoFileInfo.

[transfer full]

### nemo_file_info_create_for_uri ()

    NemoFileInfo *
    nemo_file_info_create_for_uri (const char *uri);

#### Parameters

uri | the URI to lookup the file info for |

#### Returns

a NemoFileInfo.

[transfer full]

### nemo_file_info_getter ()

    NemoFileInfo *
    (*nemo_file_info_getter) (GFile *location,
                              gboolean create);

### nemo_file_info_lookup ()

    NemoFileInfo *
    nemo_file_info_lookup (GFile *location);

#### Parameters

location | the location to lookup the file info for |

#### Returns

a NemoFileInfo.

[transfer full]

### nemo_file_info_lookup_for_uri ()

    NemoFileInfo *
    nemo_file_info_lookup_for_uri (const char *uri);

#### Parameters

uri | the URI to lookup the file info for |

#### Returns

a NemoFileInfo.

[transfer full]

### nemo_file_info_list_copy ()

    GList *
    nemo_file_info_list_copy (GList *files);

#### Parameters

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

#### Returns

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

[element-type NemoFileInfo][transfer full]

### nemo_file_info_list_free ()

    void
    nemo_file_info_list_free (GList *files);

#### Parameters

files | a list created with nemo_file_info_list_copy. | [element-type NemoFileInfo]

### nemo_file_info_is_gone ()

    gboolean
    nemo_file_info_is_gone (NemoFileInfo *file);

### nemo_file_info_get_file_type ()

    GFileType
    nemo_file_info_get_file_type (NemoFileInfo *file);

### nemo_file_info_get_location ()

    GFile *
    nemo_file_info_get_location (NemoFileInfo *file);

#### Parameters

file | a NemoFileInfo |

#### Returns

a GFile for the location of `file` .

[transfer full]

### nemo_file_info_get_name ()

    char *
    nemo_file_info_get_name (NemoFileInfo *file);

### nemo_file_info_get_uri ()

    char *
    nemo_file_info_get_uri (NemoFileInfo *file);

### nemo_file_info_get_activation_uri ()

    char *
    nemo_file_info_get_activation_uri (NemoFileInfo *file);

### nemo_file_info_get_parent_location ()

    GFile *
    nemo_file_info_get_parent_location (NemoFileInfo *file);

#### Parameters

file | a NemoFileInfo |

#### Returns

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

[allow-none][transfer full]

### nemo_file_info_get_parent_uri ()

    char *
    nemo_file_info_get_parent_uri (NemoFileInfo *file);

### nemo_file_info_get_mount ()

    GMount *
    nemo_file_info_get_mount (NemoFileInfo *file);

#### Parameters

file | a NemoFileInfo |

#### Returns

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

[allow-none][transfer full]

### nemo_file_info_get_uri_scheme ()

    char *
    nemo_file_info_get_uri_scheme (NemoFileInfo *file);

### nemo_file_info_get_parent_info ()

    NemoFileInfo *
    nemo_file_info_get_parent_info (NemoFileInfo *file);

#### Parameters

file | a NemoFileInfo |

#### Returns

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

[allow-none][transfer full]

### nemo_file_info_get_mime_type ()

    char *
    nemo_file_info_get_mime_type (NemoFileInfo *file);

### nemo_file_info_is_mime_type ()

    gboolean
    nemo_file_info_is_mime_type (NemoFileInfo *file,
                                 const char *mime_type);

### nemo_file_info_is_directory ()

    gboolean
    nemo_file_info_is_directory (NemoFileInfo *file);

### nemo_file_info_can_write ()

    gboolean
    nemo_file_info_can_write (NemoFileInfo *file);

### nemo_file_info_add_emblem ()

    void
    nemo_file_info_add_emblem (NemoFileInfo *file,
                               const char *emblem_name);

### nemo_file_info_get_string_attribute ()

    char *
    nemo_file_info_get_string_attribute (NemoFileInfo *file,
                                         const char *attribute_name);

### nemo_file_info_add_string_attribute ()

    void
    nemo_file_info_add_string_attribute (NemoFileInfo *file,
                                         const char *attribute_name,
                                         const char *value);

### nemo_file_info_invalidate_extension_info ()

    void
    nemo_file_info_invalidate_extension_info
                                   (NemoFileInfo *file);

Notifies nemo to re-run info provider extensions on the given file.

This is useful if you have an extension that listens or responds to some external interface for changes to local file metadata (such as a cloud drive changing file emblems.)

When a change such as this occurs, call this on the file in question, and nemo will schedule a call to extension->update_file_info to update its own internal metadata.

NOTE: This does *not* need to be called on the tail end of a update_full/update_complete asynchronous extension. Prior to Nemo 3.6 this was indeed the case, however, due to a recursion issue in nemo-directory-async.c (see nemo 9e67417f8f09.)

#### Parameters

file | a NemoFile |

## Types and Values

### NEMO_FILE_DEFINED

    #define NEMO_FILE_DEFINED

### NemoFile

    typedef struct NemoFile          NemoFile;

### NemoFileInfo

    typedef NemoFile NemoFileInfo;