move code up one directory
[atutor.git] / jscripts / opensocial / url.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 a URL.
17  */
18
19
20 /**
21  * @class
22  * Base interface for all URL objects.
23  *
24  * @name opensocial.Url
25  */
26
27
28 /**
29  * Base interface for all URL objects.
30  *
31  * @private
32  * @constructor
33  */
34 opensocial.Url = function() {};
35
36
37 /**
38  * @static
39  * @class
40  * All of the fields that a URL has. These are the supported keys for the
41  * <a href="opensocial.Url.html#getField">Url.getField()</a> method.
42  *
43  * @name opensocial.Url.Field
44  */
45 opensocial.Url.Field = {
46   /**
47    * The URL number type or label, specified as a string.
48    * Examples: work, blog feed, website, etc.
49    * This field may be used interchangeably with the string 'type'.
50    * @member opensocial.Url.Field
51    */
52   TYPE : 'type',
53
54   /**
55    * The text of the link, specified as a string.
56    * This field may be used interchangeably with the string 'linkText'.
57    * @member opensocial.Url.Field
58    */
59   LINK_TEXT : 'linkText',
60
61   /**
62    * The address the URL points to, specified as a string.
63    * This field may be used interchangeably with the string 'address'.
64    * @member opensocial.Url.Field
65    */
66   ADDRESS : 'address'
67 };
68
69
70 /**
71  * Gets data for this URL that is associated with the specified key.
72  *
73  * @param {String} key The key to get data for;
74  *    keys are defined in <a href="opensocial.Url.Field.html"><code>
75  *    Url.Field</code></a>
76  * @param {Map.&lt;opensocial.DataRequest.DataRequestFields, Object&gt;}
77  *  opt_params Additional
78  *    <a href="opensocial.DataRequest.DataRequestFields.html">params</a>
79  *    to pass to the request.
80  * @return {String} The data
81  */
82 opensocial.Url.prototype.getField = function(key, opt_params) {};