~osomon/oxide/override-touchUngrabEvent

« back to all changes in this revision

Viewing changes to qt/core/browser/oxide_qt_touch_handle_drawable.h

  • Committer: Olivier Tilloy
  • Date: 2016-01-12 11:46:34 UTC
  • mfrom: (1272.2.38 touch-selection-api)
  • Revision ID: olivier.tilloy@canonical.com-20160112114634-u1t78baa0u4hfoha
Add a touch selection API, to allow embedders to display handles for resizing the current selection, and contextual actions for it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vim:expandtab:shiftwidth=2:tabstop=2:
 
2
// Copyright (C) 2015-2016 Canonical Ltd.
 
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.1 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
#ifndef _OXIDE_QT_CORE_BROWSER_TOUCH_HANDLE_DRAWABLE_H_
 
19
#define _OXIDE_QT_CORE_BROWSER_TOUCH_HANDLE_DRAWABLE_H_
 
20
 
 
21
#include "base/memory/scoped_ptr.h"
 
22
#include "ui/touch_selection/touch_handle.h"
 
23
 
 
24
namespace oxide {
 
25
namespace qt {
 
26
 
 
27
class TouchHandleDrawableProxy;
 
28
class WebView;
 
29
 
 
30
class TouchHandleDrawable : public ui::TouchHandleDrawable {
 
31
 public:
 
32
  TouchHandleDrawable(const WebView* view);
 
33
 
 
34
  void SetProxy(TouchHandleDrawableProxy* proxy);
 
35
 
 
36
 private:
 
37
  ~TouchHandleDrawable() override;
 
38
 
 
39
  // ui::TouchHandleDrawable implementation
 
40
  void SetEnabled(bool enabled) override;
 
41
  void SetOrientation(ui::TouchHandleOrientation orientation,
 
42
                      bool mirror_vertical,
 
43
                      bool mirror_horizontal) override;
 
44
  void SetOrigin(const gfx::PointF& origin) override;
 
45
  void SetAlpha(float alpha) override;
 
46
  gfx::RectF GetVisibleBounds() const override;
 
47
  float GetDrawableHorizontalPaddingRatio() const override;
 
48
 
 
49
  scoped_ptr<TouchHandleDrawableProxy> proxy_;
 
50
  const WebView* view_;
 
51
};
 
52
 
 
53
} // namespace qt
 
54
} // namespace oxide
 
55
 
 
56
#endif // _OXIDE_QT_CORE_BROWSER_TOUCH_HANDLE_DRAWABLE_H_