2 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
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.
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.
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
19 #ifndef SelectionOverlay_h
20 #define SelectionOverlay_h
22 #include "BlackBerryGlobal.h"
24 #if USE(ACCELERATED_COMPOSITING)
27 #include "GraphicsLayerClient.h"
28 #include "WebOverlay.h"
29 #include "WebSelectionOverlay.h"
31 #include <BlackBerryPlatformIntRectRegion.h>
32 #include <wtf/OwnPtr.h>
34 namespace BlackBerry {
39 class SelectionOverlay : public WebSelectionOverlay, public WebCore::GraphicsLayerClient {
41 static SelectionOverlay* create(WebPagePrivate* page)
43 return new SelectionOverlay(page);
46 virtual ~SelectionOverlay();
48 virtual void draw(const Platform::IntRectRegion&);
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; }
61 SelectionOverlay(WebPagePrivate*);
63 WebPagePrivate* m_page;
64 OwnPtr<WebOverlay> m_overlay;
65 BlackBerry::Platform::IntRectRegion m_region;
66 bool m_hideDispatched;
70 } // namespace BlackBerry
72 #endif // USE(ACCELERATED_COMPOSITING)
74 #endif // SelectionOverlay_h