Bug #379070 ---> nsIMessenger string API cleanup.

patch by Joerg Bornemann <jobor@gmx.de>

sr=mscott
This commit is contained in:
scott%scott-macgregor.org 2007-06-26 23:58:33 +00:00
Родитель 520d94fa3c
Коммит 0d4059c32b
22 изменённых файлов: 439 добавлений и 475 удалений

Просмотреть файл

@ -1070,12 +1070,12 @@ function GetSelectTrashUri(folder)
function Undo()
{
messenger.Undo(msgWindow);
messenger.undo(msgWindow);
}
function Redo()
{
messenger.Redo(msgWindow);
messenger.redo(msgWindow);
}
function getSearchTermString(searchTerms)

Просмотреть файл

@ -551,10 +551,10 @@ var DefaultController =
SwitchView(command);
break;
case "cmd_undo":
messenger.Undo(msgWindow);
messenger.undo(msgWindow);
break;
case "cmd_redo":
messenger.Redo(msgWindow);
messenger.redo(msgWindow);
break;
case "cmd_expandAllThreads":
gDBView.doCommand(nsMsgViewCommandType.expandAll);
@ -931,7 +931,7 @@ function MsgDeleteFolder()
if (gCurrentVirtualFolderUri == folderResource.Value)
gCurrentVirtualFolderUri = null;
parentResource = selectedFolder.parent.QueryInterface(Components.interfaces.nsIRDFResource);
messenger.DeleteFolders(GetFolderDatasource(), parentResource, folderResource);
messenger.deleteFolders(GetFolderDatasource(), parentResource, folderResource);
continue;
}
var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + selectedFolder.server.type].getService(Components.interfaces.nsIMsgProtocolInfo);
@ -958,7 +958,7 @@ function MsgDeleteFolder()
else
{
parentResource = selectedFolder.parent.QueryInterface(Components.interfaces.nsIRDFResource);
messenger.DeleteFolders(GetFolderDatasource(), parentResource, folderResource);
messenger.deleteFolders(GetFolderDatasource(), parentResource, folderResource);
}
}
}

Просмотреть файл

@ -237,7 +237,7 @@ function ComposeMessage(type, format, folder, messageArray)
return;
}
messenger.SetWindow(window, msgWindow);
messenger.setWindow(window, msgWindow);
var object = null;
@ -599,7 +599,7 @@ function performActionsOnJunkMsgs(aFolder, aMsgHdrs)
{
var copyService = Components.classes["@mozilla.org/messenger/messagecopyservice;1"].
getService(Components.interfaces.nsIMsgCopyService);
copyService.CopyMessages(aFolder, aMsgHdrs, actionParams.junkTargetFolder, true /* isMove */, null,
copyService.copyMessages(aFolder, aMsgHdrs, actionParams.junkTargetFolder, true /* isMove */, null,
msgWindow, true /* allow undo */);
}
}

Просмотреть файл

