| 1 |
// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
#include "iosdeviceorientation.h" |
| 5 |
#include "iosdeviceorientation_p.h" |
| 6 |
|
| 7 |
iOSDeviceOrientation::iOSDeviceOrientation(QObject *parent) |
| 8 |
: AbstractDeviceOrientation(parent) |
| 9 |
{ |
| 10 |
[[iOSDeviceOrientationP instance] setHandler:this]; |
| 11 |
} |
| 12 |
|
| 13 |
bool iOSDeviceOrientation::start() |
| 14 |
{ |
| 15 |
if (!m_enabled) { |
| 16 |
[[iOSDeviceOrientationP instance] start]; |
| 17 |
m_enabled = true; |
| 18 |
emit enabledChanged(m_enabled); |
| 19 |
} |
| 20 |
return true; |
| 21 |
} |
| 22 |
|
| 23 |
void iOSDeviceOrientation::stop() |
| 24 |
{ |
| 25 |
if (m_enabled) { |
| 26 |
[[iOSDeviceOrientationP instance] stop]; |
| 27 |
m_enabled = false; |
| 28 |
emit enabledChanged(m_enabled); |
| 29 |
} |
| 30 |
} |