1 /* -*- Mode: C; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 3 -*- */
2 
3 /*
4  * GImageView
5  * Copyright (C) 2001-2002 Takuro Ashie
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  *
21  * $Id: gimv_mime_types.h,v 1.2 2003/06/13 09:43:32 makeinu Exp $
22  */
23 
24 #ifndef __GIMV_MIME_TYPES_H__
25 #define __GIMV_MIME_TYPES_H__
26 
27 #ifdef HAVE_CONFIG_H
28 #  include "config.h"
29 #endif
30 
31 #include <gmodule.h>
32 #include "gimv_icon_stock.h"
33 
34 typedef struct GimvMimeTypeEntry_Taq
35 {
36    const gchar  *mime_type;
37 
38    const gchar  *description;
39 
40    const gchar **extensions;
41    const gint    extensions_len;
42    const GimvIconStockEntry *icon;
43 } GimvMimeTypeEntry;
44 
45 typedef struct GimvMimeTypePluginEntry_Tag
46 {
47    const gchar *type;
48    const gchar *name;
49 } GimvMimeTypePluginEntry;
50 
51 typedef struct GimvMimeType_Tag
52 {
53    const gchar  *mime_type;
54    GList        *extensions_list;
55    GList        *plugins_list;
56    GList        *icons_list;
57 } GimvMimeType;
58 
59 gboolean gimv_mime_types_regist         (GimvMimeTypeEntry *entry,
60                                          GModule           *module);
61 gboolean gimv_mime_types_add_extension  (const gchar *mime_type,
62                                          const gchar *extension);
63 gboolean gimv_mime_types_resolve_by_ext (const gchar       *ext,
64                                          const gchar      **mime_type,
65                                          const gchar      **plugin_type);
66 
67 void         gimv_mime_types_update_known_enabled_ext_list (void);
68 void         gimv_mime_types_update_userdef_ext_list       (void);
69 GList       *gimv_mime_types_get_known_ext_list            (void);
70 GList       *gimv_mime_types_get_known_enabled_ext_list    (void);
71 GList       *gimv_mime_types_get_userdef_ext_list          (void);
72 const gchar *gimv_mime_types_get_type_from_ext             (const gchar *ext);
73 
74 const gchar *gimv_mime_types_get_extension                 (const gchar *filename);
75 gboolean     gimv_mime_types_extension_is                  (const gchar *filename,
76                                                             const gchar *ext);
77 
78 #endif /* __GIMV_MIME_TYPES_H__ */
79