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
#ifndef __GTK_RECENT_FILTER_H__
22
#define __GTK_RECENT_FILTER_H__
24
#include <glib-object.h>
28
#define GTK_TYPE_RECENT_FILTER (gtk_recent_filter_get_type ())
29
#define GTK_RECENT_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RECENT_FILTER, GtkRecentFilter))
30
#define GTK_IS_RECENT_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RECENT_FILTER))
32
typedef struct _GtkRecentFilter GtkRecentFilter;
33
typedef struct _GtkRecentFilterInfo GtkRecentFilterInfo;
36
GTK_RECENT_FILTER_URI = 1 << 0,
37
GTK_RECENT_FILTER_DISPLAY_NAME = 1 << 1,
38
GTK_RECENT_FILTER_MIME_TYPE = 1 << 2,
39
GTK_RECENT_FILTER_APPLICATION = 1 << 3,
40
GTK_RECENT_FILTER_GROUP = 1 << 4,
41
GTK_RECENT_FILTER_AGE = 1 << 5
42
} GtkRecentFilterFlags;
44
typedef gboolean (*GtkRecentFilterFunc) (const GtkRecentFilterInfo *filter_info,
47
struct _GtkRecentFilterInfo
49
GtkRecentFilterFlags contains;
52
const gchar *display_name;
53
const gchar *mime_type;
54
const gchar **applications;
60
GType gtk_recent_filter_get_type (void) G_GNUC_CONST;
62
GtkRecentFilter * gtk_recent_filter_new (void);
63
void gtk_recent_filter_set_name (GtkRecentFilter *filter,
65
G_CONST_RETURN gchar *gtk_recent_filter_get_name (GtkRecentFilter *filter);
67
void gtk_recent_filter_add_mime_type (GtkRecentFilter *filter,
68
const gchar *mime_type);
69
void gtk_recent_filter_add_pattern (GtkRecentFilter *filter,
70
const gchar *pattern);
71
void gtk_recent_filter_add_pixbuf_formats (GtkRecentFilter *filter);
72
void gtk_recent_filter_add_application (GtkRecentFilter *filter,
73
const gchar *application);
74
void gtk_recent_filter_add_group (GtkRecentFilter *filter,
76
void gtk_recent_filter_add_age (GtkRecentFilter *filter,
78
void gtk_recent_filter_add_custom (GtkRecentFilter *filter,
79
GtkRecentFilterFlags needed,
80
GtkRecentFilterFunc func,
82
GDestroyNotify data_destroy);
84
GtkRecentFilterFlags gtk_recent_filter_get_needed (GtkRecentFilter *filter);
85
gboolean gtk_recent_filter_filter (GtkRecentFilter *filter,
86
const GtkRecentFilterInfo *filter_info);
90
#endif /* ! __GTK_RECENT_FILTER_H__ */