Revert "[CherryPick] Input Method upversion"
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / tizen / FocusRing.h
1 /*
2  * Copyright (C) 2012 Samsung Electronics
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library 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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef FocusRing_h
21 #define FocusRing_h
22
23 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
24
25 #include <Ecore.h>
26 #include <Evas.h>
27 #include <WebCore/IntPoint.h>
28 #include <WebCore/IntRect.h>
29 #include <wtf/PassOwnPtr.h>
30
31 class EwkViewImpl;
32
33 class FocusRing {
34 public:
35     static PassOwnPtr<FocusRing> create(Evas_Object* viewWidget)
36     {
37         return adoptPtr(new FocusRing(viewWidget));
38     }
39     ~FocusRing();
40
41     void setImageDrawing(bool);
42
43     void requestToShow(const WebCore::IntPoint&);
44
45     void show(const WebCore::IntRect&, const bool includeOnlyImage = false);
46     void hide(bool = true);
47
48     void updateScrollAndScale(const WebCore::IntPoint&, float);
49
50     const WebCore::IntRect& rect() { return m_rect; }
51     WebCore::IntPoint centerPointInScreen();
52
53 private:
54     static const int s_showTimerTime = 100;
55     static Eina_Bool showTimerCallback(void* data);
56
57     static const int s_imageOuterWidth;
58     static const int s_imageInnerWidth;
59
60 private:
61     FocusRing(Evas_Object* viewWidget);
62     void internalShow(bool, const WebCore::IntRect&);
63
64     Evas_Object* m_viewWidget;
65     EwkViewImpl* m_viewImpl;
66
67     Evas_Object* m_focusRingObject;
68     bool m_isImageDrawing;
69
70     Ecore_Timer* m_showTimer;
71     WebCore::IntPoint m_position;
72
73     WebCore::IntRect m_rect;
74 };
75
76 #endif // #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
77
78 #endif // FocusRing_h