Bug 390842 - Error: redeclaration of var Cc in console, kills Lightning; r=dbo

git-svn-id: svn://10.0.0.236/trunk@236502 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
daniel.boelzle%sun.com 2007-09-22 18:26:57 +00:00
parent 52c5fd7c31
commit ce16a7bf73
32 changed files with 466 additions and 467 deletions

View File

@ -107,8 +107,8 @@
if (!aDate) {
docTitle = aNameArray[2];
} else {
var df = Cc["@mozilla.org/calendar/datetime-formatter;1"].
getService(Ci.calIDateTimeFormatter);
var df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"].
getService(Components.interfaces.calIDateTimeFormatter);
docTitle = df.formatDate(aDate);
}
document.title = docTitle + " - " + brand.GetStringFromName("brandShortName");

View File

@ -63,15 +63,15 @@
this.updateDaysOffPrefs();
// add a preference observer to monitor changes
var pb2 = Cc["@mozilla.org/preferences-service;1"].
var pb2 = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2);
pb2.addObserver("calendar.", this.mPrefObserver, false);
return;
]]></constructor>
<destructor><![CDATA[
var pb2 = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch2);
var pb2 = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2);
pb2.removeObserver("calendar.", this.mPrefObserver);
return;
]]></destructor>

View File

@ -64,8 +64,8 @@
viewElement.setVisibleMinutes(visibleMinutes);
// add a preference observer to monitor changes
var pb2 = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch2);
var pb2 = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2);
pb2.addObserver("calendar.", this.mPrefObserver, false);
this.updateDaysOffPrefs();
@ -74,8 +74,8 @@
]]></constructor>
<destructor><![CDATA[
var pb2 = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch2);
var pb2 = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2);
pb2.removeObserver("calendar.", this.mPrefObserver);
return;
]]></destructor>

View File

@ -66,15 +66,15 @@
this.updateDaysOffPrefs();
// add a preference observer to monitor changes
var pb2 = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch2);
var pb2 = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2);
pb2.addObserver("calendar.", this.mPrefObserver, false);
return;
]]></constructor>
<destructor><![CDATA[
var pb2 = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch2);
var pb2 = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2);
pb2.removeObserver("calendar.", this.mPrefObserver);
return;
]]></destructor>

View File