@ -106,7 +106,7 @@ function OnMailWindowUnload()
}
mailSession.RemoveMsgWindow(msgWindow);
messenger.SetWindow(null, null);
messenger.setWindow(null, null);
var msgDS;
var viewDataSources = [accountManagerDataSource, folderDataSource,

Просмотреть файл

@ -2131,13 +2131,13 @@ function SetupUndoRedoCommand(command)
if (command == "cmd_undo")
{
canUndoOrRedo = messenger.CanUndo();
txnType = messenger.GetUndoTransactionType();
canUndoOrRedo = messenger.canUndo();
txnType = messenger.getUndoTransactionType();
}
else
{
canUndoOrRedo = messenger.CanRedo();
txnType = messenger.GetRedoTransactionType();
canUndoOrRedo = messenger.canRedo();
txnType = messenger.getRedoTransactionType();
}
if (canUndoOrRedo)

Просмотреть файл

@ -264,7 +264,7 @@ function delayedOnLoadMessageWindow()
InitMsgWindow();
messenger.SetWindow(window, msgWindow);
messenger.setWindow(window, msgWindow);
InitializeDataSources();
// FIX ME - later we will be able to use onload from the overlay
OnLoadMsgHeaderPane();
@ -973,10 +973,10 @@ var MessageWindowController =
MsgGetMessage();
break;
case "cmd_undo":
messenger.Undo(msgWindow);
messenger.undo(msgWindow);
break;
case "cmd_redo":
messenger.Redo(msgWindow);
messenger.redo(msgWindow);
break;
case "cmd_getMsgsForAuthAccounts":
MsgGetMessagesForAllAuthenticatedAccounts();

Просмотреть файл

@ -784,8 +784,8 @@ function UpdateMailPaneConfig(aMsgWindowInitialized) {
if (aMsgWindowInitialized && msgPaneReRooted)
{
messenger.SetWindow(null, null);
messenger.SetWindow(window, msgWindow);
messenger.setWindow(null, null);
messenger.setWindow(window, msgWindow);
MsgReload();
}
@ -851,7 +851,7 @@ function delayedOnLoadMessenger()
verifyAccounts(null);
InitMsgWindow();
messenger.SetWindow(window, msgWindow);
messenger.setWindow(window, msgWindow);
InitializeDataSources();
InitPanes();

Просмотреть файл

@ -110,7 +110,7 @@ function RenameFolder(name,uri)
try
{
messenger.RenameFolder(GetFolderDatasource(), selectedFolder, name);
messenger.renameFolder(GetFolderDatasource(), selectedFolder, name);
}
catch(e)
{
@ -140,11 +140,11 @@ function MsgEmptyTrash()
{
var folderResource = GetFolderResource(folderTree, startIndex.value);
try {
messenger.EmptyTrash(GetFolderDatasource(), folderResource);
messenger.emptyTrash(GetFolderDatasource(), folderResource);
}
catch(e)
{
dump ("Exception : messenger.EmptyTrash \n");
dump ("Exception : messenger.emptyTrash \n");
}
}
}
@ -181,7 +181,7 @@ function MsgCompactFolder(isAll)
}
try
{
messenger.CompactFolder(GetFolderDatasource(), resource, isAll);
messenger.compactFolder(GetFolderDatasource(), resource, isAll);
}
catch(ex)
{

Просмотреть файл

@ -48,7 +48,7 @@ interface nsIDOMWindowInternal;
interface nsITransactionManager;
interface nsIMsgMessageService;
[scriptable, uuid(0F6D0A77-AED8-4658-BEDD-8753A008F0D8)]
[scriptable, uuid(3CFFB7E3-D7C6-4335-8941-7B94BBAFB607)]
interface nsIMessenger : nsISupports {
const long eUnknown = 0;
@ -56,54 +56,54 @@ interface nsIMessenger : nsISupports {
const long eMoveMsg = 2;
const long eCopyMsg = 3;
void setDisplayCharset(in string aCharset);
void setDisplayCharset(in ACString aCharset);
readonly attribute nsITransactionManager transactionManager;
void SetWindow(in nsIDOMWindowInternal ptr, in nsIMsgWindow msgWindow);
void setWindow(in nsIDOMWindowInternal ptr, in nsIMsgWindow msgWindow);
void DeleteFolders(in nsIRDFCompositeDataSource db,
void deleteFolders(in nsIRDFCompositeDataSource db,
in nsIRDFResource parentFolder,
in nsIRDFResource folder);
void CopyMessages(in nsIRDFCompositeDataSource database,
void copyMessages(in nsIRDFCompositeDataSource database,
in nsIRDFResource srcResource,
in nsIRDFResource dstResource,
in nsISupportsArray messages,
in boolean isMove);
void CopyFolders(in nsIRDFCompositeDataSource database,
void copyFolders(in nsIRDFCompositeDataSource database,
in nsIRDFResource dstResource,
in nsISupportsArray folders,
in boolean isMoveFolder);
void OpenURL(in string aURL);
void openURL(in ACString aURL);
/** load a custom message by url, e.g load a attachment as a email
*/
void loadURL(in nsIDOMWindowInternal ptr, in string aURL);
void loadURL(in nsIDOMWindowInternal ptr, in ACString aURL);
void launchExternalURL(in string aURL);
void launchExternalURL(in ACString aURL);
void RenameFolder(in nsIRDFCompositeDataSource db,
in nsIRDFResource folder, in wstring name);
void CompactFolder(in nsIRDFCompositeDataSource db,
void renameFolder(in nsIRDFCompositeDataSource db,
in nsIRDFResource folder, in AString name);
void compactFolder(in nsIRDFCompositeDataSource db,
in nsIRDFResource folder,
in boolean forAll);
void EmptyTrash(in nsIRDFCompositeDataSource db,
void emptyTrash(in nsIRDFCompositeDataSource db,
in nsIRDFResource folder);
boolean CanUndo();
boolean CanRedo();
unsigned long GetUndoTransactionType();
unsigned long GetRedoTransactionType();
void Undo(in nsIMsgWindow msgWindow);
void Redo(in nsIMsgWindow msgWindow);
boolean canUndo();
boolean canRedo();
unsigned long getUndoTransactionType();
unsigned long getRedoTransactionType();
void undo(in nsIMsgWindow msgWindow);
void redo(in nsIMsgWindow msgWindow);
void sendUnsentMessages(in nsIMsgIdentity aIdentity, in nsIMsgWindow aMsgWindow);
void SetDocumentCharset(in string characterSet);
void saveAs(in string aURI, in boolean aAsFile, in nsIMsgIdentity aIdentity, in wstring aMsgFilename);
void openAttachment(in string contentTpe, in string url, in string displayName, in string messageUri, in boolean isExternalAttachment);
void saveAttachment(in string contentTpe, in string url, in string displayName, in string messageUri, in boolean isExternalAttachment);
void setDocumentCharset(in ACString characterSet);
void saveAs(in ACString aURI, in boolean aAsFile, in nsIMsgIdentity aIdentity, in AString aMsgFilename);
void openAttachment(in ACString contentTpe, in ACString url, in ACString displayName, in ACString messageUri, in boolean isExternalAttachment);
void saveAttachment(in ACString contentTpe, in ACString url, in ACString displayName, in ACString messageUri, in boolean isExternalAttachment);
void saveAllAttachments(in unsigned long count, [array, size_is(count)] in string contentTypeArray,
[array, size_is(count)] in string urlArray, [array, size_is(count)] in string displayNameArray,
[array, size_is(count)] in string messageUriArray);
@ -113,14 +113,14 @@ interface nsIMessenger : nsISupports {
[array, size_is(count)] in string messageUriArray, in boolean saveFirst);
// saveAttachmentToFolder is used by the drag and drop code to drop an attachment to a destination folder
// we need to return the actual file path (including the filename).
nsILocalFile saveAttachmentToFolder(in string contentType, in string url, in string displayName, in string messageUri, in nsILocalFile aDestFolder);
nsILocalFile saveAttachmentToFolder(in ACString contentType, in ACString url, in ACString displayName, in ACString messageUri, in nsILocalFile aDestFolder);
attribute boolean sendingUnsentMsgs;
readonly attribute string lastDisplayedMessageUri;
readonly attribute ACString lastDisplayedMessageUri;
nsIMsgMessageService messageServiceFromURI(in string aUri);
nsIMsgDBHdr msgHdrFromURI(in string aUri);
nsIMsgMessageService messageServiceFromURI(in ACString aUri);
nsIMsgDBHdr msgHdrFromURI(in ACString aUri);
// for back forward history, we need a list of visited messages,
// and where we are in the list.
@ -128,8 +128,8 @@ interface nsIMessenger : nsISupports {
// Unfortunately, you must call this before navigating to this position,
// because calling this has the side effect of making us adjust our current
// history pos, and *not* adding the loaded message to the history queue.
string getMsgUriAtNavigatePos(in long aPos);
string getFolderUriAtNavigatePos(in long aPos);
ACString getMsgUriAtNavigatePos(in long aPos);
ACString getFolderUriAtNavigatePos(in long aPos);
attribute long navigatePos;
// if caller just wants the count and cur pos, they can pass in a null history pointer, which will be more efficent
// if they want a list suitable for display in a back/forward menu drop down, they should pass in a aHistory pointer,

Просмотреть файл

@ -68,8 +68,8 @@ const MSG_FOLDER_FLAG_JUNK = 0x40000000;
function OpenURL(url)
{
messenger.SetWindow(window, msgWindow);
messenger.OpenURL(url);
messenger.setWindow(window, msgWindow);
messenger.openURL(url);
}
function GetMsgFolderFromResource(folderResource)

Просмотреть файл

@ -550,10 +550,10 @@ var DefaultController =
SwitchView(command);
break;
case "cmd_undo":
messenger.Undo(msgWindow);
messenger.undo(msgWindow);
break;
case "cmd_redo":
messenger.Redo(msgWindow);
messenger.redo(msgWindow);
break;
case "cmd_expandAllThreads":
gDBView.doCommand(nsMsgViewCommandType.expandAll);
@ -926,7 +926,7 @@ function MsgDeleteFolder()
if (gCurrentVirtualFolderUri == folderResource.Value)
gCurrentVirtualFolderUri = null;
parentResource = selectedFolder.parent.QueryInterface(Components.interfaces.nsIRDFResource);
messenger.DeleteFolders(GetFolderDatasource(), parentResource, folderResource);
messenger.deleteFolders(GetFolderDatasource(), parentResource, folderResource);
continue;
}
var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + selectedFolder.server.type].getService(Components.interfaces.nsIMsgProtocolInfo);
@ -953,7 +953,7 @@ function MsgDeleteFolder()
else
{
parentResource = selectedFolder.parent.QueryInterface(Components.interfaces.nsIRDFResource);
messenger.DeleteFolders(GetFolderDatasource(), parentResource, folderResource);
messenger.deleteFolders(GetFolderDatasource(), parentResource, folderResource);
}
}
}

Просмотреть файл

@ -235,7 +235,7 @@ function ComposeMessage(type, format, folder, messageArray)
return;
}
messenger.SetWindow(window, msgWindow);
messenger.setWindow(window, msgWindow);
var object = null;

Просмотреть файл

@ -114,7 +114,7 @@ function OnMailWindowUnload()
}
mailSession.RemoveMsgWindow(msgWindow);
messenger.SetWindow(null, null);
messenger.setWindow(null, null);
var msgDS = folderDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = null;

Просмотреть файл

@ -2127,13 +2127,13 @@ function SetupUndoRedoCommand(command)
if (command == "cmd_undo")
{
canUndoOrRedo = messenger.CanUndo();
txnType = messenger.GetUndoTransactionType();
canUndoOrRedo = messenger.canUndo();
txnType = messenger.getUndoTransactionType();
}
else
{
canUndoOrRedo = messenger.CanRedo();
txnType = messenger.GetRedoTransactionType();
canUndoOrRedo = messenger.canRedo();
txnType = messenger.getRedoTransactionType();
}
if (canUndoOrRedo)

Просмотреть файл

@ -253,7 +253,7 @@ function OnLoadMessageWindow()
InitMsgWindow();
messenger.SetWindow(window, msgWindow);
messenger.setWindow(window, msgWindow);
InitializeDataSources();
// FIX ME - later we will be able to use onload from the overlay
OnLoadMsgHeaderPane();
@ -805,10 +805,10 @@ var MessageWindowController =
MsgGetMessage();
break;
case "cmd_undo":
messenger.Undo(msgWindow);
messenger.undo(msgWindow);
break;
case "cmd_redo":
messenger.Redo(msgWindow);
messenger.redo(msgWindow);
break;
case "cmd_getMsgsForAuthAccounts":
MsgGetMessagesForAllAuthenticatedAccounts();

Просмотреть файл

@ -316,14 +316,14 @@ function DropOnFolderTree(row, orientation)
try {
if (isSourceNews) {
// news to pop or imap is always a copy
messenger.CopyMessages(GetFolderDatasource(), sourceResource, targetResource, list, false);
messenger.copyMessages(GetFolderDatasource(), sourceResource, targetResource, list, false);
}
else if (dragSession.dragAction == nsIDragService.DRAGDROP_ACTION_COPY ||
dragSession.dragAction == nsIDragService.DRAGDROP_ACTION_MOVE) {
var isMove = (dragSession.dragAction == nsIDragService.DRAGDROP_ACTION_MOVE);
pref.setCharPref("mail.last_msg_movecopy_target_uri", targetFolder.URI);
pref.setBoolPref("mail.last_msg_movecopy_was_move", isMove);
messenger.CopyMessages(GetFolderDatasource(), sourceResource, targetResource, list, isMove);
messenger.copyMessages(GetFolderDatasource(), sourceResource, targetResource, list, isMove);
}
}
catch (ex) {
@ -334,7 +334,7 @@ function DropOnFolderTree(row, orientation)
sourceServer = sourceFolder.server;
try
{
messenger.CopyFolders(GetFolderDatasource(), targetResource, list, (sourceServer == targetServer));
messenger.copyFolders(GetFolderDatasource(), targetResource, list, (sourceServer == targetServer));
}
catch(ex)
{

Просмотреть файл

@ -675,8 +675,8 @@ function UpdateMailPaneConfig() {
desiredParent.appendChild(messagePaneSplitter);
desiredParent.appendChild(messagePane);
messagePaneSplitter.orient = desiredParent.orient;
messenger.SetWindow(null, null);
messenger.SetWindow(window, msgWindow);
messenger.setWindow(null, null);
messenger.setWindow(window, msgWindow);
if (gDBView && GetNumSelectedMessages() == 1)
gDBView.reloadMessage();
}
@ -704,7 +704,7 @@ function OnLoadMessenger()
verifyAccounts(null);
InitMsgWindow();
messenger.SetWindow(window, msgWindow);
messenger.setWindow(window, msgWindow);
InitializeDataSources();
InitPanes();

Просмотреть файл

@ -51,7 +51,7 @@ function CharacterSet(){}
function MessengerSetForcedCharacterSet(aCharset)
{
// dump(aCharset);dump("\n");
messenger.SetDocumentCharset(aCharset);
messenger.setDocumentCharset(aCharset);
msgWindow.mailCharacterSet = aCharset;
msgWindow.charsetOverride = true;

Просмотреть файл

@ -110,7 +110,7 @@ function RenameFolder(name,uri)
try
{
messenger.RenameFolder(GetFolderDatasource(), selectedFolder, name);
messenger.renameFolder(GetFolderDatasource(), selectedFolder, name);
}
catch(e)
{
@ -140,11 +140,11 @@ function MsgEmptyTrash()
{
var folderResource = GetFolderResource(folderTree, startIndex.value);
try {
messenger.EmptyTrash(GetFolderDatasource(), folderResource);
messenger.emptyTrash(GetFolderDatasource(), folderResource);
}
catch(e)
{
dump ("Exception : messenger.EmptyTrash \n");
dump ("Exception : messenger.emptyTrash \n");
}
}
}
@ -183,11 +183,11 @@ function MsgCompactFolder(isAll)
}
try
{
messenger.CompactFolder(GetFolderDatasource(), resource, isAll);
messenger.compactFolder(GetFolderDatasource(), resource, isAll);
}
catch(ex)
{
dump("Exception : messenger.CompactFolder : " + ex + "\n");
dump("Exception : messenger.compactFolder : " + ex + "\n");
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -63,9 +63,9 @@ public:
NS_DECL_NSIFOLDERLISTENER
nsresult Alert(const char * stringName);
nsresult SaveAttachment(nsIFile *file, const char* unescapedUrl,
const char* messageUri, const char* contentType,
void *closure);
nsresult SaveAttachment(nsIFile *file, const nsACString& unescapedUrl,
const nsACString& messageUri, const nsACString& contentType,
void *closure);
nsresult PromptIfFileExists(nsILocalFile *file);
nsresult DetachAttachments(PRUint32 aCount,
const char ** aContentTypeArray,
@ -89,7 +89,7 @@ protected:
nsresult InitStringBundle();
nsresult PromptIfDeleteAttachments(PRBool saveFirst, PRUint32 count, const char **displayNameArray);
void AddMsgUrlToNavigateHistory(const char *aURL);
void AddMsgUrlToNavigateHistory(const nsACString& aURL);
private:
nsresult GetLastSaveDirectory(nsILocalFile **aLastSaveAsDir);
@ -122,9 +122,8 @@ private:
};
#define NS_MESSENGER_CID \
{ /* 3f181950-c14d-11d2-b7f2-00805f05ffa5 */ \
0x3f181950, 0xc14d, 0x11d2, \
{0xb7, 0xf2, 0x0, 0x80, 0x5f, 0x05, 0xff, 0xa5}}
{ /* f436a174-e2c0-4955-9afe-e3feb68aee56 */ \
0xf436a174, 0xe2c0, 0x4955, \
{0x9af, 0xe3, 0xe, 0xfe, 0xb6, 0x8a, 0xee, 0x56}}
#endif

Просмотреть файл

@ -897,7 +897,7 @@ NS_IMETHODIMP nsMsgDBView::ReloadMessageWithAllParts()
nsCAutoString forceAllParts(m_currentlyDisplayedMsgUri);
forceAllParts += (forceAllParts.FindChar('?') == kNotFound) ? "?" : "&";
forceAllParts.AppendLiteral("fetchCompleteMessage=true");
return mMessengerInstance->OpenURL(forceAllParts.get());
return mMessengerInstance->OpenURL(forceAllParts);
}
NS_IMETHODIMP nsMsgDBView::ReloadMessage()
@ -905,7 +905,7 @@ NS_IMETHODIMP nsMsgDBView::ReloadMessage()
if (m_currentlyDisplayedMsgUri.IsEmpty() || mSuppressMsgDisplay)
return NS_OK;
return mMessengerInstance->OpenURL(m_currentlyDisplayedMsgUri.get());
return mMessengerInstance->OpenURL(m_currentlyDisplayedMsgUri);
}
nsresult nsMsgDBView::UpdateDisplayMessage(nsMsgViewIndex viewPosition)
@ -959,7 +959,7 @@ NS_IMETHODIMP nsMsgDBView::LoadMessageByViewIndex(nsMsgViewIndex aViewIndex)
{
NS_ENSURE_SUCCESS(rv,rv);
mMessengerInstance->OpenURL(uri.get());
mMessengerInstance->OpenURL(uri);
m_currentlyDisplayedMsgKey = m_keys[aViewIndex];
m_currentlyDisplayedMsgUri = uri;
m_currentlyDisplayedViewIndex = aViewIndex;
@ -973,7 +973,7 @@ NS_IMETHODIMP nsMsgDBView::LoadMessageByUrl(const char *aUrl)
NS_ASSERTION(aUrl, "trying to load a null url");
if (!mSuppressMsgDisplay)
{
mMessengerInstance->LoadURL(NULL, aUrl);
mMessengerInstance->LoadURL(NULL, nsDependentCString(aUrl));
m_currentlyDisplayedMsgKey = nsMsgKey_None;
m_currentlyDisplayedMsgUri.Truncate();
m_currentlyDisplayedViewIndex = nsMsgViewIndex_None;
@ -5324,14 +5324,14 @@ nsresult nsMsgDBView::NavigateFromPos(nsMsgNavigationTypeValue motion, nsMsgView
PRInt32 relPos = (motion == nsMsgNavigationType::forward)
? 1 : (m_currentlyDisplayedMsgKey != nsMsgKey_None) ? -1 : 0;
PRInt32 curPos;
nsresult rv = mMessengerInstance->GetFolderUriAtNavigatePos(relPos, getter_Copies(folderUri));
nsresult rv = mMessengerInstance->GetFolderUriAtNavigatePos(relPos, folderUri);
NS_ENSURE_SUCCESS(rv, rv);
if (folderUri.Equals(viewFolderUri))
{
nsCOMPtr <nsIMsgDBHdr> msgHdr;
nsresult rv = mMessengerInstance->GetMsgUriAtNavigatePos(relPos, getter_Copies(msgUri));
nsresult rv = mMessengerInstance->GetMsgUriAtNavigatePos(relPos, msgUri);
NS_ENSURE_SUCCESS(rv, rv);
mMessengerInstance->MsgHdrFromURI(msgUri.get(), getter_AddRefs(msgHdr));
mMessengerInstance->MsgHdrFromURI(msgUri, getter_AddRefs(msgHdr));
if (msgHdr)
{
mMessengerInstance->GetNavigatePos(&curPos);