source: trunk/third/gnome-vfs/libgnomevfs/gnome-vfs-mime-handlers.h @ 15497

Revision 15497, 6.9 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15496, which included commits to RCS files with non-trunk default branches.
Line 
1/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2
3/* gnome-vfs-mime-handlers.h - Mime type handlers for the GNOME Virtual
4   File System.
5
6   Copyright (C) 2000 Eazel, Inc.
7
8   The Gnome Library is free software; you can redistribute it and/or
9   modify it under the terms of the GNU Library General Public License as
10   published by the Free Software Foundation; either version 2 of the
11   License, or (at your option) any later version.
12
13   The Gnome Library is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16   Library General Public License for more details.
17
18   You should have received a copy of the GNU Library General Public
19   License along with the Gnome Library; see the file COPYING.LIB.  If not,
20   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21   Boston, MA 02111-1307, USA.
22
23   Author: Maciej Stachowiak <mjs@eazel.com> */
24
25#ifndef GNOME_VFS_MIME_HANDLERS_H
26#define GNOME_VFS_MIME_HANDLERS_H
27
28#include <glib.h>
29#include <liboaf/liboaf.h>
30#include <libgnomevfs/gnome-vfs-types.h> /* for GnomeVFSResult */
31
32typedef enum {
33        GNOME_VFS_MIME_ACTION_TYPE_NONE,
34        GNOME_VFS_MIME_ACTION_TYPE_APPLICATION,
35        GNOME_VFS_MIME_ACTION_TYPE_COMPONENT
36} GnomeVFSMimeActionType;
37
38typedef struct {
39        char *id;
40        char *name;
41        char *command;
42        gboolean can_open_multiple_files;
43        gboolean can_open_uris;
44        gboolean requires_terminal;
45} GnomeVFSMimeApplication;
46
47typedef struct {
48        GnomeVFSMimeActionType action_type;
49        union {
50                OAF_ServerInfo *component;
51                void *dummy_component;
52                GnomeVFSMimeApplication *application;
53        } action;
54} GnomeVFSMimeAction;
55
56GnomeVFSMimeApplication *gnome_vfs_mime_application_copy                   (GnomeVFSMimeApplication *application);
57GnomeVFSMimeActionType   gnome_vfs_mime_get_default_action_type            (const char              *mime_type);
58GnomeVFSMimeAction *     gnome_vfs_mime_get_default_action                 (const char              *mime_type);
59GnomeVFSMimeAction *     gnome_vfs_mime_get_default_action_without_fallback(const char              *mime_type);
60GnomeVFSMimeApplication *gnome_vfs_mime_get_default_application            (const char              *mime_type);
61OAF_ServerInfo *         gnome_vfs_mime_get_default_component              (const char              *mime_type);
62GList *                  gnome_vfs_mime_get_short_list_applications        (const char              *mime_type);
63GList *                  gnome_vfs_mime_get_short_list_components          (const char              *mime_type);
64GList *                  gnome_vfs_mime_get_all_applications               (const char              *mime_type);
65GList *                  gnome_vfs_mime_get_all_components                 (const char              *mime_type);
66GnomeVFSResult           gnome_vfs_mime_set_default_action_type            (const char              *mime_type,
67                                                                            GnomeVFSMimeActionType   action_type);
68GnomeVFSResult           gnome_vfs_mime_set_default_application            (const char              *mime_type,
69                                                                            const char              *application_id);
70GnomeVFSResult           gnome_vfs_mime_set_default_component              (const char              *mime_type,
71                                                                            const char              *component_iid);
72const char              *gnome_vfs_mime_get_icon                           (const char              *mime_type);
73GnomeVFSResult           gnome_vfs_mime_set_icon                           (const char              *mime_type,
74                                                                            const char              *filename);
75const char              *gnome_vfs_mime_get_description                    (const char              *mime_type);
76
77/* Stored as delta to current user level - API function computes delta and stores in prefs */
78GnomeVFSResult           gnome_vfs_mime_set_short_list_applications        (const char              *mime_type,
79                                                                            GList                   *application_ids);
80GnomeVFSResult           gnome_vfs_mime_set_short_list_components          (const char              *mime_type,
81                                                                            GList                   *component_ids);
82GnomeVFSResult           gnome_vfs_mime_add_application_to_short_list      (const char              *uri,
83                                                                            const char              *application_id);
84GnomeVFSResult           gnome_vfs_mime_remove_application_from_short_list (const char              *uri,
85                                                                            const char              *application_id);
86GnomeVFSResult           gnome_vfs_mime_add_component_to_short_list        (const char              *uri,
87                                                                            const char              *iid);
88GnomeVFSResult           gnome_vfs_mime_remove_component_from_short_list   (const char              *uri,
89                                                                            const char              *iid);
90GnomeVFSResult           gnome_vfs_mime_add_extension                      (const char              *mime_type,
91                                                                            const char              *extension);
92GnomeVFSResult           gnome_vfs_mime_remove_extension                   (const char              *mime_type,
93                                                                            const char              *extension);
94
95
96/* No way to override system list; can only add. */
97GnomeVFSResult           gnome_vfs_mime_extend_all_applications            (const char              *mime_type,
98                                                                            GList                   *application_ids);
99/* Only "user" entries may be removed. */
100GnomeVFSResult           gnome_vfs_mime_remove_from_all_applications       (const char              *mime_type,
101                                                                            GList                   *application_ids);
102GnomeVFSMimeApplication *gnome_vfs_mime_application_new_from_id            (const char              *id);
103void                     gnome_vfs_mime_application_free                   (GnomeVFSMimeApplication *application);
104void                     gnome_vfs_mime_action_free                        (GnomeVFSMimeAction      *action);
105
106/* List manipulation helper functions */
107void                     gnome_vfs_mime_application_list_free              (GList                   *list);
108void                     gnome_vfs_mime_component_list_free                (GList                   *list);
109gboolean                 gnome_vfs_mime_id_in_application_list             (const char              *id,
110                                                                            GList                   *applications);
111gboolean                 gnome_vfs_mime_id_in_component_list               (const char              *iid,
112                                                                            GList                   *components);
113GList *                  gnome_vfs_mime_remove_application_from_list       (GList                   *applications,
114                                                                            const char              *application_id,
115                                                                            gboolean                *did_remove);
116GList *                  gnome_vfs_mime_remove_component_from_list         (GList                   *components,
117                                                                            const char              *iid,
118                                                                            gboolean                *did_remove);
119GList *                  gnome_vfs_mime_id_list_from_component_list        (GList                   *components);
120GList *                  gnome_vfs_mime_id_list_from_application_list      (GList                   *applications);
121
122#endif /* GNOME_VFS_MIME_HANDLERS_H */
Note: See TracBrowser for help on using the repository browser.