diff options
author | Marco Pesenti Gritti <marco@src.gnome.org> | 2004-12-21 17:41:03 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2004-12-21 17:41:03 (GMT) |
commit | 69d92c409d333e5dd9cc82537c0834b201487c60 (patch) | |
tree | e982b034261d7c3c24992497e0a885e3d719ec0a /cut-n-paste/recent-files/egg-recent-item.h | |
parent | 4c2778e5714bbd5ae60e74133d1482acf162e719 (diff) |
Initial revision
Diffstat (limited to 'cut-n-paste/recent-files/egg-recent-item.h')
-rw-r--r-- | cut-n-paste/recent-files/egg-recent-item.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/cut-n-paste/recent-files/egg-recent-item.h b/cut-n-paste/recent-files/egg-recent-item.h new file mode 100644 index 0000000..5b3b405 --- /dev/null +++ b/cut-n-paste/recent-files/egg-recent-item.h @@ -0,0 +1,78 @@ + +#ifndef __EGG_RECENT_ITEM_H__ +#define __EGG_RECENT_ITEM_H__ + +#include <time.h> +#include <glib.h> +#include <glib-object.h> + +G_BEGIN_DECLS + +#define EGG_TYPE_RECENT_ITEM (egg_recent_item_get_type ()) + +#define EGG_RECENT_ITEM_LIST_UNREF(list) \ + g_list_foreach (list, (GFunc)egg_recent_item_unref, NULL); \ + g_list_free (list); + +typedef struct _EggRecentItem EggRecentItem; + +struct _EggRecentItem { + /* do not access any of these directly */ + gchar *uri; + gchar *mime_type; + time_t timestamp; + + gboolean private_data; + + GList *groups; + + int refcount; +}; + +GType egg_recent_item_get_type (void) G_GNUC_CONST; + +/* constructors */ +EggRecentItem * egg_recent_item_new (void); + +EggRecentItem * egg_recent_item_ref (EggRecentItem *item); +EggRecentItem * egg_recent_item_unref (EggRecentItem *item); + +/* automatically fetches the mime type, etc */ +EggRecentItem * egg_recent_item_new_from_uri (const gchar *uri); + +gboolean egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri); +gchar * egg_recent_item_get_uri (const EggRecentItem *item); +gchar * egg_recent_item_get_uri_utf8 (const EggRecentItem *item); +gchar * egg_recent_item_get_uri_for_display (const EggRecentItem *item); +gchar * egg_recent_item_get_short_name (const EggRecentItem *item); + +void egg_recent_item_set_mime_type (EggRecentItem *item, const gchar *mime); +gchar * egg_recent_item_get_mime_type (const EggRecentItem *item); + +void egg_recent_item_set_timestamp (EggRecentItem *item, time_t timestamp); +time_t egg_recent_item_get_timestamp (const EggRecentItem *item); + +G_CONST_RETURN gchar *egg_recent_item_peek_uri (const EggRecentItem *item); + + +/* groups */ +G_CONST_RETURN GList * egg_recent_item_get_groups (const EggRecentItem *item); + +gboolean egg_recent_item_in_group (const EggRecentItem *item, + const gchar *group_name); + +void egg_recent_item_add_group (EggRecentItem *item, + const gchar *group_name); + +void egg_recent_item_remove_group (EggRecentItem *item, + const gchar *group_name); + +void egg_recent_item_set_private (EggRecentItem *item, + gboolean priv); + +gboolean egg_recent_item_get_private (const EggRecentItem *item); + + +G_END_DECLS + +#endif /* __EGG_RECENT_ITEM_H__ */ |