up spin button is now shown
[framework/web/webkit-efl.git] / Source / WebKit / blackberry / WebKitSupport / SelectionOverlay.h
1 /*
2  * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18
19 #ifndef SelectionOverlay_h
20 #define SelectionOverlay_h
21
22 #include "BlackBerryGlobal.h"
23
24 #if USE(ACCELERATED_COMPOSITING)
25
26 #include "Color.h"
27 #include "GraphicsLayerClient.h"
28 #include "WebOverlay.h"
29 #include "WebSelectionOverlay.h"
30
31 #include <BlackBerryPlatformIntRectRegion.h>
32 #include <wtf/OwnPtr.h>
33
34 namespace BlackBerry {
35 namespace WebKit {
36
37 class WebPagePrivate;
38
39 class SelectionOverlay : public WebSelectionOverlay, public WebCore::GraphicsLayerClient {
40 public:
41     static SelectionOverlay* create(WebPagePrivate* page)
42     {
43         return new SelectionOverlay(page);
44     }
45
46     virtual ~SelectionOverlay();
47
48     virtual void draw(const Platform::IntRectRegion&);
49     virtual void hide();
50
51     // GraphicsLayerClient
52     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) { }
53     virtual void notifySyncRequired(const WebCore::GraphicsLayer*);
54     virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& inClip);
55     virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const { return false; }
56     virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const { return false; }
57     virtual bool contentsVisible(const WebCore::GraphicsLayer*, const WebCore::IntRect& contentRect) const { return true; }
58
59
60 private:
61     SelectionOverlay(WebPagePrivate*);
62
63     WebPagePrivate* m_page;
64     OwnPtr<WebOverlay> m_overlay;
65     BlackBerry::Platform::IntRectRegion m_region;
66     bool m_hideDispatched;
67 };
68
69 } // namespace WebKit
70 } // namespace BlackBerry
71
72 #endif // USE(ACCELERATED_COMPOSITING)
73
74 #endif // SelectionOverlay_h