summaryrefslogtreecommitdiff
path: root/src/lib/efreet/Efreet_Mime.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/efreet/Efreet_Mime.h')
-rw-r--r--src/lib/efreet/Efreet_Mime.h129
1 files changed, 129 insertions, 0 deletions
diff --git a/src/lib/efreet/Efreet_Mime.h b/src/lib/efreet/Efreet_Mime.h
new file mode 100644
index 0000000..5bfd418
--- /dev/null
+++ b/src/lib/efreet/Efreet_Mime.h
@@ -0,0 +1,129 @@
1#ifndef EFREET_MIME_H
2#define EFREET_MIME_H
3
4/**
5 * @file Efreet_Mime.h
6 * @brief The file that must be included by any project wishing to use
7 * @addtogroup Efreet_Mime Efreet_Mime: The XDG Shared Mime Info standard
8 * Efreet Mime is a library designed to help apps work with the
9 * Freedesktop.org Shared Mime Info standard.
10 * Efreet_Mime.h provides all of the necessary headers and
11 * includes to work with Efreet_Mime.
12 *
13 * @ingroup Efreet
14 * @{
15 */
16
17#ifdef EAPI
18# undef EAPI
19#endif
20
21#ifdef _WIN32
22# ifdef EFL_EFREET_MIME_BUILD
23# ifdef DLL_EXPORT
24# define EAPI __declspec(dllexport)
25# else
26# define EAPI
27# endif /* ! DLL_EXPORT */
28# else
29# define EAPI __declspec(dllimport)
30# endif /* ! EFL_EFREET_MIME_BUILD */
31#else
32# ifdef __GNUC__
33# if __GNUC__ >= 4
34# define EAPI __attribute__ ((visibility("default")))
35# else
36# define EAPI
37# endif
38# else
39# define EAPI
40# endif
41#endif
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47
48/**
49 * @return @c 1 on success or @c 0 on failure.
50 * @brief Initializes the efreet mime settings
51 */
52EAPI int efreet_mime_init(void);
53
54/**
55 * @return The number of times the init function has been called minus the
56 * corresponding init call.
57 * @brief Shuts down Efreet mime settings system if a balanced number of
58 * init/shutdown calls have been made
59 */
60EAPI int efreet_mime_shutdown(void);
61
62/**
63 * @param file The file to find the mime type
64 * @return Mime type as a string.
65 * @brief Retrieve the mime type of a file
66 */
67EAPI const char *efreet_mime_type_get(const char *file);
68
69/**
70 * @param file The file to check the mime type
71 * @return Mime type as a string.
72 * @brief Retrieve the mime type of a file using magic
73 */
74EAPI const char *efreet_mime_magic_type_get(const char *file);
75
76/**
77 * @param file The file to check the mime type
78 * @return Mime type as a string.
79 * @brief Retrieve the mime type of a file using globs
80 */
81EAPI const char *efreet_mime_globs_type_get(const char *file);
82
83/**
84 * @param file The file to check the mime type
85 * @return Mime type as a string.
86 * @brief Retrieve the special mime type of a file
87 */
88EAPI const char *efreet_mime_special_type_get(const char *file);
89
90/**
91 * @param file The file to check the mime type
92 * @return Mime type as a string.
93 * @brief Retrieve the fallback mime type of a file.
94 */
95EAPI const char *efreet_mime_fallback_type_get(const char *file);
96
97
98/**
99 * @param mime The name of the mime type
100 * @param theme The name of the theme to search icons in
101 * @param size The wanted size of the icon
102 * @return Mime type icon path as a string.
103 * @brief Retrieve the mime type icon for a file.
104 */
105EAPI const char *efreet_mime_type_icon_get(const char *mime, const char *theme,
106 unsigned int size);
107
108/**
109 * @brief Clear mime icons mapping cache
110 */
111EAPI void efreet_mime_type_cache_clear(void);
112
113/**
114 * @brief Flush mime icons mapping cache
115 *
116 * Flush timeout is defined at compile time by
117 * EFREET_MIME_ICONS_FLUSH_TIMEOUT
118 */
119EAPI void efreet_mime_type_cache_flush(void);
120
121/**
122 * @}
123 */
124
125#ifdef __cplusplus
126}
127#endif
128
129#endif