webengine/osswebengine/WebKit/s60/webview/WebFrame.h
changeset 0 dd21522fd290
child 10 a359256acfc6
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Implemetation of CWebFrame
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __WEBFRAME_H__
       
    20 #define __WEBFRAME_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <wtf/RefPtr.h>
       
    24 #include <wtf/Vector.h>
       
    25 #include "Shared.h"
       
    26 
       
    27 namespace WebCore
       
    28 {
       
    29     class Frame;
       
    30     class FrameLoader;
       
    31     class DocumentLoader;
       
    32     class DOMDocument;
       
    33     class Page;
       
    34     struct ResourceRequest;
       
    35     class SubstituteData;
       
    36     class RenderObject;
       
    37     class RenderObject;
       
    38     class Node;
       
    39     class String;
       
    40 }
       
    41 
       
    42 class WebView;
       
    43 class WebFrameView;
       
    44 class WebFrameLoaderClient;
       
    45 class WebFrameBridge;
       
    46 class WebCoreFrameBridge;
       
    47 class WebCoreGraphicsContext;
       
    48 class TBrCtlImageCarrier;
       
    49 class TBrCtlSubscribeTo;
       
    50 class CBrCtl;
       
    51 class PluginSkin;
       
    52 class MWebCoreObjectWidget;
       
    53 
       
    54 class WebFrame : public WebCore::Shared<WebFrame>
       
    55 {
       
    56 public:
       
    57 
       
    58     WebFrame();
       
    59     virtual ~WebFrame();
       
    60 
       
    61     void initWithWebFrameView(WebFrameView* view, WebView* topView, WebFrameBridge* bridge);
       
    62     void loadURL(const TPtrC8 url, const TPtrC referrer, WebFrame* child);
       
    63     void loadRequest(const WebCore::ResourceRequest& request,const WebCore::String* windowType = NULL);
       
    64     void loadURL(const TDesC8& url, TInt cachemode, const WebCore::String& referrer,const WebCore::String* windowType = NULL);
       
    65     void loadData(const WebCore::ResourceRequest& request, WebCore::SubstituteData& substituteData);
       
    66 
       
    67     // accessors
       
    68     WebFrameBridge* bridge() const { return m_bridge; }
       
    69     void setBridge(WebFrameBridge*);
       
    70     bool isMainFrame() const;
       
    71     WebFrameView* frameView() const {return m_view;}
       
    72     void setFrameView(WebFrameView*);
       
    73 
       
    74     // selection
       
    75     bool hasSelection();
       
    76     void clearSelection();
       
    77     WebFrame* findFrameWithSelection();
       
    78 
       
    79     WebCore::FrameLoader* frameLoader();
       
    80 
       
    81     void stopLoading();
       
    82     void reload();
       
    83 
       
    84     WebFrame* findFrameNamed(const TPtr& name);
       
    85     WebFrame* parentFrame();
       
    86     WTF::Vector<WebFrame*> childFrames();
       
    87     void addChild(WebFrame* child);
       
    88     WebCore::DocumentLoader* documentLoader();
       
    89     WebCore::DOMDocument* DOMDocument();
       
    90 
       
    91     bool isIframe() const;
       
    92     bool isFrameSet() const;
       
    93 
       
    94     void paintRect(WebCoreGraphicsContext& gc, const TRect& r);
       
    95 
       
    96     void notifyPluginsOfScrolling();
       
    97     void notifyPluginOfScrolling(WebCore::RenderObject* renderer);
       
    98     PluginSkin* focusedPlugin();
       
    99     WebFrame* frameAtPoint(const TPoint& pt_);
       
   100     
       
   101     // utility functions
       
   102     int imageCount(bool visibleOnly_);
       
   103     CArrayFixFlat<TBrCtlImageCarrier>* imageData(bool visibleOnly_);
       
   104     CArrayFixFlat<TBrCtlSubscribeTo>* findSubscribeTo();
       
   105 
       
   106     void scalingFactorChanged(int factor);
       
   107     void makeVisiblePlugins(TBool visible);
       
   108     bool executeScript(const WebCore::String& script);
       
   109     WebCore::Node* getClosestAnchorElement(const TPoint& pt, TPoint& newPos);
       
   110     
       
   111 private:
       
   112     WebFrame(const WebFrame&);                    // not implemented
       
   113     WebFrame& operator=(const WebFrame&);         // not implemented    
       
   114 
       
   115     WebFrameView*                   m_view;              // the frame view
       
   116     RefPtr<WebFrameLoaderClient>    m_loaderClient;      // the loader client
       
   117     WebFrameBridge*                 m_bridge;        // the bridge
       
   118 };
       
   119 
       
   120 // utility functions
       
   121 WebCore::Frame* core(const WebFrame*);
       
   122 WebFrame* kit(WebCore::Frame*);
       
   123 WebView* kit(WebCore::Page* page);
       
   124 WebFrame* mainFrame(WebFrame*);
       
   125 CBrCtl* control(WebCore::Frame*);
       
   126 CBrCtl* control(const WebFrame*);
       
   127 MWebCoreObjectWidget* widget(WebCore::Node*);
       
   128 MWebCoreObjectWidget* widget(WebCore::RenderObject*);
       
   129 
       
   130 #endif
       
   131 // END OF FILE