BaulFileInfo: Baul Extension Reference Manual

## BaulFileInfo BaulFileInfo — File interface for baul extensions |

## Functions

BaulFileInfo * | baul_file_info_create ()
BaulFileInfo * | baul_file_info_create_for_uri ()
BaulFileInfo * | (*baul_file_info_getter) ()
GList * | baul_file_info_list_copy ()
void | baul_file_info_list_free ()
BaulFileInfo * | baul_file_info_lookup ()
BaulFileInfo * | baul_file_info_lookup_for_uri ()
gboolean | baul_file_info_is_gone ()
GFileType | baul_file_info_get_file_type ()
GFile * | baul_file_info_get_location ()
char * | baul_file_info_get_name ()
char * | baul_file_info_get_uri ()
char * | baul_file_info_get_activation_uri ()
GFile * | baul_file_info_get_parent_location ()
char * | baul_file_info_get_parent_uri ()
GMount * | baul_file_info_get_mount ()
char * | baul_file_info_get_uri_scheme ()
BaulFileInfo * | baul_file_info_get_parent_info ()
char * | baul_file_info_get_mime_type ()
gboolean | baul_file_info_is_mime_type ()
gboolean | baul_file_info_is_directory ()
gboolean | baul_file_info_can_write ()
void | baul_file_info_add_emblem ()
char * | baul_file_info_get_string_attribute ()
void | baul_file_info_add_string_attribute ()
void | baul_file_info_invalidate_extension_info ()

## Types and Values

#define | BAUL_FILE_DEFINED
typedef | BaulFile
typedef | BaulFileInfo
struct | BaulFileInfoIface

## Object Hierarchy

        GInterface
        ╰── BaulFileInfo

## Prerequisites

BaulFileInfo requires GObject.

## Includes

    #include <libbaul-extension/baul-file-info.h>

## Description

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

## Functions

### baul_file_info_create ()

    BaulFileInfo *
    baul_file_info_create (GFile *location);

#### Parameters

location | the location to create the file info for |

#### Returns

a BaulFileInfo.

[transfer full]

### baul_file_info_create_for_uri ()

    BaulFileInfo *
    baul_file_info_create_for_uri (const char *uri);

#### Parameters

uri | the URI to lookup the file info for |

#### Returns

a BaulFileInfo.

[transfer full]

### baul_file_info_getter ()

    BaulFileInfo *
    (*baul_file_info_getter) (GFile *location,
                              gboolean create);

### baul_file_info_list_copy ()

    GList *
    baul_file_info_list_copy (GList *files);

#### Parameters

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

#### Returns

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

[element-type BaulFileInfo][transfer full]

### baul_file_info_list_free ()

    void
    baul_file_info_list_free (GList *files);

#### Parameters

files | a list created with baul_file_info_list_copy. | [element-type BaulFileInfo]

### baul_file_info_lookup ()

    BaulFileInfo *
    baul_file_info_lookup (GFile *location);

#### Parameters

location | the location to lookup the file info for |

#### Returns

a BaulFileInfo.

[transfer full]

### baul_file_info_lookup_for_uri ()

    BaulFileInfo *
    baul_file_info_lookup_for_uri (const char *uri);

#### Parameters

uri | the URI to lookup the file info for |

#### Returns

a BaulFileInfo.

[transfer full]

### baul_file_info_is_gone ()

    gboolean
    baul_file_info_is_gone (BaulFileInfo *file);

### baul_file_info_get_file_type ()

    GFileType
    baul_file_info_get_file_type (BaulFileInfo *file);

### baul_file_info_get_location ()

    GFile *
    baul_file_info_get_location (BaulFileInfo *file);

#### Parameters

file | a BaulFileInfo |

#### Returns

a GFile for the location of `file` .

[transfer full]

### baul_file_info_get_name ()

    char *
    baul_file_info_get_name (BaulFileInfo *file);

### baul_file_info_get_uri ()

    char *
    baul_file_info_get_uri (BaulFileInfo *file);

### baul_file_info_get_activation_uri ()

    char *
    baul_file_info_get_activation_uri (BaulFileInfo *file);

### baul_file_info_get_parent_location ()

    GFile *
    baul_file_info_get_parent_location (BaulFileInfo *file);

#### Parameters

file | a BaulFileInfo |

#### Returns

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

[allow-none][transfer full]

### baul_file_info_get_parent_uri ()

    char *
    baul_file_info_get_parent_uri (BaulFileInfo *file);

