2 * Copyright 2007 Google Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @fileoverview Representation of an address.
24 * Base interface for all address objects.
26 * @name opensocial.Address
31 * Base interface for all address objects.
36 opensocial.Address = function() {};
42 * All of the fields that an address has. These are the supported keys for the
43 * <a href="opensocial.Address.html#getField">Address.getField()</a> method.
45 * @name opensocial.Address.Field
47 opensocial.Address.Field = {
49 * The address type or label, specified as a string.
50 * Examples: work, my favorite store, my house, etc.
51 * This field may be used interchangeably with the string 'type'.
52 * @member opensocial.Address.Field
57 * If the container does not have structured addresses in its data store,
58 * this field contains the unstructured address that the user entered,
59 * specified as a string. Use
60 * opensocial.getEnvironment().supportsField to see which fields are
62 * This field may be used interchangeably with the string
63 * 'unstructuredAddress'.
64 * @member opensocial.Address.Field
66 UNSTRUCTURED_ADDRESS : 'unstructuredAddress',
69 * The P.O. box of the address, if there is one; specified as a string.
70 * This field may be used interchangeably with the string 'poBox'.
71 * @member opensocial.Address.Field
76 * The street address, specified as a string.
77 * This field may be used interchangeably with the string 'streetAddress'.
78 * @member opensocial.Address.Field
80 STREET_ADDRESS : 'streetAddress',
83 * The extended street address, specified as a string.
84 * This field may be used interchangeably with the string 'extendedAddress'.
85 * @member opensocial.Address.Field
87 EXTENDED_ADDRESS : 'extendedAddress',
90 * The region, specified as a string.
91 * This field may be used interchangeably with the string 'region'.
92 * @member opensocial.Address.Field
97 * The locality, specified as a string.
98 * This field may be used interchangeably with the string 'locality'.
99 * @member opensocial.Address.Field
101 LOCALITY : 'locality',
104 * The postal code, specified as a string.
105 * This field may be used interchangeably with the string 'postalCode'.
106 * @member opensocial.Address.Field
108 POSTAL_CODE : 'postalCode',
111 * The country, specified as a string.
112 * This field may be used interchangeably with the string 'country'.
113 * @member opensocial.Address.Field
118 * The latitude, specified as a number.
119 * This field may be used interchangeably with the string 'latitude'.
120 * @member opensocial.Address.Field
122 LATITUDE : 'latitude',
125 * The longitude, specified as a number.
126 * This field may be used interchangeably with the string 'longitude'.
127 * @member opensocial.Address.Field
129 LONGITUDE : 'longitude'
134 * Gets data for this body type that is associated with the specified key.
136 * @param {String} key The key to get data for;
137 * keys are defined in <a href="opensocial.Address.Field.html"><code>
138 * Address.Field</code></a>
139 * @param {Map.<opensocial.DataRequest.DataRequestFields, Object>}
140 * opt_params Additional
141 * <a href="opensocial.DataRequest.DataRequestFields.html">params</a>
142 * to pass to the request
143 * @return {String} The data
145 opensocial.Address.prototype.getField = function(key, opt_params) {};