diff --git a/mozilla/editor/base/Makefile.in b/mozilla/editor/base/Makefile.in index fbb5230148e..6da1f8a8764 100644 --- a/mozilla/editor/base/Makefile.in +++ b/mozilla/editor/base/Makefile.in @@ -52,9 +52,9 @@ CPPSRCS = \ nsEditorUtils.cpp \ nsEditProperty.cpp \ nsHTMLEditUtils.cpp \ - nsPlaintextDataTransfer.cpp \ - nsPlaintextEditor.cpp \ - nsSelectionState.cpp \ + nsPlaintextDataTransfer.cpp \ + nsPlaintextEditor.cpp \ + nsSelectionState.cpp \ nsStyleSheetTxns.cpp \ nsTextEditRules.cpp \ PlaceholderTxn.cpp \ diff --git a/mozilla/editor/base/PlaceholderTxn.cpp b/mozilla/editor/base/PlaceholderTxn.cpp index 5a1df3492b3..a03a46c31fb 100644 --- a/mozilla/editor/base/PlaceholderTxn.cpp +++ b/mozilla/editor/base/PlaceholderTxn.cpp @@ -176,7 +176,7 @@ NS_IMETHODIMP PlaceholderTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransact // efficiency hack: no need to remember selection here, as we haven't yet // finished the inital batch and we know we will be told when the batch ends. // we can remeber the selection then. - if (gNoisy) { printf("Placeholder txn assimilated %p\n", aTransaction); } + if (gNoisy) { printf("Placeholder txn assimilated %p\n", (void*)aTransaction); } } else { // merge typing or IME or deletion transactions if the selection matches diff --git a/mozilla/editor/base/nsEditorCommands.cpp b/mozilla/editor/base/nsEditorCommands.cpp index 5c556774929..5a172663129 100644 --- a/mozilla/editor/base/nsEditorCommands.cpp +++ b/mozilla/editor/base/nsEditorCommands.cpp @@ -118,6 +118,37 @@ nsCutCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) } +NS_IMETHODIMP +nsCutOrDeleteCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled) +{ + nsCOMPtr editor = do_QueryInterface(refCon); + *outCmdEnabled = (editor != nsnull); + return NS_OK; +} + + +NS_IMETHODIMP +nsCutOrDeleteCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) +{ + nsCOMPtr editor = do_QueryInterface(refCon); + if (editor) + { + nsCOMPtr selection; + nsresult rv = editor->GetSelection(getter_AddRefs(selection)); + if (NS_SUCCEEDED(rv) && selection) + { + PRBool isCollapsed; + rv = selection->GetIsCollapsed(&isCollapsed); + if (NS_SUCCEEDED(rv) && isCollapsed) + return editor->DeleteSelection(nsIEditor::eNext); + } + return editor->Cut(); + } + + return NS_ERROR_FAILURE; +} + + NS_IMETHODIMP nsCopyCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled) { @@ -141,6 +172,37 @@ nsCopyCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) } +NS_IMETHODIMP +nsCopyOrDeleteCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled) +{ + nsCOMPtr editor = do_QueryInterface(refCon); + *outCmdEnabled = (editor != nsnull); + return NS_OK; +} + + +NS_IMETHODIMP +nsCopyOrDeleteCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) +{ + nsCOMPtr editor = do_QueryInterface(refCon); + if (editor) + { + nsCOMPtr selection; + nsresult rv = editor->GetSelection(getter_AddRefs(selection)); + if (NS_SUCCEEDED(rv) && selection) + { + PRBool isCollapsed; + rv = selection->GetIsCollapsed(&isCollapsed); + if (NS_SUCCEEDED(rv) && isCollapsed) + return editor->DeleteSelection(nsIEditor::eNext); + } + return editor->Copy(); + } + + return NS_ERROR_FAILURE; +} + + NS_IMETHODIMP nsPasteCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled) { diff --git a/mozilla/editor/base/nsEditorCommands.h b/mozilla/editor/base/nsEditorCommands.h index a0740c3b301..147688917f7 100644 --- a/mozilla/editor/base/nsEditorCommands.h +++ b/mozilla/editor/base/nsEditorCommands.h @@ -60,7 +60,9 @@ NS_DECL_EDITOR_COMMAND(nsUndoCommand) NS_DECL_EDITOR_COMMAND(nsRedoCommand) NS_DECL_EDITOR_COMMAND(nsCutCommand) +NS_DECL_EDITOR_COMMAND(nsCutOrDeleteCommand) NS_DECL_EDITOR_COMMAND(nsCopyCommand) +NS_DECL_EDITOR_COMMAND(nsCopyOrDeleteCommand) NS_DECL_EDITOR_COMMAND(nsPasteCommand) NS_DECL_EDITOR_COMMAND(nsDeleteCommand) NS_DECL_EDITOR_COMMAND(nsSelectAllCommand) diff --git a/mozilla/editor/base/nsEditorController.cpp b/mozilla/editor/base/nsEditorController.cpp index 958cc6b60b1..fb39680d9a0 100644 --- a/mozilla/editor/base/nsEditorController.cpp +++ b/mozilla/editor/base/nsEditorController.cpp @@ -132,7 +132,9 @@ nsresult nsEditorController::RegisterEditorCommands(nsIControllerCommandManager NS_REGISTER_ONE_COMMAND(nsRedoCommand, "cmd_redo"); NS_REGISTER_ONE_COMMAND(nsCutCommand, "cmd_cut"); + NS_REGISTER_ONE_COMMAND(nsCutOrDeleteCommand, "cmd_cutOrDelete"); NS_REGISTER_ONE_COMMAND(nsCopyCommand, "cmd_copy"); + NS_REGISTER_ONE_COMMAND(nsCopyOrDeleteCommand, "cmd_copyOrDelete"); NS_REGISTER_ONE_COMMAND(nsSelectAllCommand, "cmd_selectAll"); NS_REGISTER_ONE_COMMAND(nsPasteCommand, "cmd_paste"); diff --git a/mozilla/editor/base/nsHTMLDataTransfer.cpp b/mozilla/editor/base/nsHTMLDataTransfer.cpp index 99b54b9854a..54849a75397 100644 --- a/mozilla/editor/base/nsHTMLDataTransfer.cpp +++ b/mozilla/editor/base/nsHTMLDataTransfer.cpp @@ -620,7 +620,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable nsAutoTxnsConserveSelection dontSpazMySelection(this); nsAutoString flavor, stuffToPaste; flavor.AssignWithConversion( bestFlavor ); // just so we can use flavor.Equals() -#ifdef DEBUG_akkana +#ifdef DEBUG_clipboard printf("Got flavor [%s]\n", bestFlavor); #endif if (flavor.EqualsWithConversion(kHTMLMime)) @@ -1289,7 +1289,7 @@ NS_IMETHODIMP nsHTMLEditor::PasteAsPlaintextQuotation(PRInt32 aSelectionType) #endif return rv; } -#ifdef DEBUG_akkana +#ifdef DEBUG_clipboard printf("Got flavor [%s]\n", flav); #endif nsAutoString flavor; flavor.AssignWithConversion(flav); diff --git a/mozilla/editor/base/nsHTMLEditor.cpp b/mozilla/editor/base/nsHTMLEditor.cpp index 7a04d04c922..87cf7c0b545 100644 --- a/mozilla/editor/base/nsHTMLEditor.cpp +++ b/mozilla/editor/base/nsHTMLEditor.cpp @@ -2602,110 +2602,7 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList) #pragma mark - #endif - -NS_IMETHODIMP -nsHTMLEditor::Undo(PRUint32 aCount) -{ - ForceCompositionEnd(); - nsresult result = NS_OK; - - nsAutoRules beginRulesSniffing(this, kOpUndo, nsIEditor::eNone); - - nsTextRulesInfo ruleInfo(nsTextEditRules::kUndo); - nsCOMPtr selection; - GetSelection(getter_AddRefs(selection)); - PRBool cancel, handled; - result = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled); - - if (!cancel && NS_SUCCEEDED(result)) - { - result = nsEditor::Undo(aCount); - result = mRules->DidDoAction(selection, &ruleInfo, result); - } - - return result; -} - - -NS_IMETHODIMP -nsHTMLEditor::Redo(PRUint32 aCount) -{ - nsresult result = NS_OK; - - nsAutoRules beginRulesSniffing(this, kOpRedo, nsIEditor::eNone); - - nsTextRulesInfo ruleInfo(nsTextEditRules::kRedo); - nsCOMPtr selection; - GetSelection(getter_AddRefs(selection)); - PRBool cancel, handled; - result = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled); - - if (!cancel && NS_SUCCEEDED(result)) - { - result = nsEditor::Redo(aCount); - result = mRules->DidDoAction(selection, &ruleInfo, result); - } - - return result; -} - -NS_IMETHODIMP nsHTMLEditor::Cut() -{ - nsCOMPtr selection; - nsresult res = GetSelection(getter_AddRefs(selection)); - if (!NS_SUCCEEDED(res)) - return res; - - PRBool isCollapsed; - if (NS_SUCCEEDED(selection->GetIsCollapsed(&isCollapsed)) && isCollapsed) - return NS_ERROR_NOT_AVAILABLE; - - res = Copy(); - if (NS_SUCCEEDED(res)) - res = DeleteSelection(eNone); - return res; -} - -NS_IMETHODIMP nsHTMLEditor::CanCut(PRBool &aCanCut) -{ - aCanCut = PR_FALSE; - - nsCOMPtr selection; - nsresult res = GetSelection(getter_AddRefs(selection)); - if (NS_FAILED(res)) return res; - - PRBool isCollapsed; - res = selection->GetIsCollapsed(&isCollapsed); - if (NS_FAILED(res)) return res; - - aCanCut = !isCollapsed && IsModifiable(); - return NS_OK; -} - -NS_IMETHODIMP nsHTMLEditor::Copy() -{ - if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr ps = do_QueryReferent(mPresShellWeak); - if (!ps) return NS_ERROR_NOT_INITIALIZED; - return ps->DoCopy(); -} - -NS_IMETHODIMP nsHTMLEditor::CanCopy(PRBool &aCanCopy) -{ - aCanCopy = PR_FALSE; - - nsCOMPtr selection; - nsresult res = GetSelection(getter_AddRefs(selection)); - if (NS_FAILED(res)) return res; - - PRBool isCollapsed; - res = selection->GetIsCollapsed(&isCollapsed); - if (NS_FAILED(res)) return res; - - aCanCopy = !isCollapsed; - return NS_OK; -} - +// Undo, Redo, Cut, CanCut, Copy, CanCopy, all inherited from nsPlaintextEditor static nsresult SetSelectionAroundHeadChildren(nsCOMPtr aSelection, nsWeakPtr aDocWeak) { diff --git a/mozilla/editor/base/nsHTMLEditor.h b/mozilla/editor/base/nsHTMLEditor.h index 212c3d5997f..e469b35dcb4 100644 --- a/mozilla/editor/base/nsHTMLEditor.h +++ b/mozilla/editor/base/nsHTMLEditor.h @@ -249,13 +249,6 @@ public: NS_IMETHOD GetFlags(PRUint32 *aFlags); NS_IMETHOD SetFlags(PRUint32 aFlags); - NS_IMETHOD Undo(PRUint32 aCount); - NS_IMETHOD Redo(PRUint32 aCount); - - NS_IMETHOD Cut(); - NS_IMETHOD CanCut(PRBool &aCanCut); - NS_IMETHOD Copy(); - NS_IMETHOD CanCopy(PRBool &aCanCopy); NS_IMETHOD Paste(PRInt32 aSelectionType); NS_IMETHOD CanPaste(PRInt32 aSelectionType, PRBool &aCanPaste); diff --git a/mozilla/editor/libeditor/base/PlaceholderTxn.cpp b/mozilla/editor/libeditor/base/PlaceholderTxn.cpp index 5a1df3492b3..a03a46c31fb 100644 --- a/mozilla/editor/libeditor/base/PlaceholderTxn.cpp +++ b/mozilla/editor/libeditor/base/PlaceholderTxn.cpp @@ -176,7 +176,7 @@ NS_IMETHODIMP PlaceholderTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransact // efficiency hack: no need to remember selection here, as we haven't yet // finished the inital batch and we know we will be told when the batch ends. // we can remeber the selection then. - if (gNoisy) { printf("Placeholder txn assimilated %p\n", aTransaction); } + if (gNoisy) { printf("Placeholder txn assimilated %p\n", (void*)aTransaction); } } else { // merge typing or IME or deletion transactions if the selection matches diff --git a/mozilla/editor/libeditor/base/nsEditorCommands.cpp b/mozilla/editor/libeditor/base/nsEditorCommands.cpp index 5c556774929..5a172663129 100644 --- a/mozilla/editor/libeditor/base/nsEditorCommands.cpp +++ b/mozilla/editor/libeditor/base/nsEditorCommands.cpp @@ -118,6 +118,37 @@ nsCutCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) } +NS_IMETHODIMP +nsCutOrDeleteCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled) +{ + nsCOMPtr editor = do_QueryInterface(refCon); + *outCmdEnabled = (editor != nsnull); + return NS_OK; +} + + +NS_IMETHODIMP +nsCutOrDeleteCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) +{ + nsCOMPtr editor = do_QueryInterface(refCon); + if (editor) + { + nsCOMPtr selection; + nsresult rv = editor->GetSelection(getter_AddRefs(selection)); + if (NS_SUCCEEDED(rv) && selection) + { + PRBool isCollapsed; + rv = selection->GetIsCollapsed(&isCollapsed); + if (NS_SUCCEEDED(rv) && isCollapsed) + return editor->DeleteSelection(nsIEditor::eNext); + } + return editor->Cut(); + } + + return NS_ERROR_FAILURE; +} + + NS_IMETHODIMP nsCopyCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled) { @@ -141,6 +172,37 @@ nsCopyCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) } +NS_IMETHODIMP +nsCopyOrDeleteCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled) +{ + nsCOMPtr editor = do_QueryInterface(refCon); + *outCmdEnabled = (editor != nsnull); + return NS_OK; +} + + +NS_IMETHODIMP +nsCopyOrDeleteCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) +{ + nsCOMPtr editor = do_QueryInterface(refCon); + if (editor) + { + nsCOMPtr selection; + nsresult rv = editor->GetSelection(getter_AddRefs(selection)); + if (NS_SUCCEEDED(rv) && selection) + { + PRBool isCollapsed; + rv = selection->GetIsCollapsed(&isCollapsed); + if (NS_SUCCEEDED(rv) && isCollapsed) + return editor->DeleteSelection(nsIEditor::eNext); + } + return editor->Copy(); + } + + return NS_ERROR_FAILURE; +} + + NS_IMETHODIMP nsPasteCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled) { diff --git a/mozilla/editor/libeditor/base/nsEditorCommands.h b/mozilla/editor/libeditor/base/nsEditorCommands.h index a0740c3b301..147688917f7 100644 --- a/mozilla/editor/libeditor/base/nsEditorCommands.h +++ b/mozilla/editor/libeditor/base/nsEditorCommands.h @@ -60,7 +60,9 @@ NS_DECL_EDITOR_COMMAND(nsUndoCommand) NS_DECL_EDITOR_COMMAND(nsRedoCommand) NS_DECL_EDITOR_COMMAND(nsCutCommand) +NS_DECL_EDITOR_COMMAND(nsCutOrDeleteCommand) NS_DECL_EDITOR_COMMAND(nsCopyCommand) +NS_DECL_EDITOR_COMMAND(nsCopyOrDeleteCommand) NS_DECL_EDITOR_COMMAND(nsPasteCommand) NS_DECL_EDITOR_COMMAND(nsDeleteCommand) NS_DECL_EDITOR_COMMAND(nsSelectAllCommand) diff --git a/mozilla/editor/libeditor/base/nsEditorController.cpp b/mozilla/editor/libeditor/base/nsEditorController.cpp index 958cc6b60b1..fb39680d9a0 100644 --- a/mozilla/editor/libeditor/base/nsEditorController.cpp +++ b/mozilla/editor/libeditor/base/nsEditorController.cpp @@ -132,7 +132,9 @@ nsresult nsEditorController::RegisterEditorCommands(nsIControllerCommandManager NS_REGISTER_ONE_COMMAND(nsRedoCommand, "cmd_redo"); NS_REGISTER_ONE_COMMAND(nsCutCommand, "cmd_cut"); + NS_REGISTER_ONE_COMMAND(nsCutOrDeleteCommand, "cmd_cutOrDelete"); NS_REGISTER_ONE_COMMAND(nsCopyCommand, "cmd_copy"); + NS_REGISTER_ONE_COMMAND(nsCopyOrDeleteCommand, "cmd_copyOrDelete"); NS_REGISTER_ONE_COMMAND(nsSelectAllCommand, "cmd_selectAll"); NS_REGISTER_ONE_COMMAND(nsPasteCommand, "cmd_paste"); diff --git a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp index 99b54b9854a..54849a75397 100644 --- a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -620,7 +620,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable nsAutoTxnsConserveSelection dontSpazMySelection(this); nsAutoString flavor, stuffToPaste; flavor.AssignWithConversion( bestFlavor ); // just so we can use flavor.Equals() -#ifdef DEBUG_akkana +#ifdef DEBUG_clipboard printf("Got flavor [%s]\n", bestFlavor); #endif if (flavor.EqualsWithConversion(kHTMLMime)) @@ -1289,7 +1289,7 @@ NS_IMETHODIMP nsHTMLEditor::PasteAsPlaintextQuotation(PRInt32 aSelectionType) #endif return rv; } -#ifdef DEBUG_akkana +#ifdef DEBUG_clipboard printf("Got flavor [%s]\n", flav); #endif nsAutoString flavor; flavor.AssignWithConversion(flav); diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index 7a04d04c922..87cf7c0b545 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp @@ -2602,110 +2602,7 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList) #pragma mark - #endif - -NS_IMETHODIMP -nsHTMLEditor::Undo(PRUint32 aCount) -{ - ForceCompositionEnd(); - nsresult result = NS_OK; - - nsAutoRules beginRulesSniffing(this, kOpUndo, nsIEditor::eNone); - - nsTextRulesInfo ruleInfo(nsTextEditRules::kUndo); - nsCOMPtr selection; - GetSelection(getter_AddRefs(selection)); - PRBool cancel, handled; - result = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled); - - if (!cancel && NS_SUCCEEDED(result)) - { - result = nsEditor::Undo(aCount); - result = mRules->DidDoAction(selection, &ruleInfo, result); - } - - return result; -} - - -NS_IMETHODIMP -nsHTMLEditor::Redo(PRUint32 aCount) -{ - nsresult result = NS_OK; - - nsAutoRules beginRulesSniffing(this, kOpRedo, nsIEditor::eNone); - - nsTextRulesInfo ruleInfo(nsTextEditRules::kRedo); - nsCOMPtr selection; - GetSelection(getter_AddRefs(selection)); - PRBool cancel, handled; - result = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled); - - if (!cancel && NS_SUCCEEDED(result)) - { - result = nsEditor::Redo(aCount); - result = mRules->DidDoAction(selection, &ruleInfo, result); - } - - return result; -} - -NS_IMETHODIMP nsHTMLEditor::Cut() -{ - nsCOMPtr selection; - nsresult res = GetSelection(getter_AddRefs(selection)); - if (!NS_SUCCEEDED(res)) - return res; - - PRBool isCollapsed; - if (NS_SUCCEEDED(selection->GetIsCollapsed(&isCollapsed)) && isCollapsed) - return NS_ERROR_NOT_AVAILABLE; - - res = Copy(); - if (NS_SUCCEEDED(res)) - res = DeleteSelection(eNone); - return res; -} - -NS_IMETHODIMP nsHTMLEditor::CanCut(PRBool &aCanCut) -{ - aCanCut = PR_FALSE; - - nsCOMPtr selection; - nsresult res = GetSelection(getter_AddRefs(selection)); - if (NS_FAILED(res)) return res; - - PRBool isCollapsed; - res = selection->GetIsCollapsed(&isCollapsed); - if (NS_FAILED(res)) return res; - - aCanCut = !isCollapsed && IsModifiable(); - return NS_OK; -} - -NS_IMETHODIMP nsHTMLEditor::Copy() -{ - if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr ps = do_QueryReferent(mPresShellWeak); - if (!ps) return NS_ERROR_NOT_INITIALIZED; - return ps->DoCopy(); -} - -NS_IMETHODIMP nsHTMLEditor::CanCopy(PRBool &aCanCopy) -{ - aCanCopy = PR_FALSE; - - nsCOMPtr selection; - nsresult res = GetSelection(getter_AddRefs(selection)); - if (NS_FAILED(res)) return res; - - PRBool isCollapsed; - res = selection->GetIsCollapsed(&isCollapsed); - if (NS_FAILED(res)) return res; - - aCanCopy = !isCollapsed; - return NS_OK; -} - +// Undo, Redo, Cut, CanCut, Copy, CanCopy, all inherited from nsPlaintextEditor static nsresult SetSelectionAroundHeadChildren(nsCOMPtr aSelection, nsWeakPtr aDocWeak) { diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.h b/mozilla/editor/libeditor/html/nsHTMLEditor.h index 212c3d5997f..e469b35dcb4 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.h +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.h @@ -249,13 +249,6 @@ public: NS_IMETHOD GetFlags(PRUint32 *aFlags); NS_IMETHOD SetFlags(PRUint32 aFlags); - NS_IMETHOD Undo(PRUint32 aCount); - NS_IMETHOD Redo(PRUint32 aCount); - - NS_IMETHOD Cut(); - NS_IMETHOD CanCut(PRBool &aCanCut); - NS_IMETHOD Copy(); - NS_IMETHOD CanCopy(PRBool &aCanCopy); NS_IMETHOD Paste(PRInt32 aSelectionType); NS_IMETHOD CanPaste(PRInt32 aSelectionType, PRBool &aCanPaste);