]> www.fi.muni.cz Git - evince.git/blob - cut-n-paste/recent-files/egg-recent-item.h
Initial revision
[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
32 GType           egg_recent_item_get_type (void) G_GNUC_CONST;
33
34 /* constructors */
35 EggRecentItem * egg_recent_item_new (void);
36
37 EggRecentItem * egg_recent_item_ref (EggRecentItem *item);
38 EggRecentItem * egg_recent_item_unref (EggRecentItem *item);
39
40 /* automatically fetches the mime type, etc */
41 EggRecentItem * egg_recent_item_new_from_uri (const gchar *uri);
42
43 gboolean egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri);
44 gchar * egg_recent_item_get_uri (const EggRecentItem *item);
45 gchar * egg_recent_item_get_uri_utf8 (const EggRecentItem *item);
46 gchar * egg_recent_item_get_uri_for_display (const EggRecentItem *item);
47 gchar * egg_recent_item_get_short_name (const EggRecentItem *item);
48
49 void egg_recent_item_set_mime_type (EggRecentItem *item, const gchar *mime);
50 gchar * egg_recent_item_get_mime_type (const EggRecentItem *item);
51
52 void egg_recent_item_set_timestamp (EggRecentItem *item, time_t timestamp);
53 time_t egg_recent_item_get_timestamp (const EggRecentItem *item);
54
55 G_CONST_RETURN gchar *egg_recent_item_peek_uri (const EggRecentItem *item);
56
57
58 /* groups */
59 G_CONST_RETURN GList *  egg_recent_item_get_groups (const EggRecentItem *item);
60
61 gboolean       egg_recent_item_in_group (const EggRecentItem *item,
62                                            const gchar *group_name);
63
64 void           egg_recent_item_add_group (EggRecentItem *item,
65                                             const gchar *group_name);
66
67 void           egg_recent_item_remove_group (EggRecentItem *item,
68                                                const gchar *group_name);
69
70 void           egg_recent_item_set_private (EggRecentItem *item,
71                                               gboolean priv);
72
73 gboolean       egg_recent_item_get_private (const EggRecentItem *item);
74
75
76 G_END_DECLS
77
78 #endif /* __EGG_RECENT_ITEM_H__ */