2002-01-08 21:25:33 +00:00
|
|
|
/* -*- mode: c; style: linux -*- */
|
|
|
|
|
|
|
|
/* mime-type-info.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Ximian, Inc.
|
|
|
|
*
|
|
|
|
* Written by Bradford Hovinen <hovinen@ximian.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MIME_TYPE_INFO_H
|
|
|
|
#define __MIME_TYPE_INFO_H
|
|
|
|
|
|
|
|
#include <gnome.h>
|
|
|
|
#include <bonobo.h>
|
2002-01-11 14:17:40 +00:00
|
|
|
#include <libgnomevfs/gnome-vfs-mime-info.h>
|
2002-01-08 21:25:33 +00:00
|
|
|
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
|
|
|
|
|
2002-01-25 16:12:01 +00:00
|
|
|
#include "model-entry.h"
|
|
|
|
|
2002-01-08 21:25:33 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2002-01-25 16:12:01 +00:00
|
|
|
#define MIME_TYPE_INFO(obj) ((MimeTypeInfo *) obj)
|
2002-01-26 16:24:45 +00:00
|
|
|
#define MIME_CATEGORY_INFO(obj) ((MimeCategoryInfo *) obj)
|
2002-01-25 16:12:01 +00:00
|
|
|
|
2002-01-08 21:25:33 +00:00
|
|
|
typedef struct _MimeTypeInfo MimeTypeInfo;
|
2002-01-26 16:24:45 +00:00
|
|
|
typedef struct _MimeCategoryInfo MimeCategoryInfo;
|
2002-01-08 21:25:33 +00:00
|
|
|
|
|
|
|
struct _MimeTypeInfo
|
|
|
|
{
|
2002-01-25 16:12:01 +00:00
|
|
|
ModelEntry entry;
|
2002-01-11 15:32:10 +00:00
|
|
|
|
2002-01-08 21:25:33 +00:00
|
|
|
gchar *mime_type;
|
|
|
|
gchar *description;
|
|
|
|
gchar *icon_name;
|
2002-01-25 17:27:02 +00:00
|
|
|
gchar *icon_path;
|
2002-01-08 21:25:33 +00:00
|
|
|
GList *file_extensions;
|
|
|
|
|
2002-01-25 16:12:01 +00:00
|
|
|
GdkPixbuf *icon_pixbuf;
|
|
|
|
GdkPixbuf *small_icon_pixbuf;
|
|
|
|
|
2002-01-27 18:37:07 +00:00
|
|
|
gboolean use_category;
|
2002-01-27 19:54:56 +00:00
|
|
|
gboolean use_cat_loaded;
|
2002-01-27 17:41:06 +00:00
|
|
|
|
2002-01-25 16:12:01 +00:00
|
|
|
Bonobo_ServerInfo *default_component;
|
2002-01-08 21:25:33 +00:00
|
|
|
GnomeVFSMimeApplication *default_action;
|
|
|
|
};
|
|
|
|
|
2002-01-26 16:24:45 +00:00
|
|
|
struct _MimeCategoryInfo
|
|
|
|
{
|
|
|
|
ModelEntry entry;
|
|
|
|
|
|
|
|
gchar *name;
|
2002-02-17 18:48:49 +00:00
|
|
|
gchar *description;
|
2002-01-26 16:24:45 +00:00
|
|
|
GnomeVFSMimeApplication *default_action;
|
2002-01-27 19:09:37 +00:00
|
|
|
|
|
|
|
gboolean use_parent_category;
|
2002-01-27 19:54:56 +00:00
|
|
|
gboolean use_parent_cat_loaded;
|
2002-01-26 16:24:45 +00:00
|
|
|
};
|
|
|
|
|
2002-01-27 16:18:36 +00:00
|
|
|
void load_all_mime_types (GtkTreeModel *model);
|
2002-01-25 16:12:01 +00:00
|
|
|
|
2002-01-27 16:18:36 +00:00
|
|
|
MimeTypeInfo *mime_type_info_new (const gchar *mime_type,
|
|
|
|
GtkTreeModel *model);
|
2002-01-25 16:12:01 +00:00
|
|
|
|
|
|
|
void mime_type_info_load_all (MimeTypeInfo *info);
|
|
|
|
const gchar *mime_type_info_get_description (MimeTypeInfo *info);
|
|
|
|
GdkPixbuf *mime_type_info_get_icon (MimeTypeInfo *info);
|
|
|
|
const GList *mime_type_info_get_file_extensions (MimeTypeInfo *info);
|
2002-01-25 17:27:02 +00:00
|
|
|
const gchar *mime_type_info_get_icon_path (MimeTypeInfo *info);
|
2002-01-28 16:43:40 +00:00
|
|
|
gboolean mime_type_info_get_use_category (MimeTypeInfo *info);
|
2002-01-25 16:12:01 +00:00
|
|
|
|
2002-06-18 18:55:14 +00:00
|
|
|
void mime_type_info_save (MimeTypeInfo *info);
|
2002-01-25 16:12:01 +00:00
|
|
|
void mime_type_info_free (MimeTypeInfo *info);
|
|
|
|
|
|
|
|
gchar *mime_type_info_get_file_extensions_pretty_string
|
|
|
|
(MimeTypeInfo *info);
|
|
|
|
gchar *mime_type_info_get_category_name (const MimeTypeInfo *info);
|
|
|
|
|
|
|
|
void mime_type_info_set_category_name (const MimeTypeInfo *info,
|
2002-01-27 16:18:36 +00:00
|
|
|
const gchar *category_name,
|
2002-02-17 18:48:49 +00:00
|
|
|
const gchar *category_desc,
|
2002-01-27 16:18:36 +00:00
|
|
|
GtkTreeModel *model);
|
2002-01-25 16:12:01 +00:00
|
|
|
void mime_type_info_set_file_extensions (MimeTypeInfo *info,
|
|
|
|
GList *list);
|
2002-01-08 21:25:33 +00:00
|
|
|
|
2002-01-26 16:24:45 +00:00
|
|
|
MimeCategoryInfo *mime_category_info_new (MimeCategoryInfo *parent,
|
2002-01-27 16:18:36 +00:00
|
|
|
const gchar *name,
|
2002-02-17 18:48:49 +00:00
|
|
|
const gchar *description,
|
2002-01-27 16:18:36 +00:00
|
|
|
GtkTreeModel *model);
|
2002-01-26 16:24:45 +00:00
|
|
|
void mime_category_info_load_all (MimeCategoryInfo *category);
|
|
|
|
void mime_category_info_save (MimeCategoryInfo *category);
|
2002-01-28 16:43:40 +00:00
|
|
|
|
2002-01-26 16:24:45 +00:00
|
|
|
GList *mime_category_info_find_apps (MimeCategoryInfo *info);
|
2002-01-27 19:02:15 +00:00
|
|
|
gchar *mime_category_info_get_full_name (MimeCategoryInfo *info);
|
2002-02-17 18:48:49 +00:00
|
|
|
gchar *mime_category_info_get_full_description (MimeCategoryInfo *info);
|
2002-01-08 21:25:33 +00:00
|
|
|
|
2002-01-27 16:58:43 +00:00
|
|
|
gchar *mime_type_get_pretty_name_for_server (Bonobo_ServerInfo *server);
|
|
|
|
|
|
|
|
MimeTypeInfo *get_mime_type_info (const gchar *mime_type);
|
2002-01-08 21:25:33 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __MIME_TYPE_INFO_H */
|