mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Calendar build fixes, and checked in post-processed js things
This commit is contained in:
parent
5c28486a71
commit
53752ec121
@ -45,6 +45,6 @@ include $(DEPTH)/config/autoconf.mk
|
||||
MODULE = calbase
|
||||
MODULE_NAME = calBaseModule
|
||||
|
||||
SUBDIRS = public src build
|
||||
DIRS = public src build
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
@ -3,7 +3,7 @@ function calEvent() {
|
||||
}
|
||||
|
||||
calEvent.prototype = {
|
||||
__proto__: (new calItemBase),
|
||||
__proto__: (new calItemBase()),
|
||||
|
||||
QueryInterface: function (aIID) {
|
||||
if (!aIID.equals(Components.interfaces.nsISupports) &&
|
||||
@ -16,33 +16,14 @@ calEvent.prototype = {
|
||||
return this;
|
||||
},
|
||||
|
||||
clone: function () {
|
||||
var m = new calEvent();
|
||||
this.cloneItemBaseInto(m);
|
||||
m.mStartDate = this.mStartDate.clone();
|
||||
m.mEndDate = this.mEndDate.clone();
|
||||
m.mStampDate = this.mStampDate.clone();
|
||||
|
||||
|
||||
|
||||
|
||||
mStartDate: null, get startDate() { return this.mStartDate; },
|
||||
mEndDate: null, get endDate() { return this.mEndDate; },
|
||||
mStampDate: null, get stampDate() { return this.mStampDate; }
|
||||
|
||||
|
||||
};
|
||||
|
||||
function calMutableEvent() {
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
|
||||
calMutableEvent.prototype = {
|
||||
__proto__: (new calMutableItemBase),
|
||||
|
||||
QueryInterface: function (aIID) {
|
||||
if (!aIID.equals(Components.interfaces.nsISupports) &&
|
||||
!aIID.equals(Components.interfaces.calIMutableItemBase) &&
|
||||
!aIID.equals(Components.interfaces.calIMutableEvent))
|
||||
{
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
return this;
|
||||
return m;
|
||||
},
|
||||
|
||||
|
||||
@ -50,9 +31,9 @@ calMutableEvent.prototype = {
|
||||
|
||||
|
||||
|
||||
mStartDate: null, get startDate() { return this.mStartDate; }, set startDate(v) { this.mStartDate = v; },
|
||||
mEndDate: null, get endDate() { return this.mEndDate; }, set endDate(v) { this.mEndDate = v; },
|
||||
mStampDate: null, get stampDate() { return this.mStampDate; }, set stampDate(v) { this.mStampDate = v; }
|
||||
mStartDate: null, get startDate() { return this.mStartDate; }, set startDate(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mStartDate = v; },
|
||||
mEndDate: null, get endDate() { return this.mEndDate; }, set endDate(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mEndDate = v; },
|
||||
mStampDate: null, get stampDate() { return this.mStampDate; }, set stampDate(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mStampDate = v; }
|
||||
|
||||
|
||||
};
|
||||
|
@ -48,7 +48,7 @@ function calEvent() {
|
||||
}
|
||||
|
||||
calEvent.prototype = {
|
||||
__proto__: (new calItemBase),
|
||||
__proto__: (new calItemBase()),
|
||||
|
||||
QueryInterface: function (aIID) {
|
||||
if (!aIID.equals(Components.interfaces.nsISupports) &&
|
||||
@ -73,7 +73,7 @@ calEvent.prototype = {
|
||||
|
||||
#define MEMBER_ATTR(varname, initvalue, attrname) \
|
||||
varname: initvalue, \
|
||||
get attrname() { return this.varname; } \
|
||||
get attrname() { return this.varname; }, \
|
||||
set attrname(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.varname = v; }
|
||||
|
||||
MEMBER_ATTR(mStartDate, null, startDate),
|
||||
@ -82,33 +82,3 @@ calEvent.prototype = {
|
||||
|
||||
#undef MEMBER_ATTR
|
||||
};
|
||||
|
||||
function calMutableEvent() {
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
|
||||
calMutableEvent.prototype = {
|
||||
__proto__: (new calMutableItemBase),
|
||||
|
||||
QueryInterface: function (aIID) {
|
||||
if (!aIID.equals(Components.interfaces.nsISupports) &&
|
||||
!aIID.equals(Components.interfaces.calIMutableItemBase) &&
|
||||
!aIID.equals(Components.interfaces.calIMutableEvent))
|
||||
{
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
#define MEMBER_ATTR(varname, initvalue, attrname) \
|
||||
varname: initvalue, \
|
||||
get attrname() { return this.varname; }, \
|
||||
set attrname(v) { this.varname = v; }
|
||||
|
||||
MEMBER_ATTR(mStartDate, null, startDate),
|
||||
MEMBER_ATTR(mEndDate, null, endDate),
|
||||
MEMBER_ATTR(mStampDate, null, stampDate)
|
||||
|
||||
#undef MEMBER_ATTR
|
||||
};
|
||||
|
@ -11,10 +11,25 @@ calItemBase.prototype = {
|
||||
return this;
|
||||
},
|
||||
|
||||
getMutable: function () {
|
||||
var m = new calMutableItemBase();
|
||||
mImmutable: false,
|
||||
get isMutable() { return this. mImmutable; },
|
||||
makeImmutable: function() {
|
||||
if (this.mImmutable)
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
|
||||
|
||||
this.mCreationDate.makeImmutable();
|
||||
this.mRecurrenceInfo.makeImmutable();
|
||||
this.mAlarmTime.makeImmutable();
|
||||
|
||||
this.mImmutable = true;
|
||||
},
|
||||
|
||||
|
||||
|
||||
cloneItemBaseInto: function (m) {
|
||||
m.mImmutable = false;
|
||||
m.mGeneration = this.mGeneration;
|
||||
m.mCreationDate = this.mCreationDate.getMutable();
|
||||
m.mLastModifiedTime = this.mLastModifiedTime;
|
||||
m.mParent = this.mParent;
|
||||
m.mId = this.mId;
|
||||
@ -24,8 +39,10 @@ calItemBase.prototype = {
|
||||
m.mMethod = this.mMethod;
|
||||
m.mStatus = this.mStatus;
|
||||
m.mHasAlarm = this.mHasAlarm;
|
||||
m.mAlarmTime = this.mAlarmTime.getMutable();
|
||||
m.mRecurrenceInfo = this.mRecurrenceInfo.getMutable();
|
||||
m.mRecurrenceInfo = this.mRecurrenceInfo.clone();
|
||||
|
||||
m.mCreationDate = this.mCreationDate.clone();
|
||||
m.mAlarmTime = this.mAlarmTime.clone();
|
||||
|
||||
|
||||
m.mAttachments = this.mAttachments;
|
||||
@ -39,33 +56,36 @@ calItemBase.prototype = {
|
||||
|
||||
|
||||
|
||||
mGeneration: 0, get generation() { return this.mGeneration; },
|
||||
mCreationDate: null, get creationDate() { return this.mCreationDate; },
|
||||
mLastModifiedTime: 0, get lastModifiedTime() { return this.mLastModifiedTime; },
|
||||
mParent: null, get parent() { return this.mParent; },
|
||||
mId: null, get id() { return this.mId; },
|
||||
mTitle: "", get title() { return this.mTitle; },
|
||||
mPriority: 0, get priority() { return this.mPriority; },
|
||||
mIsPrivate: 0, get isPrivate() { return this.mIsPrivate; },
|
||||
mMethod: 0, get method() { return this.mMethod; },
|
||||
mStatus: 0, get status() { return this.mStatus; },
|
||||
mIcalString: "", get icalString() { return this.mIcalString; },
|
||||
mHasAlarm: false, get hasAlarm() { return this.mHasAlarm; },
|
||||
mAlarmTime: null, get alarmTime() { return this.mAlarmTime; },
|
||||
mRecurrenceInfo: null, get recurrenceInfo() { return this.mRecurrenceInfo; },
|
||||
mAttachments: null, get attachments() { return this.mAttachments; },
|
||||
mContacts: null, get contacts() { return this.mContacts; },
|
||||
mProperties: null, get properties() { return this.mProperties; }
|
||||
|
||||
mGeneration: 0, get generation() { return this.mGeneration; }, set generation(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mGeneration = v; },
|
||||
mCreationDate: null, get creationDate() { return this.mCreationDate; }, set creationDate(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mCreationDate = v; },
|
||||
mLastModifiedTime: 0, get lastModifiedTime() { return this.mLastModifiedTime; }, set lastModifiedTime(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mLastModifiedTime = v; },
|
||||
mParent: null, get parent() { return this.mParent; }, set parent(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mParent = v; },
|
||||
mId: null, get id() { return this.mId; }, set id(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mId = v; },
|
||||
mTitle: "", get title() { return this.mTitle; }, set title(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mTitle = v; },
|
||||
mPriority: 0, get priority() { return this.mPriority; }, set priority(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mPriority = v; },
|
||||
mIsPrivate: 0, get isPrivate() { return this.mIsPrivate; }, set isPrivate(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mIsPrivate = v; },
|
||||
mMethod: 0, get method() { return this.mMethod; }, set method(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mMethod = v; },
|
||||
mStatus: 0, get status() { return this.mStatus; }, set status(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mStatus = v; },
|
||||
mIcalString: "", get icalString() { return this.mIcalString; }, set icalString(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mIcalString = v; },
|
||||
mHasAlarm: false, get hasAlarm() { return this.mHasAlarm; }, set hasAlarm(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mHasAlarm = v; },
|
||||
mAlarmTime: null, get alarmTime() { return this.mAlarmTime; }, set alarmTime(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mAlarmTime = v; },
|
||||
mRecurrenceInfo: null, get recurrenceInfo() { return this.mRecurrenceInfo; }, set recurrenceInfo(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mRecurrenceInfo = v; },
|
||||
mAttachments: null, get attachments() { return this.mAttachments; }, set attachments(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mAttachments = v; },
|
||||
mContacts: null, get contacts() { return this.mContacts; }, set contacts(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mContacts = v; },
|
||||
mProperties: null, get properties() { return this.mProperties; }, set properties(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.mProperties = v; }
|
||||
|
||||
|
||||
};
|
||||
|
||||
function calMutableItemBase() { }
|
||||
function calItemOccurrence () {
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
|
||||
calMutableItemBase.prototype = {
|
||||
calItemOccurrence.prototype = {
|
||||
QueryInterface: function (aIID) {
|
||||
if (!aIID.equals(Components.interfaces.nsISupports) &&
|
||||
!aIID.equals(Components.interfaces.calIMutableItemBase))
|
||||
!aIID.equals(Components.interfaces.calIItemOccurrence))
|
||||
{
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
@ -73,28 +93,10 @@ calMutableItemBase.prototype = {
|
||||
return this;
|
||||
},
|
||||
|
||||
item: null,
|
||||
occurrenceStartDate: null,
|
||||
occurrenceEndDate: null,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
mGeneration: 0, get generation() { return this.mGeneration; }, set generation(v) { this.mGeneration = v; },
|
||||
mCreationDate: null, get creationDate() { return this.mCreationDate; }, set creationDate(v) { this.mCreationDate = v; },
|
||||
mLastModifiedTime: 0, get lastModifiedTime() { return this.mLastModifiedTime; }, set lastModifiedTime(v) { this.mLastModifiedTime = v; },
|
||||
mParent: null, get parent() { return this.mParent; }, set parent(v) { this.mParent = v; },
|
||||
mId: null, get id() { return this.mId; }, set id(v) { this.mId = v; },
|
||||
mTitle: null, get title() { return this.mTitle; }, set title(v) { this.mTitle = v; },
|
||||
mPriority: 0, get priority() { return this.mPriority; }, set priority(v) { this.mPriority = v; },
|
||||
mIsPrivate: 0, get isPrivate() { return this.mIsPrivate; }, set isPrivate(v) { this.mIsPrivate = v; },
|
||||
mMethod: 0, get method() { return this.mMethod; }, set method(v) { this.mMethod = v; },
|
||||
mStatus: 0, get status() { return this.mStatus; }, set status(v) { this.mStatus = v; },
|
||||
mIcalString: "", get icalString() { return this.mIcalString; }, set icalString(v) { this.mIcalString = v; },
|
||||
mHasAlarm: false, get hasAlarm() { return this.mHasAlarm; }, set hasAlarm(v) { this.mHasAlarm = v; },
|
||||
mAlarmTime: null, get alarmTime() { return this.mAlarmTime; }, set alarmTime(v) { this.mAlarmTime = v; },
|
||||
mRecurrenceInfo: null, get recurrenceInfo() { return this.mRecurrenceInfo; }, set recurrenceInfo(v) { this.mRecurrenceInfo = v; },
|
||||
mAttachments: null, get attachments() { return this.mAttachments; }, set attachments(v) { this.mAttachments = v; },
|
||||
mContacts: null, get contacts() { return this.mContacts; }, set contacts(v) { this.mContacts = v; },
|
||||
mProperties: null, get properties() { return this.mProperties; }, set properties(v) { this.mProperties = v; }
|
||||
|
||||
|
||||
next: null,
|
||||
previous: null
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ calItemBase.prototype = {
|
||||
this.mAlarmTime.makeImmutable();
|
||||
|
||||
this.mImmutable = true;
|
||||
}
|
||||
},
|
||||
|
||||
// for subclasses to use; copies the ItemBase's values
|
||||
// into m
|
||||
@ -96,7 +96,7 @@ calItemBase.prototype = {
|
||||
|
||||
#define MEMBER_ATTR(varname, initvalue, attrname) \
|
||||
varname: initvalue, \
|
||||
get attrname() { return this.varname; } \
|
||||
get attrname() { return this.varname; }, \
|
||||
set attrname(v) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; else this.varname = v; }
|
||||
|
||||
MEMBER_ATTR(mGeneration, 0, generation),
|
||||
@ -104,7 +104,7 @@ calItemBase.prototype = {
|
||||
MEMBER_ATTR(mLastModifiedTime, 0, lastModifiedTime),
|
||||
MEMBER_ATTR(mParent, null, parent),
|
||||
MEMBER_ATTR(mId, null, id),
|
||||
MEMBER_ATTR(mTitle, null, title),
|
||||
MEMBER_ATTR(mTitle, "", title),
|
||||
MEMBER_ATTR(mPriority, 0, priority),
|
||||
MEMBER_ATTR(mIsPrivate, 0, isPrivate),
|
||||
MEMBER_ATTR(mMethod, 0, method),
|
||||
|
Loading…
x
Reference in New Issue
Block a user