Lomiri
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>

Inherits QObject.

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.

23 : QObject(parent)
24 , m_enabled(false)
25 , m_savedOrientation(Qt::PortraitOrientation)
26{
27 m_systemSettings = g_settings_new("com.lomiri.touch.system");
28 g_signal_connect(m_systemSettings, "changed::rotation-lock",
29 G_CALLBACK(OrientationLock::onEnabledChangedProxy), this);
30 m_enabled = g_settings_get_boolean(m_systemSettings, "rotation-lock");
31}

◆ ~OrientationLock()

OrientationLock::~OrientationLock ( )

Definition at line 33 of file orientationlock.cpp.

34{
35 g_signal_handlers_disconnect_by_data(m_systemSettings, this);
36 g_object_unref(m_systemSettings);
37}

Member Function Documentation

◆ enabled()

bool OrientationLock::enabled ( ) const

Definition at line 39 of file orientationlock.cpp.

40{
41 return m_enabled;
42}

◆ savedOrientation()

Qt::ScreenOrientation OrientationLock::savedOrientation ( ) const

Definition at line 44 of file orientationlock.cpp.

45{
46 return m_savedOrientation;
47}

◆ setSavedOrientation()

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

Definition at line 64 of file orientationlock.cpp.

65{
66 if (orientation == m_savedOrientation) {
67 return;
68 }
69
70 m_savedOrientation = orientation;
71
72 //TODO - save value with dbus to persist over sessions
73 Q_EMIT savedOrientationChanged();
74}

Property Documentation

◆ enabled

bool OrientationLock::enabled
read

Definition at line 33 of file orientationlock.h.

◆ savedOrientation

Qt::ScreenOrientation OrientationLock::savedOrientation
readwrite

Definition at line 34 of file orientationlock.h.


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