EFL 1.7 svn doobies
[profile/ivi/efreet.git] / src / lib / Efreet_Mime.h
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  */
14
15 #ifdef EAPI
16 # undef EAPI
17 #endif
18
19 #ifdef _WIN32
20 # ifdef EFL_EFREET_MIME_BUILD
21 #  ifdef DLL_EXPORT
22 #   define EAPI __declspec(dllexport)
23 #  else
24 #   define EAPI
25 #  endif /* ! DLL_EXPORT */
26 # else
27 #  define EAPI __declspec(dllimport)
28 # endif /* ! EFL_EFREET_MIME_BUILD */
29 #else
30 # ifdef __GNUC__
31 #  if __GNUC__ >= 4
32 #   define EAPI __attribute__ ((visibility("default")))
33 #  else
34 #   define EAPI
35 #  endif
36 # else
37 #  define EAPI
38 # endif
39 #endif
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45
46 /**
47  * @return @c 1 on success or @c 0 on failure.
48  * @brief Initializes the efreet mime settings
49  */
50 EAPI int         efreet_mime_init(void);
51
52 /**
53  * @return No value.
54  * @brief Cleans up the efreet mime settings system
55  */
56 EAPI int         efreet_mime_shutdown(void);
57
58 /**
59  * @param file The file to find the mime type
60  * @return Mime type as a string.
61  * @brief Retrieve the mime type of a file
62  */
63 EAPI const char *efreet_mime_type_get(const char *file);
64
65 /**
66  * @param file The file to check the mime type
67  * @return Mime type as a string.
68  * @brief Retrieve the mime type of a file using magic
69  */
70 EAPI const char *efreet_mime_magic_type_get(const char *file);
71
72 /**
73  * @param file The file to check the mime type
74  * @return Mime type as a string.
75  * @brief Retrieve the mime type of a file using globs
76  */
77 EAPI const char *efreet_mime_globs_type_get(const char *file);
78
79 /**
80  * @param file The file to check the mime type
81  * @return Mime type as a string.
82  * @brief Retrieve the special mime type of a file
83  */
84 EAPI const char *efreet_mime_special_type_get(const char *file);
85
86 /**
87  * @param file The file to check the mime type
88  * @return Mime type as a string.
89  * @brief Retrieve the fallback mime type of a file.
90  */
91 EAPI const char *efreet_mime_fallback_type_get(const char *file);
92
93
94 /**
95  * @param mime The name of the mime type
96  * @param theme The name of the theme to search icons in
97  * @param size The wanted size of the icon
98  * @return Mime type icon path as a string.
99  * @brief Retrieve the mime type icon for a file.
100  */
101 EAPI const char *efreet_mime_type_icon_get(const char *mime, const char *theme,
102                                            unsigned int size);
103
104 /**
105  * @brief Clear mime icons mapping cache
106  */
107 EAPI void efreet_mime_type_cache_clear(void);
108
109 /**
110  * @brief Flush mime icons mapping cache
111  *
112  * Flush timeout is defined at compile time by
113  * EFREET_MIME_ICONS_FLUSH_TIMEOUT
114  */
115 EAPI void efreet_mime_type_cache_flush(void);
116
117 /**
118  * @}
119  */
120
121 #ifdef __cplusplus
122 }
123 #endif
124
125 #endif