remove old readme
[atutor.git] / jscripts / opensocial / name.js
1 /*
2  * Licensed under the Apache License, Version 2.0 (the "License");
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  *     http://www.apache.org/licenses/LICENSE-2.0
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  * See the License for the specific language governing permissions and
12  * limitations under the License.
13  */
14
15 /**
16  * @fileoverview Representation of an name.
17  */
18
19
20 /**
21  * @class
22  * Base interface for all name objects.
23  *
24  * @name opensocial.Name
25  */
26
27
28 /**
29  * Base interface for all name objects.
30  *
31  * @private
32  * @constructor
33  */
34 opensocial.Name = function() {};
35
36
37 /**
38  * @static
39  * @class
40  * All of the fields that a name has. These are the supported keys for the
41  * <a href="opensocial.Name.html#getField">Name.getField()</a> method.
42  *
43  * @name opensocial.Name.Field
44  */
45 opensocial.Name.Field = {
46   /**
47    * The family name, specified as a string.
48    * This field may be used interchangeably with the string 'familyName'.
49    * @member opensocial.Name.Field
50    */
51   FAMILY_NAME : 'familyName',
52
53   /**
54    * The given name, specified as a string.
55    * This field may be used interchangeably with the string 'givenName'.
56    * @member opensocial.Name.Field
57    */
58   GIVEN_NAME : 'givenName',
59
60   /**
61    * The additional name, specified as a string.
62    * This field may be used interchangeably with the string 'additionalName'.
63    * @member opensocial.Name.Field
64    */
65   ADDITIONAL_NAME : 'additionalName',
66
67   /**
68    * The honorific prefix, specified as a string.
69    * This field may be used interchangeably with the string 'honorificPrefix'.
70    * @member opensocial.Name.Field
71    */
72   HONORIFIC_PREFIX : 'honorificPrefix',
73
74   /**
75    * The honorific suffix, specified as a string.
76    * This field may be used interchangeably with the string 'honorificSuffix'.
77    * @member opensocial.Name.Field
78    */
79   HONORIFIC_SUFFIX : 'honorificSuffix',
80
81   /**
82    * The unstructured name, specified as a string.
83    * This field may be used interchangeably with the string 'unstructured'.
84    * @member opensocial.Name.Field
85    */
86   UNSTRUCTURED : 'unstructured'
87 };
88
89
90 /**
91  * Gets data for this name that is associated with the specified key.
92  *
93  * @param {String} key The key to get data for;
94  *    keys are defined in <a href="opensocial.Name.Field.html"><code>
95  *    Name.Field</code></a>
96  * @param {Map.&lt;opensocial.DataRequest.DataRequestFields, Object&gt;}
97  *  opt_params Additional
98  *    <a href="opensocial.DataRequest.DataRequestFields.html">params</a>
99  *    to pass to the request.
100  * @return {String} The data
101  */
102 opensocial.Name.prototype.getField = function(key, opt_params) {};