add removeAllAttendees for pav

This commit is contained in:
shaver%mozilla.org 2004-12-14 00:44:21 +00:00
parent 03e9917344
commit 28c8b5d84d
3 changed files with 25 additions and 0 deletions

View File

@ -168,6 +168,7 @@ interface calIItemBase : nsISupports
calIAttendee getAttendeeById(in AUTF8String id);
void removeAttendee(in calIAttendee attendee);
void addAttendee(in calIAttendee attendee);
void removeAllAttendees();
};
//

View File

@ -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;

View File

@ -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;