remove old readme
[atutor.git] / docs / jscripts / opensocial / address.js
1 /*
2  * Copyright 2007 Google Inc.
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 /**
18  * @fileoverview Representation of an address.
19  */
20
21
22 /**
23  * @class
24  * Base interface for all address objects.
25  *
26  * @name opensocial.Address
27  */
28
29
30 /**
31  * Base interface for all address objects.
32  *
33  * @private
34  * @constructor
35  */
36 opensocial.Address = function() {};
37
38
39 /**
40  * @static
41  * @class
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.
44  *
45  * @name opensocial.Address.Field
46  */
47 opensocial.Address.Field = {
48   /**
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
53    */
54   TYPE : 'type',
55
56   /**
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
61    * supported.
62    * This field may be used interchangeably with the string 
63    * 'unstructuredAddress'.
64    * @member opensocial.Address.Field
65    */
66   UNSTRUCTURED_ADDRESS : 'unstructuredAddress',
67
68   /**
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
72    */
73   PO_BOX : 'poBox',
74
75   /**
76    * The street address, specified as a string.
77    * This field may be used interchangeably with the string 'streetAddress'.
78    * @member opensocial.Address.Field
79    */
80   STREET_ADDRESS : 'streetAddress',
81
82   /**
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
86    */
87   EXTENDED_ADDRESS : 'extendedAddress',
88
89   /**
90    * The region, specified as a string.
91    * This field may be used interchangeably with the string 'region'.
92    * @member opensocial.Address.Field
93    */
94   REGION : 'region',
95
96   /**
97    * The locality, specified as a string.
98    * This field may be used interchangeably with the string 'locality'.
99    * @member opensocial.Address.Field
100    */
101   LOCALITY : 'locality',
102
103   /**
104    * The postal code, specified as a string.
105    * This field may be used interchangeably with the string 'postalCode'.
106    * @member opensocial.Address.Field
107    */
108   POSTAL_CODE : 'postalCode',
109
110   /**
111    * The country, specified as a string.
112    * This field may be used interchangeably with the string 'country'.
113    * @member opensocial.Address.Field
114    */
115   COUNTRY : 'country',
116
117   /**
118    * The latitude, specified as a number.
119    * This field may be used interchangeably with the string 'latitude'.
120    * @member opensocial.Address.Field
121    */
122   LATITUDE : 'latitude',
123
124   /**
125    * The longitude, specified as a number.
126    * This field may be used interchangeably with the string 'longitude'.
127    * @member opensocial.Address.Field
128    */
129   LONGITUDE : 'longitude'
130 };
131
132
133 /**
134  * Gets data for this body type that is associated with the specified key.
135  *
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.&lt;opensocial.DataRequest.DataRequestFields, Object&gt;}
140  *  opt_params Additional
141  *    <a href="opensocial.DataRequest.DataRequestFields.html">params</a>
142  *    to pass to the request
143  * @return {String} The data
144  */
145 opensocial.Address.prototype.getField = function(key, opt_params) {};