source: trunk/third/gnome-vfs/libgnomevfs/gnome-vfs-application-registry.h @ 15497

Revision 15497, 3.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-application-registry.h
4 *
5 * Copyright (C) 1998 Miguel de Icaza
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/*
24 * Authors: George Lebl
25 *      Based on original mime-info database code by Miguel de Icaza
26 */
27
28#ifndef GNOME_VFS_APPLICATION_REGISTRY_H
29#define GNOME_VFS_APPLICATION_REGISTRY_H
30
31#include <libgnomevfs/gnome-vfs-types.h> /* for GnomeVFSResult */
32#include <libgnomevfs/gnome-vfs-mime-handlers.h>
33#include <glib.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif /*__cplusplus*/
38
39/* These are the standard string keys to get */
40#define GNOME_VFS_APPLICATION_REGISTRY_COMMAND "command"
41#define GNOME_VFS_APPLICATION_REGISTRY_NAME "name"
42
43/* These are the standard boolean keys to get */
44#define GNOME_VFS_APPLICATION_REGISTRY_CAN_OPEN_MULTIPLE_FILES "can_open_multiple_files"
45#define GNOME_VFS_APPLICATION_REGISTRY_CAN_OPEN_URIS "can_open_uris"
46#define GNOME_VFS_APPLICATION_REGISTRY_REQUIRES_TERMINAL "requires_terminal"
47
48/*
49 * Existance check
50 */
51gboolean        gnome_vfs_application_registry_exists           (const char *app_id);
52
53/*
54 * Getting arbitrary keys
55 */
56GList           *gnome_vfs_application_registry_get_keys        (const char *app_id);
57const char      *gnome_vfs_application_registry_peek_value      (const char *app_id,
58                                                                 const char *key);
59gboolean        gnome_vfs_application_registry_get_bool_value   (const char *app_id,
60                                                                 const char *key,
61                                                                 gboolean *got_key);
62
63/*
64 * Setting stuff
65 */
66void            gnome_vfs_application_registry_remove_application(const char *app_id);
67void            gnome_vfs_application_registry_set_value        (const char *app_id,
68                                                                 const char *key,
69                                                                 const char *value);
70void            gnome_vfs_application_registry_set_bool_value   (const char *app_id,
71                                                                 const char *key,
72                                                                 gboolean value);
73void            gnome_vfs_application_registry_unset_key        (const char *app_id,
74                                                                 const char *key);
75
76/*
77 * Query functions
78 */
79GList           *gnome_vfs_application_registry_get_applications(const char *mime_type);
80GList           *gnome_vfs_application_registry_get_mime_types  (const char *app_id);
81
82gboolean        gnome_vfs_application_registry_supports_mime_type(const char *app_id,
83                                                                  const char *mime_type);
84
85/*
86 * Mime type functions
87 * Note that mime_type can be a specific (image/png) or generic (image/<star>) type
88 */
89
90void            gnome_vfs_application_registry_clear_mime_types (const char *app_id);
91void            gnome_vfs_application_registry_add_mime_type    (const char *app_id,
92                                                                 const char *mime_type);
93void            gnome_vfs_application_registry_remove_mime_type (const char *app_id,
94                                                                 const char *mime_type);
95
96/*
97 * Commit function, should be called if ANY stuff changes have been made.
98 * Stuff is saved into the user directory.
99 */
100GnomeVFSResult  gnome_vfs_application_registry_sync             (void);
101
102void            gnome_vfs_application_registry_shutdown         (void);
103void            gnome_vfs_application_registry_reload           (void);
104
105/*
106 * Integrating with gnome-vfs-mime-handlers
107 */
108GnomeVFSMimeApplication *
109                gnome_vfs_application_registry_get_mime_application(const char *app_id);
110void            gnome_vfs_application_registry_save_mime_application(const GnomeVFSMimeApplication *application);
111
112#ifdef __cplusplus
113}
114#endif /*__cplusplus*/
115
116#endif /* GNOME_VFS_APPLICATION_REGISTRY_H */
Note: See TracBrowser for help on using the repository browser.