summaryrefslogtreecommitdiff
path: root/external/plyer/facades/orientation.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/plyer/facades/orientation.py')
-rw-r--r--external/plyer/facades/orientation.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/external/plyer/facades/orientation.py b/external/plyer/facades/orientation.py
new file mode 100644
index 0000000..e58e723
--- /dev/null
+++ b/external/plyer/facades/orientation.py
@@ -0,0 +1,45 @@
+class Orientation(object):
+ '''Orientation facade.
+
+ .. note::
+ These settings are generally guidelines, the operating
+ system may choose to ignore them, or they may be overridden by
+ other system components.
+
+ .. versionadded:: 1.2.4
+ '''
+
+ def set_landscape(self, reverse=False):
+ '''Rotate the app to a landscape orientation.
+
+ :param reverse: If True, uses the opposite of the natural
+ orientation.
+ '''
+ self._set_landscape(reverse=reverse)
+
+ def _set_landscape(self, **kwargs):
+ raise NotImplementedError()
+
+ def set_portrait(self, reverse=False):
+ '''Rotate the app to a portrait orientation.
+
+ :param reverse: If True, uses the opposite of the natural
+ orientation.
+ '''
+ self._set_portrait(reverse=reverse)
+
+ def _set_portrait(self, **kwargs):
+ raise NotImplementedError()
+
+ def set_sensor(self, mode='any'):
+ '''Rotate freely following sensor information from the device.
+
+ :param mode: The rotation mode, should be one of 'any' (rotate
+ to any orientation), 'landscape' (choose nearest
+ landscape mode) or 'portrait' (choose nearest
+ portrait mode). Defaults to 'any'.
+ '''
+ self._set_sensor(mode=mode)
+
+ def _set_sensor(self, **kwargs):
+ raise NotImplementedError()