aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EphyWrapper.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-10-25 23:15:35 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-10-25 23:15:35 +0800
commit38956a20d942387e3d5b839c4b962713bd60cdf0 (patch)
tree6ac41837526e3b5aab171741e0803ff87492a2ea /embed/mozilla/EphyWrapper.cpp
parent20602830fa6d28dd28cab60de0698ec523b1c6b9 (diff)
downloadgsoc2013-epiphany-38956a20d942387e3d5b839c4b962713bd60cdf0.tar
gsoc2013-epiphany-38956a20d942387e3d5b839c4b962713bd60cdf0.tar.gz
gsoc2013-epiphany-38956a20d942387e3d5b839c4b962713bd60cdf0.tar.bz2
gsoc2013-epiphany-38956a20d942387e3d5b839c4b962713bd60cdf0.tar.lz
gsoc2013-epiphany-38956a20d942387e3d5b839c4b962713bd60cdf0.tar.xz
gsoc2013-epiphany-38956a20d942387e3d5b839c4b962713bd60cdf0.tar.zst
gsoc2013-epiphany-38956a20d942387e3d5b839c4b962713bd60cdf0.zip
Interface for commands. Useful for undo. (cmd_undo works).
2003-10-25 Marco Pesenti Gritti <marco@gnome.org> * embed/Makefile.am: * embed/ephy-command-manager.c: (ephy_command_manager_get_type), (ephy_command_manager_base_init), (ephy_command_manager_do_command), (ephy_command_manager_can_do_command), (ephy_command_manager_observe_command): * embed/ephy-command-manager.h: Interface for commands. Useful for undo. (cmd_undo works). * embed/ephy-embed.c: * embed/ephy-embed.h: Remove all clipboard calls. * embed/mozilla/EphyWrapper.cpp: * embed/mozilla/EphyWrapper.h: * embed/mozilla/Makefile.am: * embed/mozilla/mozilla-embed.cpp: Implement part of the commands interface. No regressions. * src/window-commands.c: (window_cmd_edit_cut), (window_cmd_edit_copy), (window_cmd_edit_paste), (window_cmd_edit_select_all): Implement clipboard using commands.
Diffstat (limited to 'embed/mozilla/EphyWrapper.cpp')
-rw-r--r--embed/mozilla/EphyWrapper.cpp53
1 files changed, 10 insertions, 43 deletions
diff --git a/embed/mozilla/EphyWrapper.cpp b/embed/mozilla/EphyWrapper.cpp
index 5cb399201..bea527fe2 100644
--- a/embed/mozilla/EphyWrapper.cpp
+++ b/embed/mozilla/EphyWrapper.cpp
@@ -30,6 +30,7 @@
#include <gtkmozembed_internal.h>
#include <unistd.h>
+#include "nsICommandManager.h"
#include "nsIContentViewer.h"
#include "nsIGlobalHistory.h"
#include "nsIDocShellHistory.h"
@@ -51,7 +52,6 @@
#include "nsCWebBrowserPersist.h"
#include "nsNetUtil.h"
#include "nsIChromeEventHandler.h"
-#include "nsIClipboardCommands.h"
#include "nsIDOMDocumentStyle.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeNode.h"
@@ -712,48 +712,6 @@ nsresult EphyWrapper::ForceEncoding (const char *encoding)
return result;
}
-nsresult EphyWrapper::CanCutSelection(PRBool *result)
-{
- nsCOMPtr<nsIClipboardCommands> clipboard (do_GetInterface(mWebBrowser));
- return clipboard->CanCutSelection (result);
-}
-
-nsresult EphyWrapper::CanCopySelection(PRBool *result)
-{
- nsCOMPtr<nsIClipboardCommands> clipboard (do_GetInterface(mWebBrowser));
- return clipboard->CanCopySelection (result);
-}
-
-nsresult EphyWrapper::CanPaste(PRBool *result)
-{
- nsCOMPtr<nsIClipboardCommands> clipboard (do_GetInterface(mWebBrowser));
- return clipboard->CanPaste (result);
-}
-
-nsresult EphyWrapper::CutSelection(void)
-{
- nsCOMPtr<nsIClipboardCommands> clipboard (do_GetInterface(mWebBrowser));
- return clipboard->CutSelection ();
-}
-
-nsresult EphyWrapper::CopySelection(void)
-{
- nsCOMPtr<nsIClipboardCommands> clipboard (do_GetInterface(mWebBrowser));
- return clipboard->CopySelection ();
-}
-
-nsresult EphyWrapper::Paste(void)
-{
- nsCOMPtr<nsIClipboardCommands> clipboard (do_GetInterface(mWebBrowser));
- return clipboard->Paste ();
-}
-
-nsresult EphyWrapper::SelectAll (void)
-{
- nsCOMPtr<nsIClipboardCommands> clipboard (do_GetInterface(mWebBrowser));
- return clipboard->SelectAll ();
-}
-
nsresult EphyWrapper::PushTargetDocument (nsIDOMDocument *domDoc)
{
mTargetDocument = domDoc;
@@ -894,3 +852,12 @@ nsresult EphyWrapper::GetEncodingInfo (EphyEncodingInfo **infoptr)
return NS_OK;
}
+
+nsresult EphyWrapper::DoCommand (const char *command)
+{
+ nsCOMPtr<nsICommandManager> cmdManager;
+ cmdManager = do_GetInterface (mWebBrowser);
+ if (!cmdManager) return NS_ERROR_FAILURE;
+
+ return cmdManager->DoCommand (command, nsnull, nsnull);
+}