@ -193,7 +193,7 @@ function commonUpdateRepeatDetails(recurrenceInfo, startDate, endDate, allDay) {
if (rrules[0].length == 1) {
var rule = rrules[0][0];
// currently we don't allow for any BYxxx-rules.
if (rule instanceof Ci.calIRecurrenceRule &&
if (rule instanceof Components.interfaces.calIRecurrenceRule &&
!checkRecurrenceRule(rule, ['BYSECOND',
'BYMINUTE',
//'BYDAY',
@ -497,8 +497,8 @@ function commonUpdateRepeatDetails(recurrenceInfo, startDate, endDate, allDay) {
var kDefaultTimezone = calendarDefaultTimezone();
var dateFormatter =
Cc["@mozilla.org/calendar/datetime-formatter;1"]
.getService(Ci.calIDateTimeFormatter);
Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
.getService(Components.interfaces.calIDateTimeFormatter);
var detailsString;
if (allDay) {
@ -738,7 +738,7 @@ function loadReminder(item) {
// try to match the reminder setting with the available popup items
var origin = "1";
if (item.alarmRelated == Ci.calIItemBase.ALARM_RELATED_END) {
if (item.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_END) {
origin = "-1";
}
var duration = item.alarmOffset.clone();
@ -789,7 +789,7 @@ function loadReminder(item) {
var customReminder =
document.getElementById("reminder-custom-menuitem");
var reminder = {};
if (item.alarmRelated == Ci.calIItemBase.ALARM_RELATED_START) {
if (item.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_START) {
reminder.origin = "1";
} else {
reminder.origin = "-1";
@ -846,8 +846,8 @@ function saveReminder(item) {
reminder.origin = menuitem.getAttribute('origin');
}
var duration = Cc["@mozilla.org/calendar/duration;1"]
.createInstance(Ci.calIDuration);
var duration = Components.classes["@mozilla.org/calendar/duration;1"]
.createInstance(Components.interfaces.calIDuration);
duration[reminder.unit] = Number(reminder.length);
if (reminder.relation != "END") {
@ -857,9 +857,9 @@ function saveReminder(item) {
item.alarmOffset = duration;
if (Number(reminder.origin) >= 0) {
item.alarmRelated = Ci.calIItemBase.ALARM_RELATED_START;
item.alarmRelated = Components.interfaces.calIItemBase.ALARM_RELATED_START;
} else {
item.alarmRelated = Ci.calIItemBase.ALARM_RELATED_END;
item.alarmRelated = Components.interfaces.calIItemBase.ALARM_RELATED_END;
}
}
}

View File

@ -46,8 +46,8 @@ var calendarDNDObserver = {
},
onDrop: function calDNDDrop(aEvent, aTransferData, aDragSession) {
var transferable = Cc["@mozilla.org/widget/transferable;1"]
.createInstance(Ci.nsITransferable);
var transferable = Components.classes["@mozilla.org/widget/transferable;1"]
.createInstance(Components.interfaces.nsITransferable);
transferable.addDataFlavor("text/x-moz-url");
transferable.addDataFlavor("application/x-moz-file");
transferable.addDataFlavor("text/calendar");
@ -59,7 +59,7 @@ var calendarDNDObserver = {
var bestFlavor = new Object();
var length = new Object();
transferable.getAnyTransferData(bestFlavor, data, length);
data = data.value.QueryInterface(Ci.nsISupportsString);
data = data.value.QueryInterface(Components.interfaces.nsISupportsString);
// Treat unicode data with VEVENT in it as text/calendar
if (bestFlavor.value == "text/unicode" && data.toString().indexOf("VEVENT") != -1) {
@ -69,8 +69,8 @@ var calendarDNDObserver = {
var destCal = getSelectedCalendar();
switch (bestFlavor.value) {
case "text/calendar":
var parser = Cc["@mozilla.org/calendar/ics-parser;1"]
.createInstance(Ci.calIIcsParser);
var parser = Components.classes["@mozilla.org/calendar/ics-parser;1"]
.createInstance(Components.interfaces.calIIcsParser);
parser.parseString(data);
startBatchTransaction();
try {
@ -89,18 +89,18 @@ var calendarDNDObserver = {
var url = makeURL(droppedUrl);
var localFileInstance = Cc["@mozilla.org/file/local;1"]
.createInstance(Ci.nsILocalFile);
var localFileInstance = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
localFileInstance.initWithPath(url.path);
var inputStream = Cc["@mozilla.org/network/file-input-stream;1"]
.createInstance(Ci.nsIFileInputStream);
var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
.createInstance(Components.interfaces.nsIFileInputStream);
inputStream.init(localFileInstance, MODE_RDONLY, 0444, {});
try {
//XXX support csv
var importer = Cc["@mozilla.org/calendar/import;1?type=ics"]
.getService(Ci.calIImporter);
var importer = Components.classes["@mozilla.org/calendar/import;1?type=ics"]
.getService(Components.interfaces.calIImporter);
var items = importer.importFromStream(inputStream, {});
startBatchTransaction();
try {
@ -119,10 +119,10 @@ var calendarDNDObserver = {
break;
case "application/x-moz-file-promise":
case "text/x-moz-url":
var ioService = Cc["@mozilla.org/network/io-service;1"]
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var uri = ioService.newURI(data.toString(), null, null);
var loader = Cc["@mozilla.org/network/unichar-stream-loader;1"]
var loader = Components.classes["@mozilla.org/network/unichar-stream-loader;1"]
.createInstance(Components.interfaces.nsIUnicharStreamLoader);
channel = ioService.newChannelFromURI(uri);
channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;
@ -148,8 +148,8 @@ var calendarDNDObserver = {
while (unicharData.readString(-1, str_)) {
str += str_.value;
}
var parser = Cc["@mozilla.org/calendar/ics-parser;1"]
.createInstance(Ci.calIIcsParser);
var parser = Components.classes["@mozilla.org/calendar/ics-parser;1"]
.createInstance(Components.interfaces.calIIcsParser);
parser.parseString(str);
startBatchTransaction();
try {

View File

@ -43,8 +43,8 @@ var gCompositeCalendar = null;
function getCompositeCalendar() {
if (!gCompositeCalendar) {
gCompositeCalendar =
Cc["@mozilla.org/calendar/calendar;1?type=composite"]
.createInstance(Ci.calICompositeCalendar);
Components.classes["@mozilla.org/calendar/calendar;1?type=composite"]
.createInstance(Components.interfaces.calICompositeCalendar);
gCompositeCalendar.prefPrefix = 'calendar-main';
}
@ -64,8 +64,8 @@ function promptDeleteCalendar(aCalendar) {
return;
}
var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var ok = promptService.confirm(
window,
calGetString("calendar", "unsubscribeCalendarTitle"),
@ -95,9 +95,9 @@ function loadCalendarManager() {
var calMgr = getCalendarManager();
var composite = getCompositeCalendar();
var calendars = calMgr.getCalendars({});
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
var branch = prefService.getBranch("").QueryInterface(Ci.nsIPrefBranch2);
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var branch = prefService.getBranch("").QueryInterface(Components.interfaces.nsIPrefBranch2);
if (calendars.length == 0) {
var url = makeURL("moz-profile-calendar://");
@ -141,9 +141,9 @@ function loadCalendarManager() {
function unloadCalendarManager() {
var calMgr = getCalendarManager();
var composite = getCompositeCalendar();
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
var branch = prefService.getBranch("").QueryInterface(Ci.nsIPrefBranch2);
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var branch = prefService.getBranch("").QueryInterface(Components.interfaces.nsIPrefBranch2);
branch.removeObserver("calendar.", calendarManagerObserver);
composite.removeObserver(calendarManagerObserver);
@ -161,8 +161,8 @@ function calendarListInitCategoryColors() {
gCachedStyleSheet = getStyleSheet(cssUri);
}
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var categoryPrefBranch = prefService.getBranch("calendar.category.color.");
var categories = categoryPrefBranch.getChildList("", {});
@ -392,7 +392,7 @@ var calendarListTreeView = {
* Calendar Tree Events
*/
onKeyPress: function cLTV_onKeyPress(event) {
const kKE = Ci.nsIDOMKeyEvent;
const kKE = Components.interfaces.nsIDOMKeyEvent;
switch (event.keyCode || event.which) {
case kKE.DOM_VK_DELETE:
promptDeleteCalendar(getSelectedCalendar());
@ -491,12 +491,12 @@ var calendarManagerObserver = {
mDefaultCalendarItem: null,
QueryInterface: function cMO_QueryInterface(aIID) {
if (!aIID.equals(Ci.calICalendarManagerObserver) &&
!aIID.equals(Ci.calICompositeObserver) &&
!aIID.equals(Ci.calIObserver) &&
!aIID.equals(Ci.nsIObserver) &&
!aIID.equals(Ci.nsISupports)) {
throw Cr.NS_ERROR_NO_INTERFACE;
if (!aIID.equals(Components.interfaces.calICalendarManagerObserver) &&
!aIID.equals(Components.interfaces.calICompositeObserver) &&
!aIID.equals(Components.interfaces.calIObserver) &&
!aIID.equals(Components.interfaces.nsIObserver) &&
!aIID.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
},
@ -642,7 +642,7 @@ var calendarManagerObserver = {
toDoUnifinderRefresh();
break;
case "calendar.timezone.local":
var subject = aSubject.QueryInterface(Ci.nsIPrefBranch2);
var subject = aSubject.QueryInterface(Components.interfaces.nsIPrefBranch2);
gDefaultTimezone = subject.getCharPref(aPrefName);
var view = currentView();

View File

@ -41,11 +41,11 @@
var minimonthBusyListener = {
QueryInterface: function mBL_QueryInterface(aIID) {
if (!aIID.equals(Ci.calIOperationListener) &&
!aIID.equals(Ci.calICompositeObserver) &&
!aIID.equals(Ci.calIObserver) &&
!aIID.equals(Ci.nsISupports)) {
throw Cr.NS_ERROR_NO_INTERFACE;
if (!aIID.equals(Components.interfaces.calIOperationListener) &&
!aIID.equals(Components.interfaces.calICompositeObserver) &&
!aIID.equals(Components.interfaces.calIObserver) &&
!aIID.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
},

View File

@ -133,8 +133,8 @@
icon.setAttribute("type", "all-day");
} else {
var label = document.getAnonymousElementByAttribute(this,"anonid","item-label");
var df = Cc["@mozilla.org/calendar/datetime-formatter;1"].
getService(Ci.calIDateTimeFormatter);
var df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"].
getService(Components.interfaces.calIDateTimeFormatter);
label.value = df.formatTime(
val.startDate.getInTimezone(
this.calendarView.mTimezone));
@ -159,21 +159,21 @@
<handlers>
<handler event="draggesture"><![CDATA[
var dragService = Cc["@mozilla.org/widget/dragservice;1"].
getService(Ci.nsIDragService);
var transfer = Cc["@mozilla.org/widget/transferable;1"].
createInstance(Ci.nsITransferable);
var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].
getService(Components.interfaces.nsIDragService);
var transfer = Components.classes["@mozilla.org/widget/transferable;1"].
createInstance(Components.interfaces.nsITransferable);
var item = this.occurrence;
transfer.addDataFlavor("text/calendar");
var flavourProvider = {
QueryInterface: function(aIID) {
if (aIID.equals(Ci.nsIFlavorDataProvider) ||
aIID.equals(Ci.nsISupports)) {
if (aIID.equals(Components.interfaces.nsIFlavorDataProvider) ||
aIID.equals(Components.interfaces.nsISupports)) {
return this;
}
throw Cr.NS_NOINTERFACE;
throw Components.results.NS_NOINTERFACE;
},
item: item,
@ -197,15 +197,15 @@
}
// Also set some normal data-types, in case we drag into another app
var supportsString = Cc["@mozilla.org/supports-string;1"].
createInstance(Ci.nsISupportsString);
var supportsString = Components.classes["@mozilla.org/supports-string;1"].
createInstance(Components.interfaces.nsISupportsString);
supportsString.data = item.icalComponent.serializeToICS();
transfer.setTransferData("text/calendar", supportsString, supportsString.data.length*2);
transfer.setTransferData("text/unicode", supportsString, supportsString.data.length*2);
var action = dragService.DRAGDROP_ACTION_MOVE;
var supArray = Cc["@mozilla.org/supports-array;1"].
createInstance(Ci.nsISupportsArray);
var supArray = Components.classes["@mozilla.org/supports-array;1"].
createInstance(Components.interfaces.nsISupportsArray);
supArray.AppendElement(transfer);
// OK, now that the data is all set up, start playing with the shadows
@ -228,8 +228,8 @@
// for that case.
var monthbox = this.parentBox;
monthbox.monthView.dropListener = function checkStillDragging() {
var dragService = Cc["@mozilla.org/widget/dragservice;1"].
getService(Ci.nsIDragService);
var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].
getService(Components.interfaces.nsIDragService);
var session;
try {
session = dragService.getCurrentSession();
@ -331,7 +331,7 @@
<parameter name="aDate"/>
<body><![CDATA[
if (!aDate)
throw Cr.NS_ERROR_NULL_POINTER;
throw Components.results.NS_ERROR_NULL_POINTER;
// Remove all the old events
this.mItemData = new Array();
@ -575,8 +575,8 @@
this.monthView.controller.createNewEvent();
]]></handler>
<handler event="dragenter"><![CDATA[
var dragService = Cc["@mozilla.org/widget/dragservice;1"].
getService(Ci.nsIDragService);
var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].
getService(Components.interfaces.nsIDragService);
var session = dragService.getCurrentSession();
session.canDrop = true;
this.removeDropShadows();
@ -584,8 +584,8 @@
]]></handler>
<handler event="dragover"><![CDATA[
var dragService = Cc["@mozilla.org/widget/dragservice;1"].
getService(Ci.nsIDragService);
var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].
getService(Components.interfaces.nsIDragService);
var session = dragService.getCurrentSession();
session.canDrop = true;
]]></handler>
@ -594,19 +594,19 @@
return;
}
this.removeDropShadows();
var dragService = Cc["@mozilla.org/widget/dragservice;1"].
getService(Ci.nsIDragService);
var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].
getService(Components.interfaces.nsIDragService);
var session = dragService.getCurrentSession();
session.canDrop = false;
]]></handler>
<handler event="dragdrop"><![CDATA[
var dragService = Cc["@mozilla.org/widget/dragservice;1"].
getService(Ci.nsIDragService);
var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].
getService(Components.interfaces.nsIDragService);
var session = dragService.getCurrentSession();
var transfer = Cc["@mozilla.org/widget/transferable;1"].
createInstance(Ci.nsITransferable);
var transfer = Components.classes["@mozilla.org/widget/transferable;1"].
createInstance(Components.interfaces.nsITransferable);
transfer.addDataFlavor("application/x-moz-cal-event");
session.getData(transfer, 0);
var flavor = {};
@ -1109,7 +1109,7 @@
<parameter name="aCount"/>
<parameter name="aDates"/>
<body><![CDATA[
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
]]></body>
</method>
@ -1496,9 +1496,9 @@
calView: this,
QueryInterface: function (aIID) {
if (!aIID.equals(Ci.calIOperationListener) &&
!aIID.equals(Ci.nsISupports)) {
throw Cr.NS_ERROR_NO_INTERFACE;
if (!aIID.equals(Components.interfaces.calIOperationListener) &&
!aIID.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
@ -1529,10 +1529,10 @@
mBatchCount: 0,
QueryInterface: function (aIID) {
if (!aIID.equals(Ci.calIObserver) &&
!aIID.equals(Ci.calICompositeObserver) &&
!aIID.equals(Ci.nsISupports)) {
throw Cr.NS_ERROR_NO_INTERFACE;
if (!aIID.equals(Components.interfaces.calIObserver) &&
!aIID.equals(Components.interfaces.calICompositeObserver) &&
!aIID.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
@ -1646,7 +1646,7 @@
<handlers>
<handler event="keypress"><![CDATA[
const kKE = Ci.nsIDOMKeyEvent;
const kKE = Components.interfaces.nsIDOMKeyEvent;
if (event.keyCode == kKE.DOM_VK_BACK_SPACE ||
event.keyCode == kKE.DOM_VK_DELETE)
{

View File

@ -133,8 +133,8 @@
while (topbox.lastChild)
topbox.removeChild(topbox.lastChild);
var formatter = Cc["@mozilla.org/intl/scriptabledateformat;1"].
getService(Ci.nsIScriptableDateFormat);
var formatter = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
getService(Components.interfaces.nsIScriptableDateFormat);
var timeString;
var theMin = this.mStartMin;
var theHour = Math.floor(theMin / 60);
@ -160,7 +160,7 @@
box = makeTimeBox("", durPix);
} else {
timeString = formatter.FormatTime("",
Ci.nsIScriptableDateFormat.timeFormatNoSeconds,
Components.interfaces.nsIScriptableDateFormat.timeFormatNoSeconds,
theHour, 0, 0);
box = makeTimeBox(timeString, durPix);
}
@ -1580,13 +1580,13 @@
var endhr = Math.floor(realendmin / 60);
var endmin = realendmin % 60;
var formatter = Cc["@mozilla.org/intl/scriptabledateformat;1"].
getService(Ci.nsIScriptableDateFormat);
var formatter = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
getService(Components.interfaces.nsIScriptableDateFormat);
var startstr = formatter.FormatTime("",
Ci.nsIScriptableDateFormat.timeFormatNoSeconds,
Components.interfaces.nsIScriptableDateFormat.timeFormatNoSeconds,
starthr, startmin, 0);
var endstr = formatter.FormatTime("",
Ci.nsIScriptableDateFormat.timeFormatNoSeconds,
Components.interfaces.nsIScriptableDateFormat.timeFormatNoSeconds,
endhr, endmin, 0);
this.fgboxes.startlabel.setAttribute("value", startstr);
@ -2049,8 +2049,8 @@
]]></getter>
<setter><![CDATA[
this.mDate = val;
var df = Cc["@mozilla.org/calendar/datetime-formatter;1"].
getService(Ci.calIDateTimeFormatter);
var df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"].
getService(Components.interfaces.calIDateTimeFormatter);
var shortName = document.getAnonymousElementByAttribute(this, "anonid", "shortWeekdayName");
var longName = document.getAnonymousElementByAttribute(this, "anonid", "longWeekdayName");
@ -2238,9 +2238,9 @@
// the calIObserver, and calICompositeObserver
({
QueryInterface: function QueryInterface(aIID) {
if (!aIID.equals(Ci.calIObserver) &&
!aIID.equals(Ci.calICompositeObserver) &&
!aIID.equals(Ci.nsISupports)) {
if (!aIID.equals(Components.interfaces.calIObserver) &&
!aIID.equals(Components.interfaces.calICompositeObserver) &&
!aIID.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
@ -3024,8 +3024,8 @@
var labelbox;
var df = Cc["@mozilla.org/calendar/datetime-formatter;1"].
getService(Ci.calIDateTimeFormatter);
var df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"].
getService(Components.interfaces.calIDateTimeFormatter);
if (counter < labelboxkids.length) {
labelbox = labelboxkids[counter];
labelbox.date = d;
@ -3291,7 +3291,7 @@
<body><![CDATA[
var minute = 0;
var childbox = document.getAnonymousElementByAttribute(this, "anonid", "childbox");
var scrollBoxObject = childbox.boxObject.QueryInterface(Ci.nsIScrollBoxObject);
var scrollBoxObject = childbox.boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject);
if (scrollBoxObject != null) {
var x = {};
var y = {};
@ -3318,7 +3318,7 @@
<parameter name="aMinute"/>
<body><![CDATA[
var childbox = document.getAnonymousElementByAttribute(this, "anonid", "childbox");
var scrollBoxObject = childbox.boxObject.QueryInterface(Ci.nsIScrollBoxObject);
var scrollBoxObject = childbox.boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject);
if (scrollBoxObject != null) {
var x = {};
var y = {};
@ -3380,7 +3380,7 @@
event.preventDefault();
]]></handler>
<handler event="keypress"><![CDATA[
const kKE = Ci.nsIDOMKeyEvent;
const kKE = Components.interfaces.nsIDOMKeyEvent;
if (event.keyCode == kKE.DOM_VK_BACK_SPACE ||
event.keyCode == kKE.DOM_VK_DELETE)
{

View File

@ -131,7 +131,7 @@ function loadDialog()
if (rules.length > 0) {
// we only handle 1 rule currently
var rule = rules[0];
if (rule instanceof Ci.calIRecurrenceRule) {
if (rule instanceof Components.interfaces.calIRecurrenceRule) {
switch(rule.type) {
case "DAILY":

View File

@ -752,7 +752,7 @@ function toggleCompletedTasks() {
}
function onKeyPress(event) {
const kKE = Ci.nsIDOMKeyEvent;
const kKE = Components.interfaces.nsIDOMKeyEvent;
switch (event.keyCode || event.which) {
case kKE.DOM_VK_DELETE:
document.getElementById('delete_todo_command').doCommand();

View File

@ -52,8 +52,8 @@ var gMigrateWizard = {
var listbox = document.getElementById("datasource-list");
//XXX Once we have branding for lightning, this hack can go away
var sbs = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService);
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var props = sbs.createBundle("chrome://calendar/locale/migration.properties");
@ -111,8 +111,8 @@ var gMigrateWizard = {
wizard.canRewind = false;
// We're going to need this for the progress meter's description
var sbs = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService);
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var props = sbs.createBundle("chrome://calendar/locale/migration.properties");
var label = document.getElementById("progress-label");
var meter = document.getElementById("migrate-progressmeter");
@ -179,16 +179,16 @@ var gDataMigrator = {
*/
get dirService() {
if (!this.mDirService) {
this.mDirService = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIProperties);
this.mDirService = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
}
return this.mDirService;
},
get ioService() {
if (!this.mIoService) {
this.mIoService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
this.mIoService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
}
return this.mIoService;
},
@ -200,8 +200,8 @@ var gDataMigrator = {
*/
isLightning: function is_ltn() {
if (this.mIsLightning == null) {
var appInfo = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULAppInfo);
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
this.mIsLightning = !(appInfo.ID == SUNBIRD_UID);
return this.mIsLightning;
}
@ -217,8 +217,8 @@ var gDataMigrator = {
* wizard, otherwise, we'll return silently.
*/
checkAndMigrate: function gdm_migrate() {
var appInfo = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULAppInfo);
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
this.mIsLightning = !(appInfo.ID == SUNBIRD_UID)
LOG("mIsLightning is: " + this.mIsLightning);
if (appInfo.ID == FIREFOX_UID) {
@ -228,8 +228,8 @@ var gDataMigrator = {
return;
}
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULRuntime);
this.mPlatform = xulRuntime.OS.toLowerCase();
LOG("mPlatform is: " + this.mPlatform);
@ -286,29 +286,29 @@ var gDataMigrator = {
// We can't use our normal helper-functions, because those might
// conflict too.
var sbs = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService);
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var props = sbs.createBundle("chrome://calendar/locale/migration.properties");
var brand = sbs.createBundle("chrome://branding/locale/brand.properties");
var appName = brand.GetStringFromName("brandShortName");
// Tell the user we're going to disable and restart
var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
promptService.alert(window,
props.GetStringFromName("disableExtTitle"),
props.formatStringFromName("disableExtText",
[brand],1));
// Kiiillllll...
var em = Cc["@mozilla.org/extensions/manager;1"]
.getService(Ci.nsIExtensionManager);
var em = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager);
em.disableItem("{8e117890-a33f-424b-a2ea-deb272731365}");
promptService.alert(window, getString("disableDoneTitle"),
getString("disableExtDone"));
var startup = Cc["@mozilla.org/toolkit/app-startup;1"]
.getService(Ci.nsIAppStartup);
startup.quit(Ci.nsIAppStartup.eRestart |
Ci.nsIAppStartup.eAttemptQuit);
var startup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
.getService(Components.interfaces.nsIAppStartup);
startup.quit(Components.interfaces.nsIAppStartup.eRestart |
Components.interfaces.nsIAppStartup.eAttemptQuit);
}
// This is the function that the migration wizard will call to actually
@ -326,8 +326,8 @@ var gDataMigrator = {
// Let this be a lesson to anyone designing APIs. The RDF API is so
// impossibly confusing that it's actually simpler/cleaner/shorter
// to simply parse as XML and use the better DOM APIs.
var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Ci.nsIXMLHttpRequest);
var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Components.interfaces.nsIXMLHttpRequest);
req.open('GET', "file://" + dataSource.path, true);
req.onreadystatechange = function calext_onreadychange() {
if (req.readyState == 4) {
@ -362,8 +362,8 @@ var gDataMigrator = {
var node = nodes[i];
if (getRDFAttr(node, "remote") == "false") {
LOG("not remote");
var localFile = Cc["@mozilla.org/file/local;1"]
.createInstance(Ci.nsILocalFile);
var localFile = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
localFile.initWithPath(getRDFAttr(node, "path"));
cal = gDataMigrator.importICSToStorage(localFile);
} else {
@ -384,7 +384,7 @@ var gDataMigrator = {
// Look in our current profile directory, in case we're upgrading in
// place
var profileDir = this.dirService.get("ProfD", Ci.nsILocalFile);
var profileDir = this.dirService.get("ProfD", Components.interfaces.nsILocalFile);
profileDir.append("Calendar");
if (profileDir.exists()) {
LOG("Found old extension directory in current app");
@ -422,7 +422,7 @@ var gDataMigrator = {
for each (var prof in profiles) {
var dirEnum = prof.directoryEntries;
while (dirEnum.hasMoreElements()) {
var profile = dirEnum.getNext().QueryInterface(Ci.nsIFile);
var profile = dirEnum.getNext().QueryInterface(Components.interfaces.nsIFile);
if (profile.isFile()) {
continue;
} else {
@ -453,7 +453,7 @@ var gDataMigrator = {
var i = 1;
while(dirs.hasMoreElements()) {
var dataDir = dirs.getNext().QueryInterface(Ci.nsIFile);
var dataDir = dirs.getNext().QueryInterface(Components.interfaces.nsIFile);
var dataStore = dataDir.clone();
dataStore.append("corestorage.ics");
if (!dataStore.exists()) {
@ -461,12 +461,12 @@ var gDataMigrator = {
}
var chars = [];
var fileStream = Cc["@mozilla.org/network/file-input-stream;1"]
.createInstance(Ci.nsIFileInputStream);
var fileStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
.createInstance(Components.interfaces.nsIFileInputStream);
fileStream.init(dataStore, 0x01, 0444, {});
var convStream = Cc["@mozilla.org/intl/converter-input-stream;1"]
.getService(Ci.nsIConverterInputStream);
var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
.getService(Components.interfaces.nsIConverterInputStream);
convStream.init(fileStream, 'UTF-8', 0, 0x0000);
var tmpStr = {};
var str = "";
@ -487,16 +487,16 @@ var gDataMigrator = {
str = str.replace(sub, "", "g");
index = str.indexOf(";TZID=");
}
var tempFile = gDataMigrator.dirService.get("TmpD", Ci.nsIFile);
var tempFile = gDataMigrator.dirService.get("TmpD", Components.interfaces.nsIFile);
tempFile.append("icalTemp.ics");
tempFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600);
tempFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0600);
var tempUri = gDataMigrator.ioService.newFileURI(tempFile);
var stream = Cc["@mozilla.org/network/file-output-stream;1"]
.createInstance(Ci.nsIFileOutputStream);
var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
stream.init(tempFile, 0x2A, 0600, 0);
var convStream = Cc["@mozilla.org/intl/converter-output-stream;1"]
.getService(Ci.nsIConverterOutputStream);
var convStream = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
.getService(Components.interfaces.nsIConverterOutputStream);
convStream.init(stream, 'UTF-8', 0, 0x0000);
convStream.writeString(str);
@ -507,7 +507,7 @@ var gDataMigrator = {
LOG("icalMig making callback");
aCallback();
}
var profileDir = this.dirService.get("ProfD", Ci.nsILocalFile);
var profileDir = this.dirService.get("ProfD", Components.interfaces.nsILocalFile);
var icalSpec = profileDir.path;
var icalFile;
if (!this.isLightning()) {
@ -516,8 +516,8 @@ var gDataMigrator = {
return [];
}
icalSpec = icalSpec.substr(0, diverge);
icalFile = Cc["@mozilla.org/file/local;1"]
.createInstance(Ci.nsILocalFile);
icalFile = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
icalFile.initWithPath(icalSpec);
} else {
var diverge = icalSpec.indexOf("Thunderbird");
@ -525,8 +525,8 @@ var gDataMigrator = {
return [];
}
icalSpec = icalSpec.substr(0, diverge);
icalFile = Cc["@mozilla.org/file/local;1"]
.createInstance(Ci.nsILocalFile);
icalFile = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
icalFile.initWithPath(icalSpec);
icalFile.append("Application Support");
}
@ -553,7 +553,7 @@ var gDataMigrator = {
var i = 1;
while(dirs.hasMoreElements()) {
var dataDir = dirs.getNext().QueryInterface(Ci.nsIFile);
var dataDir = dirs.getNext().QueryInterface(Components.interfaces.nsIFile);
var dataStore = dataDir.clone();
dataStore.append("calendar.ics");
if (!dataStore.exists()) {
@ -568,7 +568,7 @@ var gDataMigrator = {
aCallback();
}
var profileDir = this.dirService.get("ProfD", Ci.nsILocalFile);
var profileDir = this.dirService.get("ProfD", Components.interfaces.nsILocalFile);
var evoSpec = profileDir.path;
var evoFile;
if (!this.mIsLightning) {
@ -577,8 +577,8 @@ var gDataMigrator = {
return [];
}
evoSpec = evoSpec.substr(0, diverge);
evoFile = Cc["@mozilla.org/file/local;1"]
.createInstance(Ci.nsILocalFile);
evoFile = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
evoFile.initWithPath(evoSpec);
} else {
var diverge = evoSpec.indexOf(".thunderbird");
@ -586,8 +586,8 @@ var gDataMigrator = {
return [];
}
evoSpec = evoSpec.substr(0, diverge);
evoFile = Cc["@mozilla.org/file/local;1"]
.createInstance(Ci.nsILocalFile);
evoFile = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
evoFile.initWithPath(evoSpec);
}
evoFile.append(".evolution");
@ -613,11 +613,11 @@ var gDataMigrator = {
}
var cal = calManager.createCalendar("storage", makeURL(uri+i));
var icsImporter = Cc["@mozilla.org/calendar/import;1?type=ics"]
.getService(Ci.calIImporter);
var icsImporter = Components.classes["@mozilla.org/calendar/import;1?type=ics"]
.getService(Components.interfaces.calIImporter);
var inputStream = Cc["@mozilla.org/network/file-input-stream;1"]
.createInstance(Ci.nsIFileInputStream);
var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
.createInstance(Components.interfaces.nsIFileInputStream);
inputStream.init(icsFile, MODE_RDONLY, 0444, {} );
var items = icsImporter.importFromStream(inputStream, {});
// Defined in import-export.js
@ -656,7 +656,7 @@ var gDataMigrator = {
getThunderbirdProfile: function gdm_getTB() {
var localFile;
var profileRoot = this.dirService.get("DefProfRt", Ci.nsILocalFile);
var profileRoot = this.dirService.get("DefProfRt", Components.interfaces.nsILocalFile);
LOG("profileRoot = " + profileRoot.path);
if (this.mIsLightning) {
localFile = profileRoot;
@ -684,7 +684,7 @@ var gDataMigrator = {
getNormalProfile: function gdm_getNorm(aAppName) {
var localFile;
var profileRoot = this.dirService.get("DefProfRt", Ci.nsILocalFile);
var profileRoot = this.dirService.get("DefProfRt", Components.interfaces.nsILocalFile);
LOG("profileRoot = " + profileRoot.path);
if (this.isLightning()) { // We're in Thunderbird
@ -732,8 +732,8 @@ function LOG(aString) {
if (!getPrefSafe("calendar.migration.log", false)) {
return;
}
var consoleService = Cc["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService);
var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage(aString);
dump(aString+"\n");
}

View File

@ -288,7 +288,7 @@ calCalendarManager.prototype = {
// If we're Lightning, we want to include the extension name
// in the error message rather than blaming Thunderbird.
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULAppInfo);
.getService(Components.interfaces.nsIXULAppInfo);
var errorBoxTitle;
var errorBoxText;
var errorBoxButtonLabel;

View File

@ -48,9 +48,9 @@ function calItipItem() {
calItipItem.prototype = {
getInterfaces: function ciiGI(count) {
var ifaces = [
Ci.nsIClassInfo,
Ci.nsISupports,
Ci.calIItipItem
Components.interfaces.nsIClassInfo,
Components.interfaces.nsISupports,
Components.interfaces.calIItipItem
];
count.value = ifaces.length;
return ifaces;
@ -63,11 +63,12 @@ calItipItem.prototype = {
contractID: "@mozilla.org/calendar/itip-item;1",
classDescription: "Calendar iTIP item",
classID: Components.ID("{f41392ab-dcad-4bad-818f-b3d1631c4d93}"),
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
implementationLanguage: Components.interfaces.nsIProgrammingLanguage.JAVASCRIPT,
flags: 0,
QueryInterface: function ciiQI(aIid) {
if (!aIid.equals(Ci.nsISupports) && !aIid.equals(Ci.calIItipItem)) {
if (!aIid.equals(Components.interfaces.nsISupports) &&
!aIid.equals(Components.interfaces.calIItipItem)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
@ -162,8 +163,8 @@ calItipItem.prototype = {
mPropertiesList: null,
init: function ciiI(aIcalString) {
var parser = Cc["@mozilla.org/calendar/ics-parser;1"].
createInstance(Ci.calIIcsParser);
var parser = Components.classes["@mozilla.org/calendar/ics-parser;1"].
createInstance(Components.interfaces.calIIcsParser);
parser.parseString(aIcalString);
this.mItemList = parser.getItems({});
this.mPropertiesList = parser.getProperties({});
@ -197,8 +198,8 @@ calItipItem.prototype = {
// Create a new calItipItem and initialize it using the icalString
// from above.
var newItem = Cc["@mozilla.org/calendar/itip-item;1"].
createInstance(Ci.calIItipItem);
var newItem = Components.classes["@mozilla.org/calendar/itip-item;1"].
createInstance(Components.interfaces.calIItipItem);
newItem.init(icalString);
// Copy over the exposed attributes.
@ -266,8 +267,8 @@ calItipItem.prototype = {
// create a new attendee from scratch WITHOUT the RSVP
// property and copy in the other relevant data.
// XXX use deleteProperty after bug 358498 is fixed.
newAttendee = Cc["@mozilla.org/calendar/attendee;1"].
createInstance(Ci.calIAttendee);
newAttendee = Components.classes["@mozilla.org/calendar/attendee;1"].
createInstance(Components.interfaces.calIAttendee);
if (attendee.commonName) {
newAttendee.commonName = attendee.commonName;
}

View File

@ -53,9 +53,9 @@ function calItipProcessor() {
calItipProcessor.prototype = {
getInterfaces: function cipGI(count) {
var ifaces = [
Ci.nsIClassInfo,
Ci.nsISupports,
Ci.calIItipProcessor
Components.interfaces.nsIClassInfo,
Components.interfaces.nsISupports,
Components.interfaces.calIItipProcessor
];
count.value = ifaces.length;
return ifaces;
@ -68,12 +68,13 @@ calItipProcessor.prototype = {
contractID: "@mozilla.org/calendar/itip-processor;1",
classDescription: "Calendar iTIP processor",
classID: Components.ID("{9787876b-0780-4464-8282-b7f86fb221e8}"),
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
implementationLanguage: Components.interfaces.nsIProgrammingLanguage.JAVASCRIPT,
flags: 0,
QueryInterface: function cipQI(aIid) {
if (!aIid.equals(Ci.nsIClassInfo) && !aIid.equals(Ci.nsISupports) &&
!aIid.equals(Ci.calIItipProcessor))
if (!aIid.equals(Components.interfaces.nsIClassInfo) &&
!aIid.equals(Components.interfaces.nsISupports) &&
!aIid.equals(Components.interfaces.calIItipProcessor))
{
throw Components.results.NS_ERROR_NO_INTERFACE;
}
@ -116,8 +117,8 @@ calItipProcessor.prototype = {
// XXX Support for transports other than email go here.
// For now we just assume it's email.
var transport = Cc["@mozilla.org/calendar/itip-transport;1?type=email"].
createInstance(Ci.calIItipTransport);
var transport = Components.classes["@mozilla.org/calendar/itip-transport;1?type=email"].
createInstance(Components.interfaces.calIItipTransport);
// Sanity checks using the first item
var itemList = respItipItem.getItemList({ });
@ -262,8 +263,8 @@ calItipProcessor.prototype = {
if (!(aRespMethod == "ADD" ||
(aRespMethod == "REFRESH" &&
// REFRESH is not a valid response to an ADD for VJOURNAL
(aCalItemType == Ci.calIEvent ||
aCalItemType == Ci.calITodo))))
(aCalItemType == Components.interfaces.calIEvent ||
aCalItemType == Components.interfaces.calITodo))))
{
return false;
}
@ -324,10 +325,10 @@ calItipProcessor.prototype = {
* Helper to return whether an item is an event, todo, etc.
*/
_getCalItemType: function cipGCIT(aCalItem) {
if (aCalItem instanceof Ci.calIEvent) {
return Ci.calIEvent;
} else if (aCalItem instanceof Ci.calITodo) {
return Ci.calITodo;
if (aCalItem instanceof Components.interfaces.calIEvent) {
return Components.interfaces.calIEvent;
} else if (aCalItem instanceof Components.interfaces.calITodo) {
return Components.interfaces.calITodo;
}
throw new Error ("_getCalItemType: " +

View File

@ -37,17 +37,14 @@
*
* ***** END LICENSE BLOCK ***** */
const Cc = Components.classes;
const Ci = Components.interfaces;
function makeTableRow(val) {
return "<tr><td>" + val[0] + "</td><td>" + val[1] + "</td></tr>\n";
}
function getLightningStringBundle()
{
var svc = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService);
var svc = Components.classes["@mozilla.org/intl/stringbundle;1"].
getService(Components.interfaces.nsIStringBundleService);
return svc.createBundle("chrome://lightning/locale/lightning.properties");
}
@ -135,8 +132,8 @@ function ltnMimeConverter() { }
ltnMimeConverter.prototype = {
QueryInterface: function QI(aIID) {
if (!aIID.equals(Ci.nsISupports) &&
!aIID.equals(Ci.nsISimpleMimeConverter))
if (!aIID.equals(Components.interfaces.nsISupports) &&
!aIID.equals(Components.interfaces.nsISimpleMimeConverter))
{
throw Components.results.NS_ERROR_NO_INTERFACE;
}
@ -153,32 +150,32 @@ ltnMimeConverter.prototype = {
},
convertToHTML: function lmcCTH(contentType, data) {
var event = Cc["@mozilla.org/calendar/event;1"].
createInstance(Ci.calIEvent);
var event = Components.classes["@mozilla.org/calendar/event;1"].
createInstance(Components.interfaces.calIEvent);
event.icalString = data;
var html = createHtml(event);
try {
var itipItem = Cc["@mozilla.org/calendar/itip-item;1"].
createInstance(Ci.calIItipItem);
var itipItem = Components.classes["@mozilla.org/calendar/itip-item;1"].
createInstance(Components.interfaces.calIItipItem);
itipItem.init(data);
// this.mUri is the message URL that we are processing.
// We use it to get the nsMsgHeaderSink to store the calItipItem.
if (this.mUri) {
var msgUrl = this.mUri.QueryInterface(Ci.nsIMsgMailNewsUrl);
var msgUrl = this.mUri.QueryInterface(Components.interfaces.nsIMsgMailNewsUrl);
var sinkProps = msgUrl.msgWindow.msgHeaderSink.properties;
sinkProps.setPropertyAsInterface("itipItem", itipItem);
// Notify the observer that the itipItem is available
var observer = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
var observer = Components.classes["@mozilla.org/observer-service;1"].
getService(Components.interfaces.nsIObserverService);
observer.notifyObservers(null, "onItipItemCreation", 0);
} else {
// Thunderbird 1.5.x case: We have no choice but to try
// sending the iTIP item directly with the notification
var observer = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
var observer = Components.classes["@mozilla.org/observer-service;1"].
getService(Components.interfaces.nsIObserverService);
observer.notifyObservers(itipItem, "onItipItemCreation", 0);
}
@ -194,7 +191,7 @@ ltnMimeConverter.prototype = {
var myModule = {
registerSelf: function RS(aCompMgr, aFileSpec, aLocation, aType) {
debug("*** Registering Lightning text/calendar handler\n");
var compMgr = aCompMgr.QueryInterface(Ci.nsIComponentRegistrar);
var compMgr = aCompMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
compMgr.registerFactoryLocation(this.myCID,
"Lightning text/calendar handler",
this.myContractID,
@ -203,7 +200,7 @@ var myModule = {
aType);
var catman = Components.classes["@mozilla.org/categorymanager;1"]
.getService(Ci.nsICategoryManager);
.getService(Components.interfaces.nsICategoryManager);
catman.addCategoryEntry("simple-mime-converters", "text/calendar",
this.myContractID, true, true);

View File

@ -142,8 +142,8 @@ InvitationsManager.prototype = {
if (this.mTimer) {
this.mTimer.cancel();
} else {
this.mTimer = Cc["@mozilla.org/timer;1"]
.createInstance(Ci.nsITimer);
this.mTimer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
}
var callback = {
mInvitationsManager: this,
@ -181,7 +181,7 @@ InvitationsManager.prototype = {
var calendars = getCalendarManager().getCalendars({});
for each (var calendar in calendars) {
try {
var wcapCalendar = calendar.QueryInterface(Ci.calIWcapCalendar);
var wcapCalendar = calendar.QueryInterface(Components.interfaces.calIWcapCalendar);
if (!wcapCalendar.isOwnedCalendar) {
continue;
}
@ -190,10 +190,10 @@ InvitationsManager.prototype = {
mInvitationsManager: this,
QueryInterface: function(aIID) {
if (!aIID.equals(Ci.nsISupports) &&
!aIID.equals(Ci.calIOperationListener) &&
!aIID.equals(Ci.calIObserver)) {
throw Cr.NS_ERROR_NO_INTERFACE;
if (!aIID.equals(Components.interfaces.nsISupports) &&
!aIID.equals(Components.interfaces.calIOperationListener) &&
!aIID.equals(Components.interfaces.calIObserver)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
},
@ -205,8 +205,8 @@ InvitationsManager.prototype = {
aId,
aDetail) {
if (aOperationType != Ci.calIOperationListener.GET &&
aOperationType != Ci.calIWcapCalendar.SYNC) {
if (aOperationType != Components.interfaces.calIOperationListener.GET &&
aOperationType != Components.interfaces.calIWcapCalendar.SYNC) {
return;
}
var requestStatus =
@ -233,15 +233,15 @@ InvitationsManager.prototype = {
while ((listener = this.mInvitationsManager.mOperationListeners.shift())) {
listener.onGetResult(
null,
Cr.NS_OK,
Ci.calIItemBase,
Components.results.NS_OK,
Components.interfaces.calIItemBase,
null,
this.mInvitationsManager.mItemList.length,
this.mInvitationsManager.mItemList);
listener.onOperationComplete(
null,
Cr.NS_OK,
Ci.calIOperationListener.GET,
Components.results.NS_OK,
Components.interfaces.calIOperationListener.GET,
null,
null);
}
@ -328,8 +328,8 @@ InvitationsManager.prototype = {
while ((listener = this.mOperationListeners.shift())) {
listener.onOperationComplete(
null,
Cr.NS_ERROR_FAILURE,
Ci.calIOperationListener.GET,
Components.results.NS_ERROR_FAILURE,
Components.interfaces.calIOperationListener.GET,
null,
null );
}
@ -367,7 +367,7 @@ InvitationsManager.prototype = {
aId,
aDetail) {
if (Components.isSuccessCode(aStatus) &&
aOperationType == Ci.calIOperationListener.MODIFY) {
aOperationType == Components.interfaces.calIOperationListener.MODIFY) {
this.mInvitationsManager.deleteItem(aDetail);
this.mInvitationsManager.addItem(aDetail);
}
@ -456,15 +456,15 @@ InvitationsManager.prototype = {
},
getDate: function IM_getDate() {
var date = Cc["@mozilla.org/calendar/datetime;1"]
.createInstance(Ci.calIDateTime);
var date = Components.classes["@mozilla.org/calendar/datetime;1"]
.createInstance(Components.interfaces.calIDateTime);
date.jsDate = new Date();
return date;
},
getStartDate: function IM_getStartDate() {
var date = Cc["@mozilla.org/calendar/datetime;1"]
.createInstance(Ci.calIDateTime);
var date = Components.classes["@mozilla.org/calendar/datetime;1"]
.createInstance(Components.interfaces.calIDateTime);
date.jsDate = new Date();
date = date.getInTimezone(calendarDefaultTimezone());
date.hour = 0;
@ -512,7 +512,7 @@ InvitationsManager.prototype = {
getParticipationStatus: function IM_getParticipationStatus(item) {
try {
var wcapCalendar = item.calendar.QueryInterface(
Ci.calIWcapCalendar);
Components.interfaces.calIWcapCalendar);
var attendee = wcapCalendar.getInvitedAttendee(item);
if (attendee)
return attendee.participationStatus;
@ -523,7 +523,7 @@ InvitationsManager.prototype = {
unregisterCalendar: function IM_unregisterCalendar(calendar) {
try {
var wcapCalendar = calendar.QueryInterface(
Ci.calIWcapCalendar);
Components.interfaces.calIWcapCalendar);
this.mUnregisteredCalendars.push(wcapCalendar);
} catch (e) {}
},

View File

@ -123,7 +123,7 @@ function onLoad() {
}
}
}
var pb2 = Cc["@mozilla.org/preferences-service;1"].
var pb2 = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2);
pb2.addObserver("calendar.", prefObserver, false);
window.addEventListener("unload",

View File

@ -72,7 +72,7 @@ function onLoad() {
if (rules.length > 0) {
// We only handle 1 rule currently
var rule = rules[0];
if (rule instanceof Ci.calIRecurrenceRule) {
if (rule instanceof Components.interfaces.calIRecurrenceRule) {
switch (rule.type) {
case "DAILY":
document.getElementById("period-list").selectedIndex = 0;

View File

@ -95,8 +95,8 @@ function onLoad() {
}
function stringFromReminderObject(reminder) {
var sbs = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService);
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var props =
sbs.createBundle(
@ -147,8 +147,8 @@ function stringFromReminderObject(reminder) {
}
function loadReminders() {
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var prefBranch = prefService.getBranch("calendar.reminder.");
var pref = "length=15;unit=minutes;relation=START;origin=1,length=3;" +
@ -184,8 +184,8 @@ function loadReminders() {
}
function saveReminders(reminderArray) {
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var prefBranch = prefService.getBranch("calendar.reminder.");
var result = "";

View File

@ -93,8 +93,8 @@ function updateTimezone() {
time.timezone = "floating";
datetime.value = time.jsDate;
var icssrv = Cc["@mozilla.org/calendar/ics-service;1"]
.getService(Ci.calIICSService);
var icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"]
.getService(Components.interfaces.calIICSService);
var comp = icssrv.getTimezone(someTZ);
var subComp = comp.getFirstSubcomponent("VTIMEZONE");

View File

@ -167,8 +167,8 @@ function onLoad() {
window.recurrenceInfo = parentItem.recurrenceInfo;
const kSUNBIRD_ID = "{718e30fb-e89b-41dd-9da7-e25a45638b28}";
var appInfo = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULAppInfo);
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
if (appInfo.ID == kSUNBIRD_ID) {
gIsSunbird = true;
@ -181,8 +181,8 @@ function onLoad() {
document.getElementById("sun-calendar-event-dialog").getButton("cancel")
.parentNode.setAttribute("collapsed", "true");
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
gPrefs = prefService.getBranch(null);
@ -224,8 +224,8 @@ function onCommandCancel() {
return true;
}
var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var promptTitle = calGetString("calendar",
isEvent(window.calendarItem) ?
@ -590,8 +590,8 @@ function dateTimeControls2State(aKeepDuration) {
if (warning) {
var callback = function func() {
var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
promptService.alert(
null,
document.title,
@ -687,7 +687,7 @@ function loadRepeat(item) {
}
if (rules.length == 1) {
var rule = rules[0];
if (rule instanceof Ci.calIRecurrenceRule) {
if (rule instanceof Components.interfaces.calIRecurrenceRule) {
switch (rule.type) {
case 'DAILY':
if (rule.interval == 1 && !rule.isFinite) {
@ -1056,12 +1056,12 @@ function openNewEvent() {
}
function openNewMessage() {
var msgComposeService = Cc["@mozilla.org/messengercompose;1"]
.getService(Ci.nsIMsgComposeService);
var msgComposeService = Components.classes["@mozilla.org/messengercompose;1"]
.getService(Components.interfaces.nsIMsgComposeService);
msgComposeService.OpenComposeWindow(null,
null,
Ci.nsIMsgCompType.New,
Ci.nsIMsgCompFormat.Default,
Components.interfaces.nsIMsgCompType.New,
Components.interfaces.nsIMsgCompFormat.Default,
null,
null);
}
@ -1296,8 +1296,8 @@ function updateShowTimeAs() {
}
function editURL() {
var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
if (promptService) {
// ghost in an example...
if (!gURL) {

View File

@ -61,7 +61,7 @@ const xmlHeader = '<?xml version="1.0" encoding="UTF-8"?>\n';
function calDavCalendar() {
this.wrappedJSObject = this;
this.mObservers = new calListenerBag(Ci.calIObserver);
this.mObservers = new calListenerBag(Components.interfaces.calIObserver);
this.unmappedProperties = [];
this.mPendingStartupRequests = [];
this.mUriParams = null;
@ -339,20 +339,20 @@ calDavCalendar.prototype = {
aClosure) {
LOG("fetchEtag: onOperationDetail aStatusCode=" + aStatusCode);
var props = aDetail.QueryInterface(Ci.nsIProperties);
var props = aDetail.QueryInterface(Components.interfaces.nsIProperties);
serverEtag = props.get("DAV: getetag",
Ci.nsISupportsString).toString();
Components.interfaces.nsISupportsString).toString();
}
var webdavSvc = Cc['@mozilla.org/webdav/service;1'].
getService(Ci.nsIWebDAVService);
var webdavSvc = Components.classes['@mozilla.org/webdav/service;1'].
getService(Components.interfaces.nsIWebDAVService);
webdavSvc.getResourceProperties(itemResource, 1, ["DAV: getetag"],
false, listener, this, null);
},
promptOverwrite: function caldavPO(aMethod, aItem, aListener, aOldItem) {
var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"].
getService(Ci.nsIPromptService);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
getService(Components.interfaces.nsIPromptService);
var promptTitle = calGetString("calendar", "itemModifiedOnServerTitle");
var promptMessage = calGetString("calendar", "itemModifiedOnServer");
@ -583,7 +583,7 @@ calDavCalendar.prototype = {
var listener = new WebDavListener();
var thisCalendar = this;
const icssvc = Cc["@mozilla.org/calendar/ics-service;1"].
const icssvc = Components.classes["@mozilla.org/calendar/ics-service;1"].
getService(Components.interfaces.calIICSService);
var modifiedItem = icssvc.createIcalComponent("VCALENDAR");
modifiedItem.prodid = "-//Mozilla Calendar//NONSGML Sunbird//EN";
@ -768,7 +768,7 @@ calDavCalendar.prototype = {
}
var itemType = "VEVENT";
if (aItem instanceof Ci.calITodo) {
if (aItem instanceof Components.interfaces.calITodo) {
itemType = "VTODO";
}
@ -909,8 +909,8 @@ calDavCalendar.prototype = {
}
LOG("item result = \n" + calData);
if (!thisCalendar.mICSService) {
thisCalendar.mICSService = Cc["@mozilla.org/calendar/ics-service;1"].
getService(Ci.calIICSService);
thisCalendar.mICSService = Components.classes["@mozilla.org/calendar/ics-service;1"].
getService(Components.interfaces.calIICSService);
}
var rootComp = thisCalendar.mICSService.parseICS(calData);
@ -941,11 +941,11 @@ calDavCalendar.prototype = {
var item = null;
switch (subComp.componentType) {
case "VEVENT":
item = Cc["@mozilla.org/calendar/event;1"].
item = Components.classes["@mozilla.org/calendar/event;1"].
createInstance(Components.interfaces.calIEvent);
break;
case "VTODO":
item = Cc["@mozilla.org/calendar/todo;1"].
item = Components.classes["@mozilla.org/calendar/todo;1"].
createInstance(Components.interfaces.calITodo);
break;
case "VTIMEZONE":
@ -1018,7 +1018,7 @@ calDavCalendar.prototype = {
// figure out what type of item to return
var iid;
if(aOccurrences) {
iid = Ci.calIItemBase;
iid = Components.interfaces.calIItemBase;
if (item.recurrenceInfo) {
LOG("ITEM has recurrence: " + item + " (" + item.title + ")");
LOG("rangestart: " + aRangeStart.jsDate + " -> " + aRangeEnd.jsDate);
@ -1031,12 +1031,12 @@ calDavCalendar.prototype = {
items = [ item ];
}
rv = Components.results.NS_OK;
} else if (item instanceof Ci.calIEvent) {
iid = Ci.calIEvent;
} else if (item instanceof Components.interfaces.calIEvent) {
iid = Components.interfaces.calIEvent;
rv = Components.results.NS_OK;
items = [ item ];
} else if (item instanceof Ci.calITodo) {
iid = Ci.calITodo;
} else if (item instanceof Components.interfaces.calITodo) {
iid = Components.interfaces.calITodo;
rv = Components.results.NS_OK;
items = [ item ];
} else {
@ -1364,13 +1364,13 @@ calDavCalendar.prototype = {
if ((resourceType == null || resourceType == kDavResourceTypeNone) &&
!thisCalendar.mDisabled) {
thisCalendar.reportDavError(Ci.calIErrors.DAV_NOT_DAV,
thisCalendar.reportDavError(Components.interfaces.calIErrors.DAV_NOT_DAV,
"dav_notDav");
}
if ((resourceType == kDavResourceTypeCollection) &&
!thisCalendar.mDisabled) {
thisCalendar.reportDavError(Ci.calIErrors.DAV_DAV_NOT_CALDAV,
thisCalendar.reportDavError(Components.interfaces.calIErrors.DAV_DAV_NOT_CALDAV,
"dav_davNotCaldav");
}
@ -1393,11 +1393,11 @@ calDavCalendar.prototype = {
function checkDavResourceType_oOD(aStatusCode, aResource,
aOperation, aDetail, aClosure) {
var prop = aDetail.QueryInterface(Ci.nsIProperties);
var prop = aDetail.QueryInterface(Components.interfaces.nsIProperties);
try {
resourceTypeXml = prop.get("DAV: resourcetype",
Ci.nsISupportsString).toString();
Components.interfaces.nsISupportsString).toString();
} catch (ex) {
LOG("error " + e + " fetching resource type");
}
@ -1414,13 +1414,13 @@ calDavCalendar.prototype = {
var calendarDirUri = this.mCalendarUri.clone();
calendarDirUri.spec = this.makeUri('');
var res = new WebDavResource(calendarDirUri);
var webSvc = Cc['@mozilla.org/webdav/service;1'].
getService(Ci.nsIWebDAVService);
var webSvc = Components.classes['@mozilla.org/webdav/service;1'].
getService(Components.interfaces.nsIWebDAVService);
try {
webSvc.getResourceProperties(res, 1, ["DAV: resourcetype"], false,
listener, this, null);
} catch (ex) {
thisCalendar.reportDavError(Ci.calIErrors.DAV_NO_PROPS,
thisCalendar.reportDavError(Components.interfaces.calIErrors.DAV_NO_PROPS,
"dav_noProps");
}
},

View File

@ -93,8 +93,8 @@ function calCompositeCalendar () {
this.wrappedJSObject = this;
this.mCalendars = new Array();
this.mCompositeObservers = new calListenerBag(Ci.calICompositeObserver);
this.mObservers = new calListenerBag(Ci.calIObserver);
this.mCompositeObservers = new calListenerBag(Components.interfaces.calICompositeObserver);
this.mObservers = new calListenerBag(Components.interfaces.calIObserver);
this.mDefaultCalendar = null;
}
@ -300,7 +300,7 @@ calCompositeCalendar.prototype = {
mCompositeObservers: null,
mObservers: null,
addObserver: function (aObserver) {
if (aObserver instanceof Ci.calICompositeObserver) {
if (aObserver instanceof Components.interfaces.calICompositeObserver) {
this.mCompositeObservers.add(aObserver);
}
this.mObservers.add(aObserver);
@ -308,7 +308,7 @@ calCompositeCalendar.prototype = {
// void removeObserver( in calIObserver observer );
removeObserver: function (aObserver) {
if (aObserver instanceof Ci.calICompositeObserver) {
if (aObserver instanceof Components.interfaces.calICompositeObserver) {
this.mCompositeObservers.remove(aObserver);
}
this.mObservers.remove(aObserver);

View File

@ -45,7 +45,7 @@
*/
function calGoogleCalendar() {
this.mObservers = new calListenerBag(Ci.calIObserver);
this.mObservers = new calListenerBag(Components.interfaces.calIObserver);
var calObject = this;
@ -53,13 +53,13 @@ function calGoogleCalendar() {
this.getAttr = function calAttrHelper_get() {
// Note that you need to declare this in here, to avoid cyclic
// getService calls.
var calMgr = Cc["@mozilla.org/calendar/manager;1"].
getService(Ci.calICalendarManager);
var calMgr = Components.classes["@mozilla.org/calendar/manager;1"].
getService(Components.interfaces.calICalendarManager);
return calMgr.getCalendarPref(calObject, aAttr);
};
this.setAttr = function calAttrHelper_set(aValue) {
var calMgr = Cc["@mozilla.org/calendar/manager;1"].
getService(Ci.calICalendarManager);
var calMgr = Components.classes["@mozilla.org/calendar/manager;1"].
getService(Components.interfaces.calICalendarManager);
calMgr.setCalendarPref(calObject, aAttr, aValue);
return aValue;
};
@ -76,9 +76,9 @@ function calGoogleCalendar() {
calGoogleCalendar.prototype = {
QueryInterface: function cGC_QueryInterface(aIID) {
if (!aIID.equals(Ci.nsISupports) &&
!aIID.equals(Ci.calICalendar)) {
throw Cr.NS_ERROR_NO_INTERFACE;
if (!aIID.equals(Components.interfaces.nsISupports) &&
!aIID.equals(Components.interfaces.calICalendar)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
},
@ -179,7 +179,7 @@ calGoogleCalendar.prototype = {
set id(id) {
if (this.mID)
throw Cr.NS_ERROR_ALREADY_INITIALIZED;
throw Components.results.NS_ERROR_ALREADY_INITIALIZED;
return (this.mID = id);
},
@ -215,7 +215,7 @@ calGoogleCalendar.prototype = {
var matches = aUri.path.match(re);
if (!matches) {
throw new Components.Exception(aUri, Cr.NS_ERROR_MALFORMED_URI);
throw new Components.Exception(aUri, Components.results.NS_ERROR_MALFORMED_URI);
}
// Set internal Calendar Name
@ -252,11 +252,11 @@ calGoogleCalendar.prototype = {
// Check if calendar is readonly
if (this.mReadOnly) {
throw new Components.Exception("",
Ci.calIErrors.CAL_IS_READONLY);
Components.interfaces.calIErrors.CAL_IS_READONLY);
}
// Make sure the item is an event
aItem = aItem.QueryInterface(Ci.calIEvent);
aItem = aItem.QueryInterface(Components.interfaces.calIEvent);
// Check if we have a session. If not, then the user has canceled
// the login prompt.
@ -280,7 +280,7 @@ calGoogleCalendar.prototype = {
aListener);
} catch (e) {
LOG("adoptItem failed before request " + aItem.title + "\n:" + e);
if (e.result == Ci.calIErrors.CAL_IS_READONLY) {
if (e.result == Components.interfaces.calIErrors.CAL_IS_READONLY) {
// The calendar is readonly, make sure this is set and
// notify the user. This can come from above or from
// mSession.addItem which checks for the editURI
@ -291,7 +291,7 @@ calGoogleCalendar.prototype = {
if (aListener != null) {
aListener.onOperationComplete(this,
e.result,
Ci.calIOperationListener.ADD,
Components.interfaces.calIOperationListener.ADD,
null,
e.message);
}
@ -310,7 +310,7 @@ calGoogleCalendar.prototype = {
try {
if (this.mReadOnly) {
throw new Components.Exception("",
Ci.calIErrors.CAL_IS_READONLY);
Components.interfaces.calIErrors.CAL_IS_READONLY);
}
// Check if we have a session. If not, then the user has canceled
@ -322,7 +322,7 @@ calGoogleCalendar.prototype = {
// Check if the item is an occurrence. Until bug 362650 is solved,
// there is no support for changing single ocurrences.
if (aOldItem.getProperty("X-GOOGLE-ITEM-IS-OCCURRENCE")) {
throw new Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
throw new Components.Exception("", Components.results.NS_ERROR_NOT_IMPLEMENTED);
}
// Check if enough fields have changed to warrant sending the event
@ -333,8 +333,8 @@ calGoogleCalendar.prototype = {
if (aListener != null) {
aListener.onOperationComplete(this,
Cr.NS_OK,
Ci.calIOperationListener.MODIFY,
Components.results.NS_OK,
Components.interfaces.calIOperationListener.MODIFY,
aNewItem.id,
aNewItem);
}
@ -355,7 +355,7 @@ calGoogleCalendar.prototype = {
LOG("modifyItem failed before request " +
aNewItem.title + "(" + aNewItem.id + "):\n" + e);
if (e.result == Ci.calIErrors.CAL_IS_READONLY) {
if (e.result == Components.interfaces.calIErrors.CAL_IS_READONLY) {
// The calendar is readonly, make sure this is set and
// notify the user. This can come from above or from
// mSession.modifyItem which checks for the editURI
@ -366,7 +366,7 @@ calGoogleCalendar.prototype = {
if (aListener != null) {
aListener.onOperationComplete(this,
e.result,
Ci.calIOperationListener.MODIFY,
Components.interfaces.calIOperationListener.MODIFY,
null,
e.message);
}
@ -379,7 +379,7 @@ calGoogleCalendar.prototype = {
try {
if (this.mReadOnly) {
throw new Components.Exception("",
Ci.calIErrors.CAL_IS_READONLY);
Components.interfaces.calIErrors.CAL_IS_READONLY);
}
// Check if we have a session. If not, then the user has canceled
@ -400,7 +400,7 @@ calGoogleCalendar.prototype = {
LOG("deleteItem failed before request for " +
aItem.title + "(" + aItem.id + "):\n" + e);
if (e.result == Ci.calIErrors.CAL_IS_READONLY) {
if (e.result == Components.interfaces.calIErrors.CAL_IS_READONLY) {
// The calendar is readonly, make sure this is set and
// notify the user. This can come from above or from
// mSession.deleteItem which checks for the editURI
@ -411,7 +411,7 @@ calGoogleCalendar.prototype = {
if (aListener != null) {
aListener.onOperationComplete(this,
e.result,
Ci.calIOperationListener.DELETE,
Components.interfaces.calIOperationListener.DELETE,
null,
e.message);
}
@ -437,7 +437,7 @@ calGoogleCalendar.prototype = {
if (aListener != null) {
aListener.onOperationComplete(this,
e.result,
Ci.calIOperationListener.GET,
Components.interfaces.calIOperationListener.GET,
null,
e.message);
}
@ -458,21 +458,21 @@ calGoogleCalendar.prototype = {
// item base type
var wantEvents = ((aItemFilter &
Ci.calICalendar.ITEM_FILTER_TYPE_EVENT) != 0);
Components.interfaces.calICalendar.ITEM_FILTER_TYPE_EVENT) != 0);
var wantTodos = ((aItemFilter &
Ci.calICalendar.ITEM_FILTER_TYPE_TODO) != 0);
Components.interfaces.calICalendar.ITEM_FILTER_TYPE_TODO) != 0);
// check if events are wanted
if (!wantEvents && !wantTodos) {
// Nothing to do. The onOperationComplete in the catch block
// below will catch this.
throw new Components.Exception("", Cr.NS_OK);
throw new Components.Exception("", Components.results.NS_OK);
} else if (wantTodos && !wantEvents) {
throw new Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
throw new Components.Exception("", Components.results.NS_ERROR_NOT_IMPLEMENTED);
}
// return occurrences?
var itemReturnOccurrences = ((aItemFilter &
Ci.calICalendar.ITEM_FILTER_CLASS_OCCURRENCES) != 0);
Components.interfaces.calICalendar.ITEM_FILTER_CLASS_OCCURRENCES) != 0);
var extradata = { itemfilter: aItemFilter, listener: aListener };
@ -487,7 +487,7 @@ calGoogleCalendar.prototype = {
if (aListener != null) {
aListener.onOperationComplete(this,
e.result,
Ci.calIOperationListener.GET,
Components.interfaces.calIOperationListener.GET,
null, e.message);
}
}
@ -514,14 +514,14 @@ calGoogleCalendar.prototype = {
* Response callback, called by the session object when an item was added
*
* @param aRequest The request object that initiated the request
* @param aStatus The response code. This is a Cr.* code
* @param aStatus The response code. This is a Components.results.* code
* @param aResult In case of an error, this is the error string, otherwise
* an XML representation of the added item.
*/
addItem_response: function cGC_addItem_response(aRequest,
aStatus,
aResult) {
var item = this.general_response(Ci.calIOperationListener.ADD,
var item = this.general_response(Components.interfaces.calIOperationListener.ADD,
aResult,
aStatus,
aRequest.extraData);
@ -536,14 +536,14 @@ calGoogleCalendar.prototype = {
* Response callback, called by the session object when an item was modified
*
* @param aRequest The request object that initiated the request
* @param aStatus The response code. This is a Cr.* Code
* @param aStatus The response code. This is a Components.results.* Code
* @param aResult In case of an error, this is the error string, otherwise
* an XML representation of the modified item
*/
modifyItem_response: function cGC_modifyItem_response(aRequest,
aStatus,
aResult) {
var item = this.general_response(Ci.calIOperationListener.MODIFY,
var item = this.general_response(Components.interfaces.calIOperationListener.MODIFY,
aResult,
aStatus,
aRequest.extraData.listener);
@ -559,7 +559,7 @@ calGoogleCalendar.prototype = {
* Response callback, called by the session object when an Item was deleted
*
* @param aRequest The request object that initiated the request
* @param aStatus The response code. This is a Cr.* Code
* @param aStatus The response code. This is a Components.results.* Code
* @param aResult In case of an error, this is the error string, otherwise
* this may be empty.
*/
@ -572,7 +572,7 @@ calGoogleCalendar.prototype = {
try {
// Check if the call succeeded
if (aStatus != Cr.NS_OK) {
if (aStatus != Components.results.NS_OK) {
throw new Components.Exception(aResult, aStatus);
}
@ -582,8 +582,8 @@ calGoogleCalendar.prototype = {
" successful");
aRequest.extraData.listener.onOperationComplete(this,
Cr.NS_OK,
Ci.calIOperationListener.DELETE,
Components.results.NS_OK,
Components.interfaces.calIOperationListener.DELETE,
aRequest.extraData.item.id,
aRequest.extraData.item);
}
@ -596,7 +596,7 @@ calGoogleCalendar.prototype = {
if (aRequest.extraData.listener) {
aRequest.extraData.listener.onOperationComplete(this,
e.result,
Ci.calIOperationListener.DELETE,
Components.interfaces.calIOperationListener.DELETE,
null,
e.message);
}
@ -609,7 +609,7 @@ calGoogleCalendar.prototype = {
* downloaded.
*
* @param aRequest The request object that initiated the request
* @param aStatus The response code. This is a Cr.* Code
* @param aStatus The response code. This is a Components.results.* Code
* @param aResult In case of an error, this is the error string, otherwise
* an XML representation of the requested item
*/
@ -617,7 +617,7 @@ calGoogleCalendar.prototype = {
aStatus,
aResult) {
// our general response does it all for us. I hope.
this.general_response(Ci.calIOperationListener.GET,
this.general_response(Components.interfaces.calIOperationListener.GET,
aResult,
aStatus,
aRequest.extraData);
@ -629,7 +629,7 @@ calGoogleCalendar.prototype = {
* downloaded.
*
* @param aRequest The request object that initiated the request
* @param aStatus The response code. This is a Cr.* Code
* @param aStatus The response code. This is a Components.results.* Code
* @param aResult In case of an error, this is the error string, otherwise
* an XML feed with the requested items.
*/
@ -639,7 +639,7 @@ calGoogleCalendar.prototype = {
LOG("Recieved response for " + aRequest.uri);
try {
// Check if the call succeeded
if (aStatus != Cr.NS_OK) {
if (aStatus != Components.results.NS_OK) {
throw new Components.Exception(aResult, aStatus);
}
@ -677,7 +677,7 @@ calGoogleCalendar.prototype = {
if (item) {
var itemReturnOccurrences =
((aRequest.extraData.itemfilter &
Ci.calICalendar.ITEM_FILTER_CLASS_OCCURRENCES) != 0);
Components.interfaces.calICalendar.ITEM_FILTER_CLASS_OCCURRENCES) != 0);
var itemIsOccurrence = item.getProperty("X-GOOGLE-ITEM-IS-OCCURRENCE");
@ -690,8 +690,8 @@ calGoogleCalendar.prototype = {
LOGitem(item);
aRequest.extraData.listener.onGetResult(this,
Cr.NS_OK,
Ci.calIEvent,
Components.results.NS_OK,
Components.interfaces.calIEvent,
null,
1,
[item]);
@ -706,8 +706,8 @@ calGoogleCalendar.prototype = {
// Operation Completed successfully.
if (aRequest.extraData.listener != null) {
aRequest.extraData.listener.onOperationComplete(this,
Cr.NS_OK,
Ci.calIOperationListener.GET,
Components.results.NS_OK,
Components.interfaces.calIOperationListener.GET,
null,
null);
}
@ -717,7 +717,7 @@ calGoogleCalendar.prototype = {
if (aRequest.extraData.listener != null) {
aRequest.extraData.listener.onOperationComplete(this,
e.result,
Ci.calIOperationListener.GET,
Components.interfaces.calIOperationListener.GET,
null,
e.message);
}
@ -729,9 +729,9 @@ calGoogleCalendar.prototype = {
* Handles common actions for multiple response types. This does not notify
* observers.
*
* @param aOperation The operation type (Ci.calIOperationListener.*)
* @param aOperation The operation type (Components.interfaces.calIOperationListener.*)
* @param aItemString The string represenation of the item
* @param aStatus The response code. This is a Cr.*
* @param aStatus The response code. This is a Components.results.*
* error code
* @param aListener The listener to be called on completion
* (an instance of calIOperationListener)
@ -747,7 +747,7 @@ calGoogleCalendar.prototype = {
// Check if the call succeeded, if not then aItemString is an error
// message
if (aStatus != Cr.NS_OK) {
if (aStatus != Components.results.NS_OK) {
throw new Components.Exception(aItemString, aStatus);
}
@ -766,10 +766,10 @@ calGoogleCalendar.prototype = {
item.makeImmutable();
// GET operations need to call onGetResult
if (aOperation == Ci.calIOperationListener.GET) {
if (aOperation == Components.interfaces.calIOperationListener.GET) {
aListener.onGetResult(this,
Cr.NS_OK,
Ci.calIEvent,
Components.results.NS_OK,
Components.interfaces.calIEvent,
null,
1,
[item]);
@ -778,7 +778,7 @@ calGoogleCalendar.prototype = {
// All operations need to call onOperationComplete
if (aListener) {
aListener.onOperationComplete(this,
Cr.NS_OK,
Components.results.NS_OK,
aOperation,
(item ? item.id : null),
item);
@ -787,7 +787,7 @@ calGoogleCalendar.prototype = {
} catch (e) {
LOG("General response failed: " + e);
if (e.result == Ci.calIErrors.CAL_IS_READONLY) {
if (e.result == Components.interfaces.calIErrors.CAL_IS_READONLY) {
// The calendar is readonly, make sure this is set and
// notify the user.
this.mReadOnly = true;

View File

@ -69,15 +69,15 @@ calGoogleRequest.prototype = {
DELETE: 5,
QueryInterface: function cGR_QueryInterface(aIID) {
if (!aIID.equals(Ci.nsISupports) &&
!aIID.equals(Ci.nsIStreamLoaderObserver) &&
!aIID.equals(Ci.nsIDocShellTreeItem) &&
!aIID.equals(Ci.nsIInterfaceRequestor) &&
!aIID.equals(Ci.nsIChannelEventSink) &&
!aIID.equals(Ci.nsIProgressEventSink) &&
!aIID.equals(Ci.nsIHttpEventSink) &&
!aIID.equals(Ci.nsIStreamListener)) {
throw Cr.NS_ERROR_NO_INTERFACE;
if (!aIID.equals(Components.interfaces.nsISupports) &&
!aIID.equals(Components.interfaces.nsIStreamLoaderObserver) &&
!aIID.equals(Components.interfaces.nsIDocShellTreeItem) &&
!aIID.equals(Components.interfaces.nsIInterfaceRequestor) &&
!aIID.equals(Components.interfaces.nsIChannelEventSink) &&
!aIID.equals(Components.interfaces.nsIProgressEventSink) &&
!aIID.equals(Components.interfaces.nsIHttpEventSink) &&
!aIID.equals(Components.interfaces.nsIStreamListener)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
},
@ -111,7 +111,7 @@ calGoogleRequest.prototype = {
this.mMethod = "DELETE";
break;
default:
throw new Components.Exception("", Cr.NS_ERROR_ILLEGAL_VALUE);
throw new Components.Exception("", Components.results.NS_ERROR_ILLEGAL_VALUE);
break;
}
this.mType = v;
@ -233,8 +233,8 @@ calGoogleRequest.prototype = {
}
// create the channel
var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var ioService = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
var uristring = this.mUriString;
if (this.mQueryParameters.length > 0) {
@ -245,11 +245,11 @@ calGoogleRequest.prototype = {
this.prepareChannel(channel);
channel = channel.QueryInterface(Ci.nsIHttpChannel);
channel = channel.QueryInterface(Components.interfaces.nsIHttpChannel);
channel.redirectionLimit = 3;
var streamLoader = Cc["@mozilla.org/network/stream-loader;1"].
createInstance(Ci.nsIStreamLoader);
var streamLoader = Components.classes["@mozilla.org/network/stream-loader;1"].
createInstance(Components.interfaces.nsIStreamLoader);
LOG("calGoogleRequest: Requesting " + this.mMethod + " " +
channel.URI.spec);
@ -257,10 +257,10 @@ calGoogleRequest.prototype = {
channel.notificationCallbacks = this;
// Required to be trunk and branch compatible.
if (Ci.nsIStreamLoader.number ==
if (Components.interfaces.nsIStreamLoader.number ==
"{31d37360-8e5a-11d3-93ad-00104ba0fd40}") {
streamLoader.init(channel, this, this);
} else if (Ci.nsIStreamLoader.number ==
} else if (Components.interfaces.nsIStreamLoader.number ==
"{8ea7e890-8211-11d9-8bde-f66bad1e3f3a}") {
streamLoader.init(this);
channel.asyncOpen(streamLoader, this);
@ -295,7 +295,7 @@ calGoogleRequest.prototype = {
succeed: function cGR_succeed(aResult) {
// Succeeding is nothing more than failing with the result code set to
// NS_OK.
this.fail(Cr.NS_OK, aResult);
this.fail(Components.results.NS_OK, aResult);
},
/**
@ -307,20 +307,20 @@ calGoogleRequest.prototype = {
prepareChannel: function cGR_prepareChannel(aChannel) {
// No caching
aChannel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
aChannel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;
// Set upload Data
if (this.mUploadData) {
var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
createInstance(Ci.nsIScriptableUnicodeConverter);
var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].
createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
var stream = converter.convertToInputStream(this.mUploadData);
aChannel = aChannel.QueryInterface(Ci.nsIUploadChannel);
aChannel = aChannel.QueryInterface(Components.interfaces.nsIUploadChannel);
aChannel.setUploadStream(stream, this.mUploadContent, -1);
}
aChannel = aChannel.QueryInterface(Ci.nsIHttpChannel);
aChannel = aChannel.QueryInterface(Components.interfaces.nsIHttpChannel);
// Depending on the preference, we will use X-HTTP-Method-Override to
// get around some proxies. This will default to true.
@ -359,7 +359,7 @@ calGoogleRequest.prototype = {
try {
return this.QueryInterface(aIID);
} catch (e) {
throw Cr.NS_NOINTERFACE;
throw Components.results.NS_NOINTERFACE;
}
},
@ -401,23 +401,23 @@ calGoogleRequest.prototype = {
aStatus,
aResultLength,
aResult) {
if (!aResult || aStatus != Cr.NS_OK) {
if (!aResult || aStatus != Components.results.NS_OK) {
this.fail(aStatus, aResult);
return;
}
var httpChannel = aLoader.request.QueryInterface(Ci.nsIHttpChannel);
var uploadChannel = aLoader.request.QueryInterface(Ci.nsIUploadChannel);
var httpChannel = aLoader.request.QueryInterface(Components.interfaces.nsIHttpChannel);
var uploadChannel = aLoader.request.QueryInterface(Components.interfaces.nsIUploadChannel);
// Convert the stream, falling back to utf-8 in case its not given.
var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
createInstance(Ci.nsIScriptableUnicodeConverter);
var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].
createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
converter.charset = httpChannel.contentCharset || "UTF-8";
var result;
try {
result = converter.convertFromByteArray(aResult, aResultLength);
} catch (e) {
this.fail(Cr.NS_ERROR_FAILURE,
this.fail(Components.results.NS_ERROR_FAILURE,
"Could not convert bytestream to Unicode: " + e);
return;
}
@ -443,7 +443,7 @@ calGoogleRequest.prototype = {
this.type == this.ADD) {
// Encountering this error on a write request means the
// calendar is readonly
this.fail(Ci.calIErrors.CAL_IS_READONLY, result);
this.fail(Components.interfaces.calIErrors.CAL_IS_READONLY, result);
} else if (this.type == this.LOGIN) {
// If this was a login request itself, then fail it.
// That will take care of logging in again
@ -483,7 +483,7 @@ calGoogleRequest.prototype = {
httpChannel.responseStatusText + " Body: " +
result;
this.fail(Cr.NS_ERROR_FAILURE, error);
this.fail(Components.results.NS_ERROR_FAILURE, error);
break;
}
}

View File

@ -64,9 +64,9 @@ function calGoogleSession(aUsername) {
calGoogleSession.prototype = {
QueryInterface: function cGS_QueryInterface(aIID) {
if (!aIID.equals(Ci.nsIInterfaceRequestor) &&
!aIID.equals(Ci.nsISupports)) {
throw Cr.NS_ERROR_NO_INTERFACE;
if (!aIID.equals(Components.interfaces.nsIInterfaceRequestor) &&
!aIID.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
},
@ -264,7 +264,7 @@ calGoogleSession.prototype = {
// that belong to that calendar and are in the queue. This
// will also include the request that initiated the login
// request, so that dosent need to be handled extra.
this.failQueue(Cr.NS_ERROR_NOT_AVAILABLE,
this.failQueue(Components.results.NS_ERROR_NOT_AVAILABLE,
aRequest.calendar);
// Unset the session in the requesting calendar, if the user
@ -285,8 +285,8 @@ calGoogleSession.prototype = {
this.mLoggingIn = true;
// Get Version info
var appInfo = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsIXULAppInfo);
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].
getService(Components.interfaces.nsIXULAppInfo);
var source = appInfo.vendor + "-" +
appInfo.name + "-" +
appInfo.version;
@ -339,7 +339,7 @@ calGoogleSession.prototype = {
// logins to Google. Hence mLoggingIn is set three times in the course
// of this function
if (!aResult || aStatus != Cr.NS_OK) {
if (!aResult || aStatus != Components.results.NS_OK) {
this.mLoggingIn = false;
LOG("Login failed. Status: " + aStatus);

View File

@ -88,8 +88,8 @@ function getCalendarPref(aCalendar, aPrefName) {
* @return The formatted string
*/
function getFormattedString(aBundleName, aStringName, aFormatArgs, aComponent) {
var bundlesvc = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService);
var bundlesvc = Components.classes["@mozilla.org/intl/stringbundle;1"].
getService(Components.interfaces.nsIStringBundleService);
var component = aComponent || "gdata-provider";
var bundle = bundlesvc.createBundle("chrome://" + component + "/locale/" +
@ -155,11 +155,11 @@ function getCalendarCredentials(aCalendarName,
if (typeof aUsername != "object" ||
typeof aPassword != "object" ||
typeof aSavePassword != "object") {
throw new Components.Exception("", Cr.NS_ERROR_XPC_NEED_OUT_OBJECT);
throw new Components.Exception("", Components.results.NS_ERROR_XPC_NEED_OUT_OBJECT);
}
var watcher = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
var watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].
getService(Components.interfaces.nsIWindowWatcher);
var prompter = watcher.getNewPrompter(null);
// Retrieve strings from properties file
@ -215,8 +215,8 @@ function getMozillaTimezone(aICALTimezone) {
// For now we need to go through all timezones and see which timezone
// ends with aICALTimezone.
var icsSvc = Cc["@mozilla.org/calendar/ics-service;1"].
getService(Ci.calIICSService);
var icsSvc = Components.classes["@mozilla.org/calendar/ics-service;1"].
getService(Components.interfaces.calIICSService);
// Enumerate timezones, set them, check their offset
var enumerator = icsSvc.timezoneIds;
@ -297,8 +297,8 @@ function fromRFC3339(aStr, aTimezone) {
if (dateTime.timezoneOffset != offset_in_s) {
// TODO A patch to Bug 363191 should make this more efficient.
var icsSvc = Cc["@mozilla.org/calendar/ics-service;1"].
getService(Ci.calIICSService);
var icsSvc = Components.classes["@mozilla.org/calendar/ics-service;1"].
getService(Components.interfaces.calIICSService);
// Enumerate timezones, set them, check their offset
var enumerator = icsSvc.timezoneIds;
@ -376,17 +376,17 @@ function passwordManagerSave(aUsername, aPassword) {
ASSERT(aUsername);
ASSERT(aPassword);
if (Cc["@mozilla.org/passwordmanager;1"]) {
var passwordManager = Cc["@mozilla.org/passwordmanager;1"].
getService(Ci.nsIPasswordManager);
if (Components.classes["@mozilla.org/passwordmanager;1"]) {
var passwordManager = Components.classes["@mozilla.org/passwordmanager;1"].
getService(Components.interfaces.nsIPasswordManager);
// The realm and the username are the same, since we only save
// credentials per session, which only needs a user and a password
passwordManager.addUser(aUsername, aUsername, aPassword);
} else if (Cc["@mozilla.org/login-manager;1"]) {
} else if (Components.classes["@mozilla.org/login-manager;1"]) {
// Trunk uses LoginManager
var loginManager = Cc["@mozilla.org/login-manager;1"].
getService(Ci.nsILoginManager);
var loginManager = Components.classes["@mozilla.org/login-manager;1"].
getService(Components.interfaces.nsILoginManager);
var hostname = "chrome://gdata-provider/" +
encodeURIComponent(aUsername);
var logins = loginManager.findLogins({},
@ -398,8 +398,8 @@ function passwordManagerSave(aUsername, aPassword) {
loginInfo.password = aPassword;
loginManager.modifyLogin(logins[0], loginInfo);
} else {
var loginInfo = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
var loginInfo = Components.classes["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Components.interfaces.nsILoginInfo);
loginInfo.init(hostname,
null,
"Google Calendar",
@ -425,18 +425,18 @@ function passwordManagerGet(aUsername, aPassword) {
ASSERT(aUsername);
if (typeof aPassword != "object") {
throw new Components.Exception("", Cr.NS_ERROR_XPC_NEED_OUT_OBJECT);
throw new Components.Exception("", Components.results.NS_ERROR_XPC_NEED_OUT_OBJECT);
}
if (Cc["@mozilla.org/passwordmanager;1"]) {
if (Components.classes["@mozilla.org/passwordmanager;1"]) {
// Branch uses PasswordManager
var passwordManager = Cc["@mozilla.org/passwordmanager;1"].
getService(Ci.nsIPasswordManager);
var passwordManager = Components.classes["@mozilla.org/passwordmanager;1"].
getService(Components.interfaces.nsIPasswordManager);
var enumerator = passwordManager.enumerator;
while (enumerator.hasMoreElements()) {
var entry = enumerator.getNext().QueryInterface(Ci.nsIPassword);
var entry = enumerator.getNext().QueryInterface(Components.interfaces.nsIPassword);
// We only care about the "host" field, since the username field is the
// same for our purposes.
@ -445,10 +445,10 @@ function passwordManagerGet(aUsername, aPassword) {
return true;
}
}
} else if (Cc["@mozilla.org/login-manager;1"]) {
} else if (Components.classes["@mozilla.org/login-manager;1"]) {
// Trunk uses LoginManager
var loginManager = Cc["@mozilla.org/login-manager;1"].
getService(Ci.nsILoginManager);
var loginManager = Components.classes["@mozilla.org/login-manager;1"].
getService(Components.interfaces.nsILoginManager);
if (!loginManager.getLoginSavingEnabled(aUsername)) {
return false;
}
@ -481,10 +481,10 @@ function passwordManagerGet(aUsername, aPassword) {
*/
function passwordManagerRemove(aUsername) {
if (Cc["@mozilla.org/passwordmanager;1"]) {
if (Components.classes["@mozilla.org/passwordmanager;1"]) {
// Branch uses PasswordManager
var passwordManager = Cc["@mozilla.org/passwordmanager;1"].
getService(Ci.nsIPasswordManager);
var passwordManager = Components.classes["@mozilla.org/passwordmanager;1"].
getService(Components.interfaces.nsIPasswordManager);
// Remove from Password Manager. Again, the host and username is always the
// same for our purposes.
@ -493,10 +493,10 @@ function passwordManagerRemove(aUsername) {
} catch (e) {
return false;
}
} else if (Cc["@mozilla.org/login-manager;1"]) {
} else if (Components.classes["@mozilla.org/login-manager;1"]) {
// Trunk uses LoginManager
var loginManager = Cc["@mozilla.org/login-manager;1"].
getService(Ci.nsILoginManager);
var loginManager = Components.classes["@mozilla.org/login-manager;1"].
getService(Components.interfaces.nsILoginManager);
var hostname = "chrome://gdata-provider/" +
encodeURIComponent(aUsername);
var logins = loginManager.findLogins({},
@ -526,7 +526,7 @@ function passwordManagerRemove(aUsername) {
function ItemToXMLEntry(aItem, aAuthorEmail, aAuthorName) {
if (!aItem) {
throw new Components.Exception("", Cr.NS_ERROR_INVALID_ARG);
throw new Components.Exception("", Components.results.NS_ERROR_INVALID_ARG);
}
const kEVENT_SCHEMA = "http://schemas.google.com/g/2005#event.";
@ -567,7 +567,7 @@ function ItemToXMLEntry(aItem, aAuthorEmail, aAuthorName) {
// user didn't choose to delete the event, we will protect him and not
// allow this status to be set
throw new Components.Exception("",
Cr.NS_ERROR_LOSS_OF_SIGNIFICANT_DATA);
Components.results.NS_ERROR_LOSS_OF_SIGNIFICANT_DATA);
} else if (status == "NONE") {
status = "CONFIRMED";
}
@ -651,7 +651,7 @@ function ItemToXMLEntry(aItem, aAuthorEmail, aAuthorName) {
var gdReminder = <gd:reminder xmlns:gd={gd}/>;
var alarmOffset = aItem.alarmOffset.clone();
if (aItem.alarmRelated == Ci.calIItemBase.ALARM_RELATED_END) {
if (aItem.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_END) {
// Google always uses an alarm offset related to the start time
alarmOffset.addDuration(duration);
}
@ -812,7 +812,7 @@ function getItemEditURI(aItem) {
var edituri = aItem.getProperty("X-GOOGLE-EDITURL");
if (!edituri) {
// If the item has no edit uri, it is read-only
throw new Components.Exception("", Ci.calIErrors.CAL_IS_READONLY);
throw new Components.Exception("", Components.interfaces.calIErrors.CAL_IS_READONLY);
}
return edituri;
}
@ -829,7 +829,7 @@ function getItemEditURI(aItem) {
function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) {
if (aXMLEntry == null) {
throw new Components.Exception("", Cr.NS_ERROR_DOM_SYNTAX_ERR);
throw new Components.Exception("", Components.results.NS_ERROR_DOM_SYNTAX_ERR);
}
var gCal = new Namespace("gCal", "http://schemas.google.com/gCal/2005");
@ -837,8 +837,8 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) {
var atom = new Namespace("", "http://www.w3.org/2005/Atom");
default xml namespace = atom;
var item = Cc["@mozilla.org/calendar/event;1"].
createInstance(Ci.calIEvent);
var item = Components.classes["@mozilla.org/calendar/event;1"].
createInstance(Components.interfaces.calIEvent);
try {
// id
@ -908,7 +908,7 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) {
}
// Google's alarms are always related to the start
item.alarmRelated = Ci.calIItemBase.ALARM_RELATED_START;
item.alarmRelated = Components.interfaces.calIItemBase.ALARM_RELATED_START;
var lastAlarm;
var otherAlarms = [];
@ -916,8 +916,8 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) {
// We are only intrested in "alert" reminders. Other types
// include sms and email alerts, but thats not the point here.
if (reminder.@method == "alert") {
var alarmOffset = Cc["@mozilla.org/calendar/duration;1"]
.createInstance(Ci.calIDuration);
var alarmOffset = Components.classes["@mozilla.org/calendar/duration;1"]
.createInstance(Components.interfaces.calIDuration);
if (reminder.@absoluteTime.toString()) {
var absolute = fromRFC3339(reminder.@absoluteTime,
@ -997,8 +997,8 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) {
// Iterate all attendee tags.
for each (var who in aXMLEntry.gd::who) {
var attendee = Cc["@mozilla.org/calendar/attendee;1"]
.createInstance(Ci.calIAttendee);
var attendee = Components.classes["@mozilla.org/calendar/attendee;1"]
.createInstance(Components.interfaces.calIAttendee);
var rel = who.@rel.substring(33);
var type = who.gd::attendeeType.@value.substring(33);
@ -1049,8 +1049,8 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) {
re = new RegExp("^DURATION:(.*)$");
matches = re.exec(line);
if (matches) {
var offset = Cc["@mozilla.org/calendar/duration;1"].
createInstance(Ci.calIDuration);
var offset = Components.classes["@mozilla.org/calendar/duration;1"].
createInstance(Components.interfaces.calIDuration);
offset.icalString = matches[1];
endDate.addDuration(offset);

View File

@ -762,7 +762,7 @@ calICSCalendar.prototype = {
function calICSObserver(aCalendar) {
this.mCalendar = aCalendar;
this.mObservers = new calListenerBag(Ci.calIObserver);
this.mObservers = new calListenerBag(Components.interfaces.calIObserver);
}
calICSObserver.prototype = {

View File

@ -75,7 +75,7 @@ calMemoryCalendar.prototype = {
},
initMemoryCalendar: function() {
this.mObservers = new calListenerBag(Ci.calIObserver);
this.mObservers = new calListenerBag(Components.interfaces.calIObserver);
this.mItems = { };
},
@ -359,10 +359,10 @@ calMemoryCalendar.prototype = {
var item = this.mItems[aId];
var iid = null;
if (item instanceof Ci.calIEvent) {
iid = Ci.calIEvent;
} else if (item instanceof Ci.calITodo) {
iid = Ci.calITodo;
if (item instanceof Components.interfaces.calIEvent) {
iid = Components.interfaces.calIEvent;
} else if (item instanceof Components.interfaces.calITodo) {
iid = Components.interfaces.calITodo;
} else {
aListener.onOperationComplete (this.calendarToReturn,
Components.results.NS_ERROR_FAILURE,
@ -432,14 +432,14 @@ calMemoryCalendar.prototype = {
// figure out the return interface type
var typeIID = null;
if (itemReturnOccurrences) {
typeIID = Ci.calIItemBase;
typeIID = Components.interfaces.calIItemBase;
} else {
if (wantEvents && wantTodos) {
typeIID = Ci.calIItemBase;
typeIID = Components.interfaces.calIItemBase;
} else if (wantEvents) {
typeIID = Ci.calIEvent;
typeIID = Components.interfaces.calIEvent;
} else if (wantTodos) {
typeIID = Ci.calITodo;
typeIID = Components.interfaces.calITodo;
}
}
@ -454,15 +454,15 @@ calMemoryCalendar.prototype = {
var itemEndTime = 0;
var tmpitem = item;
if (wantEvents && (item instanceof Ci.calIEvent)) {
tmpitem = item.QueryInterface(Ci.calIEvent);
if (wantEvents && (item instanceof Components.interfaces.calIEvent)) {
tmpitem = item.QueryInterface(Components.interfaces.calIEvent);
itemStartTime = (item.startDate
? item.startDate.nativeTime
: START_OF_TIME);
itemEndTime = (item.endDate
? item.endDate.nativeTime
: END_OF_TIME);
} else if (wantTodos && (item instanceof Ci.calITodo)) {
} else if (wantTodos && (item instanceof Components.interfaces.calITodo)) {
// if it's a todo, also filter based on completeness
if (item.isCompleted && !itemCompletedFilter)
continue;

View File

@ -197,7 +197,7 @@ function newDateTime(aNativeTime, aTimezone) {
function calStorageCalendar() {
this.wrappedJSObject = this;
this.mObservers = new calListenerBag(Ci.calIObserver);
this.mObservers = new calListenerBag(Components.interfaces.calIObserver);
this.mItemCache = new Array();
}
@ -537,10 +537,10 @@ calStorageCalendar.prototype = {
}
var item_iid = null;
if (item instanceof Ci.calIEvent)
item_iid = Ci.calIEvent;
else if (item instanceof Ci.calITodo)
item_iid = Ci.calITodo;
if (item instanceof Components.interfaces.calIEvent)
item_iid = Components.interfaces.calIEvent;
else if (item instanceof Components.interfaces.calITodo)
item_iid = Components.interfaces.calITodo;
else {
aListener.onOperationComplete (this,
Components.results.NS_ERROR_FAILURE,
@ -726,7 +726,7 @@ calStorageCalendar.prototype = {
// process the events
for each (var evitem in resultItems) {
count += handleResultItem(evitem.item, evitem.flags, Ci.calIEvent);
count += handleResultItem(evitem.item, evitem.flags, Components.interfaces.calIEvent);
if (checkCount())
return;
}
@ -786,7 +786,7 @@ calStorageCalendar.prototype = {
var itemIsCompleted = false;
if (item.todo_complete == 100 ||
item.todo_completed != null ||
item.ical_status == Ci.calITodo.CAL_TODO_STATUS_COMPLETED)
item.ical_status == Components.interfaces.calITodo.CAL_TODO_STATUS_COMPLETED)
itemIsCompleted = true;
if (!itemIsCompleted && !wantNotCompletedItems)
@ -801,7 +801,7 @@ calStorageCalendar.prototype = {
// process the todos
for each (var todoitem in resultItems) {
count += handleResultItem(todoitem.item, todoitem.flags, Ci.calITodo);
count += handleResultItem(todoitem.item, todoitem.flags, Components.interfaces.calITodo);
if (checkCount())
return;
}
@ -1704,7 +1704,7 @@ calStorageCalendar.prototype = {
var exceptions = [];
if (item instanceof Ci.calIEvent) {
if (item instanceof Components.interfaces.calIEvent) {
this.mSelectEventExceptions.params.id = item.id;
while (this.mSelectEventExceptions.step()) {
var row = this.mSelectEventExceptions.row;
@ -1713,7 +1713,7 @@ calStorageCalendar.prototype = {
exceptions.push({item: exc, flags: flags.value});
}
this.mSelectEventExceptions.reset();
} else if (item instanceof Ci.calITodo) {
} else if (item instanceof Components.interfaces.calITodo) {
this.mSelectTodoExceptions.params.id = item.id;
while (this.mSelectTodoExceptions.step()) {
var row = this.mSelectTodoExceptions.row;
@ -1830,9 +1830,9 @@ calStorageCalendar.prototype = {
deleteOldItem: function (item, olditem) {
if (olditem) {
var oldItemDeleteStmt;
if (olditem instanceof Ci.calIEvent)
if (olditem instanceof Components.interfaces.calIEvent)
oldItemDeleteStmt = this.mDeleteEvent;
else if (olditem instanceof Ci.calITodo)
else if (olditem instanceof Components.interfaces.calITodo)
oldItemDeleteStmt = this.mDeleteTodo;
oldItemDeleteStmt.params.id = olditem.id;
@ -1864,9 +1864,9 @@ calStorageCalendar.prototype = {
flags |= this.writeProperties(item, olditem);
flags |= this.writeAttachments(item, olditem);
if (item instanceof Ci.calIEvent)
if (item instanceof Components.interfaces.calIEvent)
this.writeEvent(item, olditem, flags);
else if (item instanceof Ci.calITodo)
else if (item instanceof Components.interfaces.calITodo)
this.writeTodo(item, olditem, flags);
else
throw Components.results.NS_ERROR_UNEXPECTED;
@ -1879,10 +1879,10 @@ calStorageCalendar.prototype = {
var tmp;
tmp = item.getUnproxiedProperty("DTSTART");
//if (tmp instanceof Ci.calIDateTime) {}
//if (tmp instanceof Components.interfaces.calIDateTime) {}
this.setDateParamHelper(ip, "event_start", tmp);
tmp = item.getUnproxiedProperty("DTEND");
//if (tmp instanceof Ci.calIDateTime) {}
//if (tmp instanceof Components.interfaces.calIDateTime) {}
this.setDateParamHelper(ip, "event_end", tmp);
if (item.startDate.isDate)
@ -1979,7 +1979,7 @@ calStorageCalendar.prototype = {
pp.key = prop.name;
var pval = prop.value;
if (pval instanceof Ci.calIDateTime) {
if (pval instanceof Components.interfaces.calIDateTime) {
pp.value = pval.nativeTime;
} else {
pp.value = pval;