From ef7614362de89dbf7ebcfbe18bc1284754f17164 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 14 Feb 2005 20:57:08 +0000 Subject: Emit a signal in EphySidebar::AddSearchEngine. 2005-02-14 Christian Persch * embed/ephy-embed-single.c: (ephy_embed_single_iface_init): * embed/ephy-embed-single.h: * embed/mozilla/EphySidebar.cpp: * lib/ephy-marshal.list: Emit a signal in EphySidebar::AddSearchEngine. --- embed/mozilla/EphySidebar.cpp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'embed/mozilla') diff --git a/embed/mozilla/EphySidebar.cpp b/embed/mozilla/EphySidebar.cpp index ff98e29e6..953f8561c 100644 --- a/embed/mozilla/EphySidebar.cpp +++ b/embed/mozilla/EphySidebar.cpp @@ -47,12 +47,11 @@ EphySidebar::~EphySidebar() { } - /* void addPanel (in wstring aTitle, in string aContentURL, in string aCustomizeURL); */ NS_IMETHODIMP EphySidebar::AddPanel (const PRUnichar *aTitle, - const char *aContentURL, - const char *aCustomizeURL) + const char *aContentURL, + const char *aCustomizeURL) { nsEmbedCString title; EphyEmbedSingle *single; @@ -74,24 +73,36 @@ EphySidebar::AddPanel (const PRUnichar *aTitle, /* void addPersistentPanel (in wstring aTitle, in string aContentURL, in string aCustomizeURL); */ NS_IMETHODIMP EphySidebar::AddPersistentPanel (const PRUnichar *aTitle, - const char *aContentURL, - const char *aCustomizeURL) + const char *aContentURL, + const char *aCustomizeURL) { - return NS_ERROR_NOT_IMPLEMENTED; + return AddPanel (aTitle, aContentURL, aCustomizeURL); } /* void addSearchEngine (in string engineURL, in string iconURL, in wstring suggestedTitle, in wst ring suggestedCategory); */ NS_IMETHODIMP -EphySidebar::AddSearchEngine (const char *engineURL, - const char *iconURL, - const PRUnichar *suggestedTitle, - const PRUnichar *suggestedCategory) +EphySidebar::AddSearchEngine (const char *aEngineURL, + const char *aIconURL, + const PRUnichar *aSuggestedTitle, + const PRUnichar *aSuggestedCategory) { - return NS_ERROR_NOT_IMPLEMENTED; -} + nsEmbedCString title; + EphyEmbedSingle *single; + + NS_UTF16ToCString (nsEmbedString(aSuggestedTitle), + NS_CSTRING_ENCODING_UTF8, title); + LOG ("Adding search engine, engineurl=%s iconurl=%s title=%s", aEngineURL, aIconURL, title.get()); + single = EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single (embed_shell)); + + gboolean result = FALSE; + g_signal_emit_by_name (single, "add-search-engine", + aEngineURL, aIconURL, title.get(), &result); + + return NS_OK; +} //------------------------------------------------------------------------------ //nsIClassInfo Impl. -- cgit v1.2.3