### baul_file_info_get_mount ()

    GMount *
    baul_file_info_get_mount (BaulFileInfo *file);

#### Parameters

file | a BaulFileInfo |

#### Returns

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

[allow-none][transfer full]

### baul_file_info_get_uri_scheme ()

    char *
    baul_file_info_get_uri_scheme (BaulFileInfo *file);

### baul_file_info_get_parent_info ()

    BaulFileInfo *
    baul_file_info_get_parent_info (BaulFileInfo *file);

#### Parameters

file | a BaulFileInfo |

#### Returns

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

[allow-none][transfer full]

### baul_file_info_get_mime_type ()

    char *
    baul_file_info_get_mime_type (BaulFileInfo *file);

### baul_file_info_is_mime_type ()

    gboolean
    baul_file_info_is_mime_type (BaulFileInfo *file,
                                 const char *mime_type);

### baul_file_info_is_directory ()

    gboolean
    baul_file_info_is_directory (BaulFileInfo *file);

### baul_file_info_can_write ()

    gboolean
    baul_file_info_can_write (BaulFileInfo *file);

### baul_file_info_add_emblem ()

    void
    baul_file_info_add_emblem (BaulFileInfo *file,
                               const char *emblem_name);

### baul_file_info_get_string_attribute ()

    char *
    baul_file_info_get_string_attribute (BaulFileInfo *file,
                                         const char *attribute_name);

### baul_file_info_add_string_attribute ()

    void
    baul_file_info_add_string_attribute (BaulFileInfo *file,
                                         const char *attribute_name,
                                         const char *value);

### baul_file_info_invalidate_extension_info ()

    void
    baul_file_info_invalidate_extension_info
                                   (BaulFileInfo *file);

## Types and Values

### BAUL_FILE_DEFINED

    #define BAUL_FILE_DEFINED

### BaulFile

    typedef struct BaulFile            BaulFile;

### BaulFileInfo

    typedef BaulFile                   BaulFileInfo;

### struct BaulFileInfoIface

    struct BaulFileInfoIface {
        GTypeInterface g_iface;

        gboolean      (*is_gone)              (BaulFileInfo *file);

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

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

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

        char         *(*get_activation_uri)   (BaulFileInfo *file);

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

Interface for extensions to get and modify information about file objects.

#### Members

`is_gone` () | Returns whether the file info is gone. See `baul_file_info_is_gone()` for details. |
`get_name` () | Returns the file name as a string. See `baul_file_info_get_name()` for details. |
`get_uri` () | Returns the file URI as a string. See `baul_file_info_get_uri()` for details. |
`get_parent_uri` () | Returns the file parent URI as a string. See `baul_file_info_get_parent_uri()` for details. |
`get_uri_scheme` () | Returns the file URI scheme as a string. See `baul_file_info_get_uri_scheme()` for details. |
`get_mime_type` () | Returns the file mime type as a string. See `baul_file_info_get_mime_type()` for details. |
`is_mime_type` () | Returns whether the file is the given mime type. See `baul_file_info_is_mime_type()` for details. |
`is_directory` () | Returns whether the file is a directory. See `baul_file_info_is_directory()` for details. |
`add_emblem` () | Adds an emblem to this file. See `baul_file_info_add_emblem()` for details. |
`get_string_attribute` () | Returns the specified file attribute as a string. See `baul_file_info_get_string_attribute()` for details. |
`add_string_attribute` () | Sets the specified string file attribute value. See `baul_file_info_add_string_attribute()` for details. |
`invalidate_extension_info` () | Invalidates information of the file provided by extensions. See `baul_file_info_invalidate_extension_info()` for details. |
`get_activation_uri` () | Returns the file activation URI as a string. See `baul_file_info_get_activation_uri()` for details. |
`get_file_type` () | Returns the file type. See `baul_file_info_get_file_type()` for details. |
`get_location` () | Returns the file location as a GFile. See `baul_file_info_get_location()` for details. |
`get_parent_location` () | Returns the file parent location as a GFile. See `baul_file_info_get_parent_location()` for details. |
`get_parent_info` () | Returns the file parent BaulFileInfo. See `baul_file_info_get_parent_info()` for details. |
`get_mount` () | Returns the file mount as a GMount. See `baul_file_info_get_mount()` for details. |
`can_write` () | Returns whether the file is writable. See `baul_file_info_can_write()` for details. |