New RSSyl replacing old one.
[claws.git] / src / plugins / rssyl / libfeed / feeditem.h
1 /*
2  * Copyright (C) 2006 Andrej Kacian <andrej@kacian.sk>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __FEEDITEM_H
21 #define __FEEDITEM_H
22
23 #include "feed.h"
24 #include "feeditemenclosure.h"
25
26 struct _FeedItem {
27         gchar *url;
28         gchar *title;
29         gint title_format;
30         gchar *summary;
31         gchar *text;
32         gchar *author;
33         gchar *id;
34         gchar *comments_url;
35         gchar *parent_id;
36
37         gchar *sourceid;
38         gchar *sourcetitle;
39         time_t sourcedate;
40
41         gboolean id_is_permalink;
42         gboolean xhtml_content;
43
44         FeedItemEnclosure *enclosure;
45
46         time_t date_published;
47         time_t date_modified;
48
49         Feed *feed;             /* feed we belong to */
50
51         gpointer data;          /* application-specific data */
52 };
53
54 #define FEED_ITEM_TITLE_TEXT 0
55 #define FEED_ITEM_TITLE_HTML 1
56 #define FEED_ITEM_TITLE_XHTML 2
57 #define FEED_ITEM_TITLE_UNKNOWN 3
58
59 FeedItem *feed_item_new(Feed *feed);
60 void feed_item_free(FeedItem *item);
61
62 Feed *feed_item_get_feed(FeedItem *item);
63
64 gchar *feed_item_get_url(FeedItem *item);
65 void feed_item_set_url(FeedItem *item, const gchar *url);
66
67 gchar *feed_item_get_title(FeedItem *item);
68 void feed_item_set_title(FeedItem *item, const gchar *title);
69
70 gint feed_item_get_title_format(FeedItem *item);
71 void feed_item_set_title_format(FeedItem *item, gint format);
72
73 gchar *feed_item_get_summary(FeedItem *item);
74 void feed_item_set_summary(FeedItem *item, const gchar *summary);
75
76 gchar *feed_item_get_text(FeedItem *item);
77 void feed_item_set_text(FeedItem *item, const gchar *text);
78
79 gchar *feed_item_get_author(FeedItem *item);
80 void feed_item_set_author(FeedItem *item, const gchar *author);
81
82 gchar *feed_item_get_id(FeedItem *item);
83 void feed_item_set_id(FeedItem *item, const gchar *id);
84
85 gchar *feed_item_get_comments_url(FeedItem *item);
86 void feed_item_set_comments_url(FeedItem *item, const gchar *url);
87
88 gchar *feed_item_get_parent_id(FeedItem *item);
89 void feed_item_set_parent_id(FeedItem *item, const gchar *id);
90
91 FeedItemEnclosure *feed_item_get_enclosure(FeedItem *item);
92 void feed_item_set_enclosure(FeedItem *item, FeedItemEnclosure *enclosure);
93
94 gchar *feed_item_get_sourcetitle(FeedItem *item);
95 void feed_item_set_sourcetitle(FeedItem *item, const gchar *sourcetitle);
96
97 gchar *feed_item_get_sourceid(FeedItem *item);
98 void feed_item_set_sourceid(FeedItem *item, const gchar *sourceid);
99
100 time_t feed_item_get_sourcedate(FeedItem *item);
101 void feed_item_set_sourcedate(FeedItem *item, time_t date);
102
103 time_t feed_item_get_date_published(FeedItem *item);
104 void feed_item_set_date_published(FeedItem *item, time_t date);
105
106 time_t feed_item_get_date_modified(FeedItem *item);
107 void feed_item_set_date_modified(FeedItem *item, time_t date);
108
109 FeedItem *feed_item_copy(FeedItem *item);
110
111 gboolean feed_item_id_is_permalink(FeedItem *item);
112 void feed_item_set_id_permalink(FeedItem *item, gboolean permalink);
113
114 #endif /* __FEEDITEM_H */