webengine/osswebengine/WebKit/s60/webview/WebCursor.h
changeset 5 10e98eab6f85
parent 0 dd21522fd290
child 11 c8a366e56285
equal deleted inserted replaced
1:7c90e6132015 5:10e98eab6f85
    19 #define __WEBKITCURSOR_H__
    19 #define __WEBKITCURSOR_H__
    20 
    20 
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 #include "WebCoreWidget.h"
    22 #include "WebCoreWidget.h"
    23 #include "WebCannedImages.h"
    23 #include "WebCannedImages.h"
       
    24 #include "WebSprite.h"
    24 #include <w32std.h>
    25 #include <w32std.h>
    25 
    26 
    26 namespace WebCore {
    27 namespace WebCore {
    27     class IntRect;
    28     class IntRect;
    28     class IntPoint;
    29     class IntPoint;
    32 class WebView;
    33 class WebView;
    33 class WebFrame;
    34 class WebFrame;
    34 class CWindowGc;
    35 class CWindowGc;
    35 class WebFrame;
    36 class WebFrame;
    36 class CFbsBitmap;
    37 class CFbsBitmap;
       
    38 class CWebSprite;
    37 
    39 
    38 class WebCursor : public CBase
    40 class WebCursor : public CBase
    39     {
    41     {
    40     public: // constructors and destructors
    42     public: // constructors and destructors
    41 
    43 
    44 
    46 
    45     public:
    47     public:
    46 
    48 
    47         const TPoint& position() const { return m_pos; }
    49         const TPoint& position() const { return m_pos; }
    48         const TRect& nodeRect() const { return m_nodeRect; }
    50         const TRect& nodeRect() const { return m_nodeRect; }
    49         void setPosition(const TPoint& pt) { m_pos = pt; m_sprite.SetPosition(pt);}
    51         void setPosition(const TPoint& pt) { m_pos = pt;}
    50         void updatePositionAndElemType(const TPoint& pt);
    52         void updatePositionAndElemType(const TPoint& pt);
    51         void setCurrentView(WebView& view);
    53         void setCurrentView(WebView& view);
    52         void offsetCursor(const TPoint& offset);
    54         void offsetCursor(const TPoint& offset);
    53         bool isVisible() const { return m_visible; }
    55         bool isVisible() const { return m_visible; }
    54         void setCursorVisible(bool visible) { m_visible = visible; }
    56         void setCursorVisible(bool visible) { m_visible = visible; }
    64         void increaseTransparencyMoveCount();
    66         void increaseTransparencyMoveCount();
    65         void resetTransparency();
    67         void resetTransparency();
    66         void scrollAndMoveCursor(int dir, int scrollRange, bool auto);
    68         void scrollAndMoveCursor(int dir, int scrollRange, bool auto);
    67         WebFrame* getFrameUnderCursor();
    69         WebFrame* getFrameUnderCursor();
    68         bool navigableNodeUnderCursor(WebFrame& webFrame, TPoint& aPoint, TBrCtlDefs::TBrCtlElementType& aElType, TRect& aFocusRect) const;
    70         bool navigableNodeUnderCursor(WebFrame& webFrame, TPoint& aPoint, TBrCtlDefs::TBrCtlElementType& aElType, TRect& aFocusRect) const;
       
    71         WebFrame* getFrameAtPoint(const TPoint& viewPos_);
    69         
    72         
    70 
    73 
    71   private:
    74   private:
    72         void moveCursor(int lr,int tb, int scrollRange);
    75         void moveCursor(int lr,int tb, int scrollRange);
    73         WebFrame* getFrameAtPoint(const TPoint& viewPos_);
       
    74         bool determineCursorPosition(WebFrame& webFrame, TBrCtlDefs::TBrCtlElementType& aElType, TRect& aFocusRect, TRect& aSearchRect, 
    76         bool determineCursorPosition(WebFrame& webFrame, TBrCtlDefs::TBrCtlElementType& aElType, TRect& aFocusRect, TRect& aSearchRect, 
    75             TPoint& aCursorPosition, bool aInitialize);
    77             TPoint& aCursorPosition, bool aInitialize);
    76         void increaseSearchRect(int lr,int tb,TRect& aRect);
    78         void increaseSearchRect(int lr,int tb,TRect& aRect);
    77         bool decideCursorPosition(WebFrame& webFrame, const WebCore::IntRect& searchRect, WebCore::IntPoint& cursorPosition);
    79         bool decideCursorPosition(WebFrame& webFrame, const WebCore::IntRect& searchRect, WebCore::IntPoint& cursorPosition);
    78         WebFrame* calculateScrollableFrameView(TPoint& pos, TPoint& aPoint, TRect& fRect, bool autoscroll);
    80         WebFrame* calculateScrollableFrameView(TPoint& pos, TPoint& aPoint, TRect& fRect, bool autoscroll);
    83     private:
    85     private:
    84 
    86 
    85         WebCursor();
    87         WebCursor();
    86         void ConstructL();
    88         void ConstructL();
    87         TRect calcSearchRect(int lr, int tb, int scrollRange);
    89         TRect calcSearchRect(int lr, int tb, int scrollRange);
    88         void constructSprite();
    90         void constructSpriteL();
    89         
    91         
    90 
    92 
    91         TPoint                          m_pos;
    93         TPoint                          m_pos;
    92         int                             m_previousLr;
    94         int                             m_previousLr;
    93         int                             m_previousTb;
    95         int                             m_previousTb;
   101         //TCannedImageData                iSmartLinkPhoneImage;
   103         //TCannedImageData                iSmartLinkPhoneImage;
   102         //TCannedImageData                iSmartLinkEmailImage;
   104         //TCannedImageData                iSmartLinkEmailImage;
   103 
   105 
   104         WebView*                        m_view;
   106         WebView*                        m_view;
   105         bool                            m_visible;
   107         bool                            m_visible;
   106         RWsSprite                       m_sprite;
   108         
       
   109         CWebSprite*                     m_sprite;
   107         bool                            m_waiton;
   110         bool                            m_waiton;
   108         int                             m_flipcounter;
   111         int                             m_flipcounter;
   109         bool                            m_transparent;
   112         bool                            m_transparent;
   110         CFbsBitmap*                     m_transarrowmask;
   113         CFbsBitmap*                     m_transarrowmask;
   111         CPeriodic*                      m_transtimer;
   114         CPeriodic*                      m_transtimer;