1 /* GTK - The GIMP Toolkit
2 * gtkrecentfilter.h - Filter object for recently used resources
3 * Copyright (C) 2006, Emmanuele Bassi
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22 #error "Only <gtk/gtk.h> can be included directly."
25 #ifndef __GTK_RECENT_FILTER_H__
26 #define __GTK_RECENT_FILTER_H__
28 #include <glib-object.h>
32 #define GTK_TYPE_RECENT_FILTER (gtk_recent_filter_get_type ())
33 #define GTK_RECENT_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RECENT_FILTER, GtkRecentFilter))
34 #define GTK_IS_RECENT_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RECENT_FILTER))
36 typedef struct _GtkRecentFilter GtkRecentFilter;
37 typedef struct _GtkRecentFilterInfo GtkRecentFilterInfo;
40 GTK_RECENT_FILTER_URI = 1 << 0,
41 GTK_RECENT_FILTER_DISPLAY_NAME = 1 << 1,
42 GTK_RECENT_FILTER_MIME_TYPE = 1 << 2,
43 GTK_RECENT_FILTER_APPLICATION = 1 << 3,
44 GTK_RECENT_FILTER_GROUP = 1 << 4,
45 GTK_RECENT_FILTER_AGE = 1 << 5
46 } GtkRecentFilterFlags;
48 typedef gboolean (*GtkRecentFilterFunc) (const GtkRecentFilterInfo *filter_info,
51 struct _GtkRecentFilterInfo
53 GtkRecentFilterFlags contains;
56 const gchar *display_name;
57 const gchar *mime_type;
58 const gchar **applications;
64 GType gtk_recent_filter_get_type (void) G_GNUC_CONST;
66 GtkRecentFilter * gtk_recent_filter_new (void);
67 void gtk_recent_filter_set_name (GtkRecentFilter *filter,
69 G_CONST_RETURN gchar *gtk_recent_filter_get_name (GtkRecentFilter *filter);
71 void gtk_recent_filter_add_mime_type (GtkRecentFilter *filter,
72 const gchar *mime_type);
73 void gtk_recent_filter_add_pattern (GtkRecentFilter *filter,
74 const gchar *pattern);
75 void gtk_recent_filter_add_pixbuf_formats (GtkRecentFilter *filter);
76 void gtk_recent_filter_add_application (GtkRecentFilter *filter,
77 const gchar *application);
78 void gtk_recent_filter_add_group (GtkRecentFilter *filter,
80 void gtk_recent_filter_add_age (GtkRecentFilter *filter,
82 void gtk_recent_filter_add_custom (GtkRecentFilter *filter,
83 GtkRecentFilterFlags needed,
84 GtkRecentFilterFunc func,
86 GDestroyNotify data_destroy);
88 GtkRecentFilterFlags gtk_recent_filter_get_needed (GtkRecentFilter *filter);
89 gboolean gtk_recent_filter_filter (GtkRecentFilter *filter,
90 const GtkRecentFilterInfo *filter_info);
94 #endif /* ! __GTK_RECENT_FILTER_H__ */