Efreet_Mime: The XDG Shared Mime Info standard

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Macros | Functions
Efreet_Mime: The XDG Shared Mime Info standard
Efreet

Efreet Mime is a library designed to help apps work with the Freedesktop.org Shared Mime Info standard. More...

## Functions
EAPI int | efreet_mime_init (void)
| Initializes the efreet mime settings.
EAPI int | efreet_mime_shutdown (void)
| Shuts down Efreet mime settings system if a balanced number of init/shutdown calls have been made.
EAPI const char * | efreet_mime_type_get (const char *file)
| Retrieve the mime type of a file.
EAPI const char * | efreet_mime_magic_type_get (const char *file)
| Retrieve the mime type of a file using magic.
EAPI const char * | efreet_mime_globs_type_get (const char *file)
| Retrieve the mime type of a file using globs.
EAPI const char * | efreet_mime_special_type_get (const char *file)
| Retrieve the special mime type of a file.
EAPI const char * | efreet_mime_fallback_type_get (const char *file)
| Retrieve the fallback mime type of a file.
EAPI const char * | efreet_mime_type_icon_get (const char *mime, const char *theme, unsigned int size)
| Retrieve the mime type icon for a file.
EAPI void | efreet_mime_type_cache_clear (void)
| Clear mime icons mapping cache.
EAPI void | efreet_mime_type_cache_flush (void)
| Flush mime icons mapping cache.

## Detailed Description

Efreet Mime is a library designed to help apps work with the Freedesktop.org Shared Mime Info standard.

Efreet_Mime.h provides all of the necessary headers and includes to work with Efreet_Mime.

## Function Documentation

## ◆ efreet_mime_init()

EAPI int efreet_mime_init | ( | void |  | ) |

Initializes the efreet mime settings.

Returns
  `1` on success or `0` on failure.

Referenced by eio_init(), and elm_need_efreet().

## ◆ efreet_mime_shutdown()

EAPI int efreet_mime_shutdown | ( | void |  | ) |

Shuts down Efreet mime settings system if a balanced number of init/shutdown calls have been made.

Returns
  The number of times the init function has been called minus the corresponding init call.

Referenced by eio_shutdown(), and elm_need_efreet().

## ◆ efreet_mime_type_get()

EAPI const char * efreet_mime_type_get | ( | const char * | file | ) |

Retrieve the mime type of a file.

Parameters

  file | The file to find the mime type

Returns
  Mime type as a string or NULL if the file doesn't exist.

Note
  The return value of this function is not guaranteed to be stringshared.

References efreet_mime_globs_type_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ efreet_mime_magic_type_get()

EAPI const char * efreet_mime_magic_type_get | ( | const char * | file | ) |

Retrieve the mime type of a file using magic.

Parameters

  file | The file to check the mime type

Returns
  Mime type as a string.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ efreet_mime_globs_type_get()

EAPI const char * efreet_mime_globs_type_get | ( | const char * | file | ) |

Retrieve the mime type of a file using globs.

Parameters

  file | The file to check the mime type

Returns
  Mime type as a string.

References alloca(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by efreet_mime_type_get().

## ◆ efreet_mime_special_type_get()

EAPI const char * efreet_mime_special_type_get | ( | const char * | file | ) |

Retrieve the special mime type of a file.

Parameters

  file | The file to check the mime type

Returns
  Mime type as a string.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ efreet_mime_fallback_type_get()

EAPI const char * efreet_mime_fallback_type_get | ( | const char * | file | ) |

Retrieve the fallback mime type of a file.

Parameters

  file | The file to check the mime type

Returns
  Mime type as a string.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ efreet_mime_type_icon_get()

EAPI const char * efreet_mime_type_icon_get | ( | const char * | mime,
|  | const char * | theme,
|  | unsigned int | size
| ) |  |

Retrieve the mime type icon for a file.

Parameters

  mime | The name of the mime type
  theme | The name of the theme to search icons in
  size | The wanted size of the icon

Returns
  Mime type icon path as a string.

References efreet_desktop_environment_get(), efreet_icon_list_find(), eina_list_append(), eina_list_remove_list(), EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), and eina_stringshare_del().

## ◆ efreet_mime_type_cache_flush()

EAPI void efreet_mime_type_cache_flush | ( | void |  | ) |

Flush mime icons mapping cache.

Flush timeout is defined at compile time by EFREET_MIME_ICONS_FLUSH_TIMEOUT

References ecore_loop_time_get().