![]() |
![]() |
![]() |
GData Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <gdata/gd/gdata-gd-postal-address.h> GDataGDPostalAddress; GDataGDPostalAddressClass; #define GDATA_GD_ADDRESS_USAGE_GENERAL #define GDATA_GD_ADDRESS_USAGE_LOCAL #define GDATA_GD_MAIL_CLASS_BOTH #define GDATA_GD_MAIL_CLASS_LETTERS #define GDATA_GD_MAIL_CLASS_NEITHER #define GDATA_GD_MAIL_CLASS_PARCELS GDataGDPostalAddress * gdata_gd_postal_address_new (const gchar *relation_type
,const gchar *label
,gboolean is_primary
); gint gdata_gd_postal_address_compare (const GDataGDPostalAddress *a
,const GDataGDPostalAddress *b
); const gchar * gdata_gd_postal_address_get_address (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_address (GDataGDPostalAddress *self
,const gchar *address
); const gchar * gdata_gd_postal_address_get_relation_type (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_relation_type (GDataGDPostalAddress *self
,const gchar *relation_type
); const gchar * gdata_gd_postal_address_get_label (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_label (GDataGDPostalAddress *self
,const gchar *label
); gboolean gdata_gd_postal_address_is_primary (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_is_primary (GDataGDPostalAddress *self
,gboolean is_primary
); const gchar * gdata_gd_postal_address_get_mail_class (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_mail_class (GDataGDPostalAddress *self
,const gchar *mail_class
); const gchar * gdata_gd_postal_address_get_usage (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_usage (GDataGDPostalAddress *self
,const gchar *usage
); const gchar * gdata_gd_postal_address_get_agent (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_agent (GDataGDPostalAddress *self
,const gchar *agent
); const gchar * gdata_gd_postal_address_get_house_name (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_house_name (GDataGDPostalAddress *self
,const gchar *house_name
); const gchar * gdata_gd_postal_address_get_street (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_street (GDataGDPostalAddress *self
,const gchar *street
); const gchar * gdata_gd_postal_address_get_po_box (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_po_box (GDataGDPostalAddress *self
,const gchar *po_box
); const gchar * gdata_gd_postal_address_get_neighborhood (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_neighborhood (GDataGDPostalAddress *self
,const gchar *neighborhood
); const gchar * gdata_gd_postal_address_get_city (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_city (GDataGDPostalAddress *self
,const gchar *city
); const gchar * gdata_gd_postal_address_get_subregion (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_subregion (GDataGDPostalAddress *self
,const gchar *subregion
); const gchar * gdata_gd_postal_address_get_region (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_region (GDataGDPostalAddress *self
,const gchar *region
); const gchar * gdata_gd_postal_address_get_postcode (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_postcode (GDataGDPostalAddress *self
,const gchar *postcode
); const gchar * gdata_gd_postal_address_get_country (GDataGDPostalAddress *self
); const gchar * gdata_gd_postal_address_get_country_code (GDataGDPostalAddress *self
); void gdata_gd_postal_address_set_country (GDataGDPostalAddress *self
,const gchar *country
,const gchar *country_code
);
"address" gchar* : Read / Write "agent" gchar* : Read / Write "city" gchar* : Read / Write "country" gchar* : Read "country-code" gchar* : Read "house-name" gchar* : Read / Write "is-primary" gboolean : Read / Write "label" gchar* : Read / Write "mail-class" gchar* : Read / Write "neighborhood" gchar* : Read / Write "po-box" gchar* : Read / Write "postcode" gchar* : Read / Write "region" gchar* : Read / Write "relation-type" gchar* : Read / Write "street" gchar* : Read / Write "subregion" gchar* : Read / Write "usage" gchar* : Read / Write
GDataGDPostalAddress represents a "structuredPostalAddress" element from the GData specification. Note that it does not represent a simple "postalAddress" element, as "structuredPostalAddress" is now used wherever possible in the GData API.
typedef struct _GDataGDPostalAddress GDataGDPostalAddress;
All the fields in the GDataGDPostalAddress structure are private and should never be accessed directly.
Since 0.2.0
typedef struct { } GDataGDPostalAddressClass;
All the fields in the GDataGDPostalAddressClass structure are private and should never be accessed directly.
Since 0.4.0
#define GDATA_GD_ADDRESS_USAGE_GENERAL "http://schemas.google.com/g/2005#general"
The address is for general usage. Value for "usage".
Since 0.5.0
#define GDATA_GD_ADDRESS_USAGE_LOCAL "http://schemas.google.com/g/2005#local"
The address is for local usage. Value for "usage".
Since 0.5.0
#define GDATA_GD_MAIL_CLASS_BOTH "http://schemas.google.com/g/2005#both"
Parcels and letters can be sent to the address. Value for "mail-class".
Since 0.5.0
#define GDATA_GD_MAIL_CLASS_LETTERS "http://schemas.google.com/g/2005#letters"
Only letters can be sent to the address. Value for "mail-class".
Since 0.5.0
#define GDATA_GD_MAIL_CLASS_NEITHER "http://schemas.google.com/g/2005#neither"
Address is purely locational and cannot be used for mail. Value for "mail-class".
Since 0.5.0
#define GDATA_GD_MAIL_CLASS_PARCELS "http://schemas.google.com/g/2005#parcels"
Only parcels can be sent to the address. Value for "mail-class".
Since 0.5.0
GDataGDPostalAddress * gdata_gd_postal_address_new (const gchar *relation_type
,const gchar *label
,gboolean is_primary
);
Creates a new GDataGDPostalAddress. More information is available in the GData specification.
|
the relationship between the address and its owner, or NULL . [allow-none]
|
|
a human-readable label for the address, or NULL . [allow-none]
|
|
TRUE if this phone number is its owner's primary number, FALSE otherwise
|
Returns : |
a new GDataGDPostalAddress, or NULL ; unref with g_object_unref()
|
Since 0.2.0
gint gdata_gd_postal_address_compare (const GDataGDPostalAddress *a
,const GDataGDPostalAddress *b
);
Compares the two postal addresses in a strcmp()
fashion. NULL
values are handled gracefully, with
0
returned if both a
and b
are NULL
, -1
if a
is NULL
and 1
if b
is NULL
.
The comparison of non-NULL
values is done on the basis of the street
, po_box
, city
and postcode
properties of
the GDataGDPostalAddresses.
|
a GDataGDPostalAddress, or NULL
|
|
another GDataGDPostalAddress, or NULL
|
Returns : |
0 if a equals b , -1 or 1 as
appropriate otherwise
|
Since 0.4.0
const gchar * gdata_gd_postal_address_get_address (GDataGDPostalAddress *self
);
Gets the "address" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address itself, or NULL
|
Since 0.4.0
void gdata_gd_postal_address_set_address (GDataGDPostalAddress *self
,const gchar *address
);
Sets the "address" property to address
.
|
a GDataGDPostalAddress |
|
the new postal address, or NULL . [allow-none]
|
Since 0.4.0
const gchar * gdata_gd_postal_address_get_relation_type
(GDataGDPostalAddress *self
);
Gets the "relation-type" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' relation type, or NULL
|
Since 0.4.0
void gdata_gd_postal_address_set_relation_type (GDataGDPostalAddress *self
,const gchar *relation_type
);
Sets the "relation-type" property to relation_type
.
Set relation_type
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new relation type for the postal_address, or NULL . [allow-none]
|
Since 0.4.0
const gchar * gdata_gd_postal_address_get_label (GDataGDPostalAddress *self
);
Gets the "label" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' label, or NULL
|
Since 0.4.0
void gdata_gd_postal_address_set_label (GDataGDPostalAddress *self
,const gchar *label
);
Sets the "label" property to label
.
Set label
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new label for the postal address, or NULL . [allow-none]
|
Since 0.4.0
gboolean gdata_gd_postal_address_is_primary (GDataGDPostalAddress *self
);
Gets the "is-primary" property.
|
a GDataGDPostalAddress |
Returns : |
TRUE if this is the primary postal address, FALSE otherwise
|
Since 0.4.0
void gdata_gd_postal_address_set_is_primary (GDataGDPostalAddress *self
,gboolean is_primary
);
Sets the "is-primary" property to is_primary
.
|
a GDataGDPostalAddress |
|
TRUE if this is the primary postal address, FALSE otherwise
|
Since 0.4.0
const gchar * gdata_gd_postal_address_get_mail_class
(GDataGDPostalAddress *self
);
Gets the "mail-class" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' mail class, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_mail_class (GDataGDPostalAddress *self
,const gchar *mail_class
);
Sets the "mail-class" property to mail_class
.
Set mail_class
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new mail class for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_usage (GDataGDPostalAddress *self
);
Gets the "usage" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' usage, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_usage (GDataGDPostalAddress *self
,const gchar *usage
);
Sets the "usage" property to usage
.
Set usage
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new usage for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_agent (GDataGDPostalAddress *self
);
Gets the "agent" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' agent, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_agent (GDataGDPostalAddress *self
,const gchar *agent
);
Sets the "agent" property to agent
.
Set agent
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new agent for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_house_name
(GDataGDPostalAddress *self
);
Gets the "house-name" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' house name, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_house_name (GDataGDPostalAddress *self
,const gchar *house_name
);
Sets the "house-name" property to house_name
.
Set house_name
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new house name for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_street (GDataGDPostalAddress *self
);
Gets the "street" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' street, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_street (GDataGDPostalAddress *self
,const gchar *street
);
Sets the "street" property to street
.
Set street
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new street for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_po_box (GDataGDPostalAddress *self
);
Gets the "po-box" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' P.O. box, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_po_box (GDataGDPostalAddress *self
,const gchar *po_box
);
Sets the "po-box" property to po_box
.
Set po_box
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new P.O. box for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_neighborhood
(GDataGDPostalAddress *self
);
Gets the "neighborhood" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' neighborhood, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_neighborhood (GDataGDPostalAddress *self
,const gchar *neighborhood
);
Sets the "neighborhood" property to neighborhood
.
Set neighborhood
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new neighborhood for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_city (GDataGDPostalAddress *self
);
Gets the "city" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' city, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_city (GDataGDPostalAddress *self
,const gchar *city
);
Sets the "city" property to city
.
Set city
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new city for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_subregion
(GDataGDPostalAddress *self
);
Gets the "subregion" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' subregion, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_subregion (GDataGDPostalAddress *self
,const gchar *subregion
);
Sets the "subregion" property to subregion
.
Set subregion
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new subregion for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_region (GDataGDPostalAddress *self
);
Gets the "region" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' region, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_region (GDataGDPostalAddress *self
,const gchar *region
);
Sets the "region" property to region
.
Set region
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new region for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_postcode
(GDataGDPostalAddress *self
);
Gets the "postcode" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' postcode, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_postcode (GDataGDPostalAddress *self
,const gchar *postcode
);
Sets the "postcode" property to postcode
.
Set postcode
to NULL
to unset the property in the postal address.
|
a GDataGDPostalAddress |
|
the new postcode for the postal address, or NULL . [allow-none]
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_country (GDataGDPostalAddress *self
);
Gets the "country" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' country, or NULL
|
Since 0.5.0
const gchar * gdata_gd_postal_address_get_country_code
(GDataGDPostalAddress *self
);
Gets the "country-code" property.
|
a GDataGDPostalAddress |
Returns : |
the postal address' ISO 3166-1 alpha-2 country code, or NULL
|
Since 0.5.0
void gdata_gd_postal_address_set_country (GDataGDPostalAddress *self
,const gchar *country
,const gchar *country_code
);
Sets the "country" property to country
, and "country-code" to country_code
.
Set country
or country_code
to NULL
to unset the relevant property in the postal address. If a country_code
is provided, a country
must
also be provided.
|
a GDataGDPostalAddress |
|
the new country for the postal address, or NULL . [allow-none]
|
|
the new country code for the postal address, or NULL . [allow-none]
|
Since 0.5.0
"address"
property "address" gchar* : Read / Write
The postal address itself, formatted and unstructured. It is preferred to use the other, structured properties rather than this one.
For more information, see the GData specification.
Default value: NULL
Since 0.4.0
"agent"
property "agent" gchar* : Read / Write
The agent who actually receives the mail. Used in work addresses. Also for "in care of" or "c/o".
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"city"
property "city" gchar* : Read / Write
Can be city, village, town, borough, etc. This is the postal town and not necessarily the place of residence or place of business.
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"country"
property "country" gchar* : Read
The name of the country. Since this is paired with "country-code", they must both be set with
gdata_gd_postal_address_set_country()
.
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"country-code"
property "country-code" gchar* : Read
The ISO 3166-1 alpha-2 country code for the country in "country". Since this is paired with
"country", they must both be set with gdata_gd_postal_address_set_country()
.
For more information, see the GData specification or ISO 3166-1 alpha-2.
Default value: NULL
Since 0.5.0
"house-name"
property "house-name" gchar* : Read / Write
Used in places where houses or buildings have names (and not necessarily numbers).
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"is-primary"
property "is-primary" gboolean : Read / Write
Indicates which postal address out of a group is primary.
For more information, see the GData specification.
Default value: FALSE
Since 0.4.0
"label"
property "label" gchar* : Read / Write
A simple string value used to name this postal address. It allows UIs to display a label such as "Work", "Personal", "Preferred", etc.
For more information, see the GData specification.
Default value: NULL
Since 0.4.0
"mail-class"
property "mail-class" gchar* : Read / Write
Classes of mail accepted at this address.
For more information, see the GData specification.
Default value: "http://schemas.google.com/g/2005#both"
Since 0.5.0
"neighborhood"
property "neighborhood" gchar* : Read / Write
This is used to disambiguate a street address when a city contains more than one street with the same name, or to specify a small place whose mail is routed through a larger postal town. In China it could be a county or a minor city.
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"po-box"
property "po-box" gchar* : Read / Write
Covers actual P.O. boxes, drawers, locked bags, etc. This is usually but not always mutually exclusive with "street".
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"postcode"
property "postcode" gchar* : Read / Write
Postal code. Usually country-wide, but sometimes specific to the city (e.g. "2" in "Dublin 2, Ireland" addresses).
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"region"
property "region" gchar* : Read / Write
A state, province, county (in Ireland), Land (in Germany), departement (in France), etc.
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"relation-type"
property "relation-type" gchar* : Read / Write
A programmatic value that identifies the type of postal address.
For more information, see the GData specification.
Default value: NULL
Since 0.4.0
"street"
property "street" gchar* : Read / Write
Can be street, avenue, road, etc. This element also includes the house number and room/apartment/flat/floor number.
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"subregion"
property "subregion" gchar* : Read / Write
Handles administrative districts such as U.S. or U.K. counties that are not used for mail addressing purposes. Subregion is not intended for delivery addresses.
For more information, see the GData specification.
Default value: NULL
Since 0.5.0
"usage"
property "usage" gchar* : Read / Write
The context in which this addess can be used.
For more information, see the GData specification.
Default value: "http://schemas.google.com/g/2005#general"
Since 0.5.0