File indexing completed on 2024-11-24 04:19:36

0001 #pragma once
0002 
0003 #include <QObject>
0004 #include "modules/accessibilitymanager.h"
0005 
0006 class Accessibility : public QObject
0007 {
0008     Q_OBJECT
0009     Q_PROPERTY(bool singleClick READ singleClick WRITE setSingleClick NOTIFY singleClickChanged)
0010     Q_PROPERTY(uint scrollBarPolicy READ scrollBarPolicy WRITE setScrollBarPolicy NOTIFY scrollBarPolicyChanged)
0011     Q_PROPERTY(bool playSounds READ playSounds WRITE setPlaySounds NOTIFY playSoundsChanged)
0012 
0013 public:
0014     explicit Accessibility(QObject *parent = nullptr);
0015 
0016     bool singleClick() const;
0017     void setSingleClick(bool singleClick);
0018 
0019     /**
0020      * @brief scrollBarPolicy
0021      * The policy values are:
0022      * 0- AlwaysVisible
0023      * 1- AsNeeded
0024      * 2- Hidden
0025      * 3- AutoHide
0026      * @return
0027      */
0028     uint scrollBarPolicy() const;
0029     void setScrollBarPolicy(uint newScrollBarPolicy);
0030 
0031     bool playSounds() const;
0032     void setPlaySounds(bool newPlaySounds);
0033 
0034 private:
0035     bool m_singleClick = MauiMan::AccessibilityManager::DefaultValues::singleClick;
0036     uint m_scrollBarPolicy = MauiMan::AccessibilityManager::DefaultValues::scrollBarPolicy;
0037     bool m_playSounds = MauiMan::AccessibilityManager::DefaultValues::playSounds;
0038 
0039 Q_SIGNALS:
0040     void singleClickChanged(bool);
0041     void scrollBarPolicyChanged(uint);
0042     void playSoundsChanged(bool);
0043 };
0044