~osomon/oxide/override-touchUngrabEvent

« back to all changes in this revision

Viewing changes to qt/core/glue/oxide_qt_touch_handle_drawable_proxy.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_GLUE_TOUCH_HANDLE_DRAWABLE_PROXY_H_
 
19
#define _OXIDE_QT_CORE_GLUE_TOUCH_HANDLE_DRAWABLE_PROXY_H_
 
20
 
 
21
#include <QRectF>
 
22
#include <QtGlobal>
 
23
 
 
24
QT_BEGIN_NAMESPACE
 
25
class QPointF;
 
26
QT_END_NAMESPACE
 
27
 
 
28
namespace oxide {
 
29
namespace qt {
 
30
 
 
31
class TouchHandleDrawableProxy {
 
32
 public:
 
33
  // Matches chromium’s ui::TouchHandleOrientation
 
34
  enum Orientation {
 
35
    Left,
 
36
    Center,
 
37
    Right,
 
38
    Undefined,
 
39
  };
 
40
 
 
41
  virtual ~TouchHandleDrawableProxy() {}
 
42
 
 
43
  virtual void SetEnabled(bool enabled) = 0;
 
44
  virtual void SetOrientation(Orientation orientation,
 
45
                              bool mirror_vertical,
 
46
                              bool mirror_horizontal) = 0;
 
47
  virtual void SetOrigin(const QPointF& origin) = 0;
 
48
  virtual void SetAlpha(float alpha) = 0;
 
49
  virtual QRectF GetVisibleBounds() const = 0;
 
50
  virtual float GetDrawableHorizontalPaddingRatio() const = 0;
 
51
};
 
52
 
 
53
} // namespace qt
 
54
} // namespace oxide
 
55
 
 
56
#endif // _OXIDE_QT_CORE_GLUE_TOUCH_HANDLE_DRAWABLE_PROXY_H_