on ff2ea35 help sign in
44 lines 1.4 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17#ifndef DIRECTION_H
18#define DIRECTION_H
20#include "UbuntuGesturesGlobal.h"
21#include <QObject>
23/*
24 A Direction enum wrapper so that we can do things like "direction: Direction.Righwards"
25 from QML.
26 */
27class UBUNTUGESTURES_EXPORT Direction : public QObject {
28 Q_OBJECT
29 Q_ENUMS(Type)
31public:
32 enum Type {
33 Rightwards, // Along the positive direction of the X axis
34 Leftwards, // Along the negative direction of the X axis
35 Downwards, // Along the positive direction of the Y axis
36 Upwards // Along the negative direction of the Y axis
37 };
39 Q_INVOKABLE static bool isHorizontal(Direction::Type type);
40 Q_INVOKABLE static bool isVertical(Direction::Type type);
41 Q_INVOKABLE static bool isPositive(Direction::Type type);
42};
44#endif // DIRECTION_H