/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview Representation of navigation parameters for RequestShareApp. */ /** * @class * Parameters used by RequestShareApp to instruct the container on where to go * after the request is made. * * It could be used, for example, to specify where viewers get routed * in one of two cases: * 1) After a user gets a shareApp invitation or receives a message a gadget * developer should be able to send that user to a context sensitive place. * 2) After a viewer actually shares an app with someone else the gadget * developer should be able to redirect the viewer to a context sensitive * place. * * * @name opensocial.NavigationParameters */ /** * Use this class to hold navigation parameters for RequestShareApp. * * For example, opensocial.newNavigationParameters({view : 'preview', * owner: 'xx', * parameters: {}). * * Private, see * opensocial.newNavigationParameters() for usage. * * @private * @constructor */ opensocial.NavigationParameters = function() {}; /** * @static * @class * All of the fields that NavigationParameters can have. * *

* See also: * * opensocial.NavigationParameters.getField() *

* * @name opensocial.NavigationParameters.Field */ opensocial.NavigationParameters.Field = { /** * The View to navigate to. * This field may be used interchangeably with the string 'view'. * @member opensocial.NavigationParameters.Field */ VIEW : 'view', /** * A string representing the owner id. * This field may be used interchangeably with the string 'owner'. * @member opensocial.NavigationParameters.Field */ OWNER : 'owner', /** * An optional list of parameters passed to the gadget once the new view, * with the new owner, has been loaded. * This field may be used interchangeably with the string 'parameters'. * @member opensocial.NavigationParameters.Field */ PARAMETERS : 'parameters' }; /** * Gets the NavigationParameters' data that's associated with the specified key. * * @param {String} key The key to get data for; * see the Field class * for possible values * @param {Map.<opensocial.DataRequest.DataRequestFields, Object>} * opt_params Additional * params * to pass to the request. * @return {String} The data * @member opensocial.NavigationParameters */ opensocial.NavigationParameters.prototype.getField = function(key, opt_params) {}; /** * Sets data for this NavigationParameters associated with the given key. * * @param {String} key The key to set data for * @param {Object} data The data to set */ opensocial.NavigationParameters.prototype.setField = function(key, data) {}; /** * @static * @class * * The destinations available for navigation in * requestShareApp * and requestSendMessage. * * @name opensocial.NavigationParameters.DestinationType */ opensocial.NavigationParameters.DestinationType = { /** * This field may be used interchangeably with the string 'viewerDestination'. * @member opensocial.NavigationParameters.DestinationType */ VIEWER_DESTINATION : "viewerDestination", /** * This field may be used interchangeably with the string * 'recipientDestination'. * @member opensocial.NavigationParameters.DestinationType */ RECIPIENT_DESTINATION : "recipientDestination" };