]> www.fi.muni.cz Git - evince.git/blob - cut-n-paste/recent-files/egg-recent-item.h
Fix printing with poppler splash backend. Fixes bug #489774.
[evince.git] / cut-n-paste / recent-files / egg-recent-item.h
1
2 #ifndef __EGG_RECENT_ITEM_H__
3 #define __EGG_RECENT_ITEM_H__
4
5 #include <time.h>
6 #include <glib.h>
7 #include <glib-object.h>
8
9 G_BEGIN_DECLS
10
11 #define EGG_TYPE_RECENT_ITEM       (egg_recent_item_get_type ())
12
13 #define EGG_RECENT_ITEM_LIST_UNREF(list) \
14         g_list_foreach (list, (GFunc)egg_recent_item_unref, NULL); \
15         g_list_free (list);
16
17 typedef struct _EggRecentItem EggRecentItem;
18
19 struct _EggRecentItem {
20         /* do not access any of these directly */
21         gchar *uri;
22         gchar *mime_type;
23         time_t timestamp;
24
25         gboolean private_data;
26
27         GList *groups;
28         
29         int refcount;
30
31         guint mime_type_is_explicit : 1;
32 };
33
34 GType           egg_recent_item_get_type (void) G_GNUC_CONST;
35
36 /* constructors */
37 EggRecentItem * egg_recent_item_new (void);
38
39 EggRecentItem * egg_recent_item_ref (EggRecentItem *item);
40 EggRecentItem * egg_recent_item_unref (EggRecentItem *item);
41
42 /* automatically fetches the mime type, etc */
43 EggRecentItem * egg_recent_item_new_from_uri (const gchar *uri);
44
45 gboolean egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri);
46 gchar * egg_recent_item_get_uri (const EggRecentItem *item);
47 gchar * egg_recent_item_get_uri_utf8 (const EggRecentItem *item);
48 gchar * egg_recent_item_get_uri_for_display (const EggRecentItem *item);
49 gchar * egg_recent_item_get_short_name (const EggRecentItem *item);
50
51 void egg_recent_item_set_mime_type (EggRecentItem *item, const gchar *mime);
52 gchar * egg_recent_item_get_mime_type (EggRecentItem *item);
53
54 void egg_recent_item_set_timestamp (EggRecentItem *item, time_t timestamp);
55 time_t egg_recent_item_get_timestamp (const EggRecentItem *item);
56
57 G_CONST_RETURN gchar *egg_recent_item_peek_uri (const EggRecentItem *item);
58
59
60 /* groups */
61 G_CONST_RETURN GList *  egg_recent_item_get_groups (const EggRecentItem *item);
62
63 gboolean       egg_recent_item_in_group (const EggRecentItem *item,
64                                            const gchar *group_name);
65
66 void           egg_recent_item_add_group (EggRecentItem *item,
67                                             const gchar *group_name);
68
69 void           egg_recent_item_remove_group (EggRecentItem *item,
70                                                const gchar *group_name);
71
72 void           egg_recent_item_set_private (EggRecentItem *item,
73                                               gboolean priv);
74
75 gboolean       egg_recent_item_get_private (const EggRecentItem *item);
76
77
78 G_END_DECLS
79
80 #endif /* __EGG_RECENT_ITEM_H__ */