Macros | Functions
Efreet_Mime: The XDG Shared Mime Info standard

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. More...
 
EAPI int efreet_mime_shutdown (void)
 Shuts down Efreet mime settings system if a balanced number of init/shutdown calls have been made. More...
 
EAPI const char * efreet_mime_type_get (const char *file)
 Retrieve the mime type of a file. More...
 
EAPI const char * efreet_mime_magic_type_get (const char *file)
 Retrieve the mime type of a file using magic. More...
 
EAPI const char * efreet_mime_globs_type_get (const char *file)
 Retrieve the mime type of a file using globs. More...
 
EAPI const char * efreet_mime_special_type_get (const char *file)
 Retrieve the special mime type of a file. More...
 
EAPI const char * efreet_mime_fallback_type_get (const char *file)
 Retrieve the fallback mime type of a file. More...
 
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. More...
 
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. More...
 

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.

References efreet_init().

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.

References efreet_shutdown().

Referenced by 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
fileThe 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
fileThe 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
fileThe 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
fileThe 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
fileThe 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
mimeThe name of the mime type
themeThe name of the theme to search icons in
sizeThe wanted size of the icon
Returns
Mime type icon path as a string.

◆ 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().