goog.provide('goog.plus.Stream');
goog.require('facebook.Stream');
/**
* A stream of google+.
*@
param{string} content The content
*@
param{google.plus.User} user A user of google+
*@
param{array<google.plus.Circle>} circles List of circle
*@
constructor
*@
extends facebook.Stream
*/
goog.plus.Stream = function(content, user, circles) {
facebook.Stream.call(this, content, user);
goog.plus.Stream.superClass_.clearGames();
this.circles_ = circles;
};
goog.inherits(goog.plus.Stream, facebook.Stream);
/**
* Circles of Stream
*@
type{Array<goog.plus.Circle>}
*@
private
*/
goog.plus.Stream.prototype.circles_ = [];
/**
* Returns list of circles.
*@
return{Array<goog.plus.Circle>}
*/
goog.plus.Stream.prototype.getCircles = function() {
return this.circles_;
};
/**
* Set circles
*@
param{Array<goog.plus.Circle>} circles
*/
goog.plus.Stream.prototype.SetCircles = function(circles) {
this.circles_ = circles;
};
/**
* Add a circle
*@
param{goog.plus.Circle} circle
*/
goog.plus.Stream.prototype.addCircle = function(circle) {
this.circles_.push(circle);
};
/**
* Remove a circle
*@
param{goog.plus.Circle} circle
*@
return{goog.plus.Circle|null} circle removed
*/
goog.plus.Stream.prototype.removeCircle = function(circle) {
var index = this.circles_.indexOf(circle);
return index > -1 ? this.circles_.splice(index,1)[0] : null;
};
/**
*@
override
*/
goog.plus.Stream.prototype.post = function() {
if (this.circles_.length <= 0) {
throw 'a circle needed!';
}
goog.plus.Stream.superClass_.post();
};