Added IWebDocumentText available via QI from WebFrame.
authorsfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2007 07:40:08 +0000 (07:40 +0000)
committersfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2007 07:40:08 +0000 (07:40 +0000)
        Reviewed by Sam.

        * WebFrame.cpp:
        (WebFrame::QueryInterface): Added IID_IWebDocumentText.
        (WebFrame::supportsTextEncoding): Stubbed out.
        (WebFrame::selectedString): Implemented.
        (WebFrame::selectAll): Stubbed out.
        (WebFrame::deselectAll): Stubbed out.
        * WebFrame.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27588 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/win/ChangeLog
WebKit/win/WebFrame.cpp
WebKit/win/WebFrame.h

index 26e348972f871d836a84e2f78d23eec94ca3294b..1b40ae530c0d66853421436dff49a1b7cd74111b 100644 (file)
@@ -1,3 +1,17 @@
+2007-11-07  Steve Falkenburg  <sfalken@apple.com>
+
+        Added IWebDocumentText available via QI from WebFrame.
+        
+        Reviewed by Sam.
+
+        * WebFrame.cpp:
+        (WebFrame::QueryInterface): Added IID_IWebDocumentText.
+        (WebFrame::supportsTextEncoding): Stubbed out.
+        (WebFrame::selectedString): Implemented.
+        (WebFrame::selectAll): Stubbed out.
+        (WebFrame::deselectAll): Stubbed out.
+        * WebFrame.h:
+
 2007-11-07  Adam Roben  <aroben@apple.com>
 
         Fix <rdar://5569268> Crash when opening any FTP site in second tab/window
index 27ee3ccb52521116af3b816db18cc58f89ae0016..8ca5f80cb4738df298f0f7a52f2be7824aa34325 100644 (file)
@@ -492,6 +492,8 @@ HRESULT STDMETHODCALLTYPE WebFrame::QueryInterface(REFIID riid, void** ppvObject
         *ppvObject = static_cast<IWebFrame*>(this);
     else if (IsEqualGUID(riid, IID_IWebFramePrivate))
         *ppvObject = static_cast<IWebFramePrivate*>(this);
+    else if (IsEqualGUID(riid, IID_IWebDocumentText))
+        *ppvObject = static_cast<IWebDocumentText*>(this);
     else
         return E_NOINTERFACE;
 
@@ -911,7 +913,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::childFrames(
     return S_OK;
 }
 
-// IWebFramePrivaete ------------------------------------------------------
+// IWebFramePrivate ------------------------------------------------------
 
 HRESULT STDMETHODCALLTYPE WebFrame::renderTreeAsExternalRepresentation(
     /* [retval][out] */ BSTR *result)
@@ -1004,6 +1006,40 @@ HRESULT STDMETHODCALLTYPE WebFrame::loadType(
     return S_OK;
 }
 
+// IWebDocumentText -----------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebFrame::supportsTextEncoding( 
+    /* [retval][out] */ BOOL* result)
+{
+    *result = FALSE;
+    return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE WebFrame::selectedString( 
+    /* [retval][out] */ BSTR* result)
+{
+    *result = 0;
+
+    Frame* coreFrame = core(this);
+    if (!coreFrame)
+        return E_FAIL;
+
+    String text = coreFrame->selectedText();
+    text.replace('\\', coreFrame->backslashAsCurrencySymbol());
+
+    *result = BString(text).release();
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebFrame::selectAll()
+{
+    return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE WebFrame::deselectAll()
+{
+    return E_NOTIMPL;
+}
 
 // WebFrame ---------------------------------------------------------------
 
index 602426ea4e70e018e0464fb0c1bee05e35a6c2c8..4656c0d3ff3e5d93aa1609ca4214c7f1e6502f3d 100644 (file)
@@ -70,7 +70,7 @@ WebCore::Frame* core(WebFrame*);
 
 extern const GUID IID_WebFrame;
 
-class WebFrame : public IWebFrame, IWebFramePrivate
+class WebFrame : public IWebFrame, IWebFramePrivate, IWebDocumentText
     , public WebCore::FrameLoaderClient
 {
 public:
@@ -205,6 +205,16 @@ public:
     virtual HRESULT STDMETHODCALLTYPE allowsScrolling(
         /* [retval][out] */ BOOL *flag);
 
+    // IWebDocumentText
+    virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding( 
+        /* [retval][out] */ BOOL* result);
+    
+    virtual HRESULT STDMETHODCALLTYPE selectedString( 
+        /* [retval][out] */ BSTR* result);
+    
+    virtual HRESULT STDMETHODCALLTYPE selectAll();
+    
+    virtual HRESULT STDMETHODCALLTYPE deselectAll();
 
     // FrameWinClient
     virtual void ref();