mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
add removeAllAttendees for pav
This commit is contained in:
parent
03e9917344
commit
28c8b5d84d
@ -168,6 +168,7 @@ interface calIItemBase : nsISupports
|
||||
calIAttendee getAttendeeById(in AUTF8String id);
|
||||
void removeAttendee(in calIAttendee attendee);
|
||||
void addAttendee(in calIAttendee attendee);
|
||||
void removeAllAttendees();
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -107,6 +107,7 @@ calItemBase.prototype = {
|
||||
|
||||
|
||||
get propertyEnumerator() { return this.mProperties.enumerator; },
|
||||
|
||||
getProperty: function (aName) {
|
||||
try {
|
||||
return this.mProperties.getProperty(aName);
|
||||
@ -114,11 +115,13 @@ calItemBase.prototype = {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
setProperty: function (aName, aValue) {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
this.mProperties.setProperty(aName, aValue);
|
||||
},
|
||||
|
||||
deleteProperty: function (aName) {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
@ -132,12 +135,14 @@ calItemBase.prototype = {
|
||||
countObj.value = this.mAttendees.length;
|
||||
return this.mAttendees.concat([]);
|
||||
},
|
||||
|
||||
getAttendeeById: function (id) {
|
||||
for (var i = 0; i < this.mAttendees.length; i++)
|
||||
if (this.mAttendees[i].id == id)
|
||||
return this.mAttendees[i];
|
||||
return null;
|
||||
},
|
||||
|
||||
removeAttendee: function (attendee) {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
@ -153,6 +158,13 @@ calItemBase.prototype = {
|
||||
else
|
||||
throw Component.results.NS_ERROR_INVALID_ARG;
|
||||
},
|
||||
|
||||
removeAllAttendees: function() {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
this.mAttendees = [];
|
||||
},
|
||||
|
||||
addAttendee: function (attendee) {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
|
@ -149,6 +149,7 @@ calItemBase.prototype = {
|
||||
#undef MEMBER_ATTR
|
||||
|
||||
get propertyEnumerator() { return this.mProperties.enumerator; },
|
||||
|
||||
getProperty: function (aName) {
|
||||
try {
|
||||
return this.mProperties.getProperty(aName);
|
||||
@ -156,11 +157,13 @@ calItemBase.prototype = {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
setProperty: function (aName, aValue) {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
this.mProperties.setProperty(aName, aValue);
|
||||
},
|
||||
|
||||
deleteProperty: function (aName) {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
@ -174,12 +177,14 @@ calItemBase.prototype = {
|
||||
countObj.value = this.mAttendees.length;
|
||||
return this.mAttendees.concat([]); // clone
|
||||
},
|
||||
|
||||
getAttendeeById: function (id) {
|
||||
for (var i = 0; i < this.mAttendees.length; i++)
|
||||
if (this.mAttendees[i].id == id)
|
||||
return this.mAttendees[i];
|
||||
return null;
|
||||
},
|
||||
|
||||
removeAttendee: function (attendee) {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
@ -195,6 +200,13 @@ calItemBase.prototype = {
|
||||
else
|
||||
throw Component.results.NS_ERROR_INVALID_ARG;
|
||||
},
|
||||
|
||||
removeAllAttendees: function() {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
this.mAttendees = [];
|
||||
},
|
||||
|
||||
addAttendee: function (attendee) {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user