Loading...
Searching...
No Matches
OrientationLock Class Reference

The OrientationLock class exports orientation lock related properties to QML It has two properties: More...

`#include <plugins/Lomiri/Session/orientationlock.h>`

## Signals

void | enabledChanged ()
void | savedOrientationChanged ()

## Public Member Functions

| OrientationLock (QObject *parent=0)
bool | enabled () const
Qt::ScreenOrientation | savedOrientation () const
void | setSavedOrientation (const Qt::ScreenOrientation orientation)

## Properties

bool | enabled
Qt::ScreenOrientation | savedOrientation

## Detailed Description

The OrientationLock class exports orientation lock related properties to QML It has two properties:

- readonly boolean with the Orientation lock property state
- Qt::ScreenOrientation to save the locked orientation state across Sessions (only relevant if lock is true)

Definition at line 29 of file orientationlock.h.

## Constructor & Destructor Documentation

## OrientationLock()

OrientationLock::OrientationLock | ( | QObject * | parent = 0 | ) |

explicit

Definition at line 22 of file orientationlock.cpp.

: QObject(parent)
, m_enabled(false)
, m_savedOrientation(Qt::PortraitOrientation)
{
m_systemSettings = g_settings_new("com.lomiri.touch.system");
g_signal_connect(m_systemSettings, "changed::rotation-lock",
G_CALLBACK(OrientationLock::onEnabledChangedProxy), this);
m_enabled = g_settings_get_boolean(m_systemSettings, "rotation-lock");
}

## ~OrientationLock()

OrientationLock::~OrientationLock | ( |  | ) |

Definition at line 33 of file orientationlock.cpp.

{
g_signal_handlers_disconnect_by_data(m_systemSettings, this);
g_object_unref(m_systemSettings);
}

## Member Function Documentation

## enabled()

bool OrientationLock::enabled | ( |  | ) | const

Definition at line 39 of file orientationlock.cpp.

{
return m_enabled;
}

## savedOrientation()

Qt::ScreenOrientation OrientationLock::savedOrientation | ( |  | ) | const

Definition at line 44 of file orientationlock.cpp.

{
return m_savedOrientation;
}

## setSavedOrientation()

void OrientationLock::setSavedOrientation | ( | const Qt::ScreenOrientation | orientation | ) |

Definition at line 64 of file orientationlock.cpp.

{
if (orientation == m_savedOrientation) {
return;
}
m_savedOrientation = orientation;
//TODO - save value with dbus to persist over sessions
Q_EMIT savedOrientationChanged();
}

## Property Documentation

## enabled

bool OrientationLock::enabled

read

Definition at line 33 of file orientationlock.h.

## savedOrientation

Qt::ScreenOrientation OrientationLock::savedOrientation

read write

Definition at line 34 of file orientationlock.h.

The documentation for this class was generated from the following files:

- plugins/Lomiri/Session/orientationlock.h
- plugins/Lomiri/Session/orientationlock.cpp