1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ 2 /* 3 * GData Client 4 * Copyright (C) Philip Withnall 2009 <philip@tecnocode.co.uk> 5 * 6 * GData Client is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * GData Client is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef GDATA_LINK_H 21 #define GDATA_LINK_H 22 23 #include <glib.h> 24 #include <glib-object.h> 25 26 #include <gdata/gdata-parsable.h> 27 28 G_BEGIN_DECLS 29 30 /** 31 * GDATA_LINK_ALTERNATE: 32 * 33 * The relation type URI for alternate resources to the current one. 34 * 35 * For more information, see the <ulink type="http" url="http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rel_attribute"> 36 * Atom specification</ulink>. 37 * 38 * Since: 0.4.0 39 */ 40 #define GDATA_LINK_ALTERNATE "http://www.iana.org/assignments/relation/alternate" 41 42 /** 43 * GDATA_LINK_RELATED: 44 * 45 * The relation type URI for resources related to the current one. 46 * 47 * For more information, see the <ulink type="http" url="http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rel_attribute"> 48 * Atom specification</ulink>. 49 * 50 * Since: 0.4.0 51 */ 52 #define GDATA_LINK_RELATED "http://www.iana.org/assignments/relation/related" 53 54 /** 55 * GDATA_LINK_SELF: 56 * 57 * The relation type URI for the current resource. 58 * 59 * For more information, see the <ulink type="http" url="http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rel_attribute"> 60 * Atom specification</ulink>. 61 * 62 * Since: 0.4.0 63 */ 64 #define GDATA_LINK_SELF "http://www.iana.org/assignments/relation/self" 65 66 /** 67 * GDATA_LINK_ENCLOSURE: 68 * 69 * The relation type URI for attached objects which may be large in size. 70 * 71 * For more information, see the <ulink type="http" url="http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rel_attribute"> 72 * Atom specification</ulink>. 73 * 74 * Since: 0.4.0 75 */ 76 #define GDATA_LINK_ENCLOSURE "http://www.iana.org/assignments/relation/enclosure" 77 78 /** 79 * GDATA_LINK_VIA: 80 * 81 * The relation type URI for the source document of the current resource. 82 * 83 * For more information, see the <ulink type="http" url="http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rel_attribute"> 84 * Atom specification</ulink>. 85 * 86 * Since: 0.4.0 87 */ 88 #define GDATA_LINK_VIA "http://www.iana.org/assignments/relation/via" 89 90 /** 91 * GDATA_LINK_EDIT: 92 * 93 * The relation type URI of the edit location for this resource. 94 * 95 * For more information, see the <ulink type="http" url="http://www.atomenabled.org/developers/protocol/atom-protocol-spec.php#new-link-relation"> 96 * Atom Publishing Protocol specification</ulink>. 97 * 98 * Since: 0.4.0 99 */ 100 #define GDATA_LINK_EDIT "http://www.iana.org/assignments/relation/edit" 101 102 /** 103 * GDATA_LINK_EDIT_MEDIA: 104 * 105 * The relation type URI of the edit location for media resources attached to this resource. 106 * 107 * For more information, see the 108 * <ulink type="http" url="http://www.atomenabled.org/developers/protocol/atom-protocol-spec.php#new-media-link-relation"> 109 * Atom Publishing Protocol specification</ulink>. 110 * 111 * Since: 0.4.0 112 */ 113 #define GDATA_LINK_EDIT_MEDIA "http://www.iana.org/assignments/relation/edit-media" 114 115 /** 116 * GDATA_LINK_PARENT: 117 * 118 * The relation type URI of the of the location of the parent resource in a 119 * hierarchy of entries. 120 * 121 * This is an undocumented GData-specific addition to the Atom specification, 122 * and is not included in the GData documentation except in examples and in the 123 * <ulink type="http" url="https://developers.google.com/google-apps/documents-list/v2/schema/document_list_atom.rnc"> 124 * RelaxNG schema</ulink>. 125 * 126 * Since: 0.15.1 127 */ 128 #define GDATA_LINK_PARENT "http://schemas.google.com/docs/2007#parent" 129 130 #define GDATA_TYPE_LINK (gdata_link_get_type ()) 131 #define GDATA_LINK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_LINK, GDataLink)) 132 #define GDATA_LINK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_LINK, GDataLinkClass)) 133 #define GDATA_IS_LINK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_LINK)) 134 #define GDATA_IS_LINK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_LINK)) 135 #define GDATA_LINK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_LINK, GDataLinkClass)) 136 137 typedef struct _GDataLinkPrivate GDataLinkPrivate; 138 139 /** 140 * GDataLink: 141 * 142 * All the fields in the #GDataLink structure are private and should never be accessed directly. 143 */ 144 typedef struct { 145 GDataParsable parent; 146 GDataLinkPrivate *priv; 147 } GDataLink; 148 149 /** 150 * GDataLinkClass: 151 * 152 * All the fields in the #GDataLinkClass structure are private and should never be accessed directly. 153 * 154 * Since: 0.4.0 155 */ 156 typedef struct { 157 /*< private >*/ 158 GDataParsableClass parent; 159 160 /*< private >*/ 161 /* Padding for future expansion */ 162 void (*_g_reserved0) (void); 163 void (*_g_reserved1) (void); 164 } GDataLinkClass; 165 166 GType gdata_link_get_type (void) G_GNUC_CONST; 167 168 GDataLink *gdata_link_new (const gchar *uri, const gchar *relation_type) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; 169 170 const gchar *gdata_link_get_uri (GDataLink *self) G_GNUC_PURE; 171 void gdata_link_set_uri (GDataLink *self, const gchar *uri); 172 173 const gchar *gdata_link_get_relation_type (GDataLink *self) G_GNUC_PURE; 174 void gdata_link_set_relation_type (GDataLink *self, const gchar *relation_type); 175 176 const gchar *gdata_link_get_content_type (GDataLink *self) G_GNUC_PURE; 177 void gdata_link_set_content_type (GDataLink *self, const gchar *content_type); 178 179 const gchar *gdata_link_get_language (GDataLink *self) G_GNUC_PURE; 180 void gdata_link_set_language (GDataLink *self, const gchar *language); 181 182 const gchar *gdata_link_get_title (GDataLink *self) G_GNUC_PURE; 183 void gdata_link_set_title (GDataLink *self, const gchar *title); 184 185 gint gdata_link_get_length (GDataLink *self) G_GNUC_PURE; 186 void gdata_link_set_length (GDataLink *self, gint length); 187 188 G_END_DECLS 189 190 #endif /* !GDATA_LINK_H */ 191