File indexing completed on 2024-05-12 04:46:54

0001 #pragma once
0002 #include <QObject>
0003 #include <QQmlEngine>
0004 
0005 #include "mauikit_export.h"
0006 
0007 #include "abstractplatform.h"
0008 
0009 class MAUIKIT_EXPORT Platform : public AbstractPlatform
0010 {
0011     Q_OBJECT
0012      QML_ELEMENT
0013     QML_ATTACHED(Platform)
0014     QML_UNCREATABLE("Cannot be created Platform")
0015 public:
0016         explicit Platform(QObject *parent = nullptr);
0017 
0018     static Platform *qmlAttachedProperties(QObject *object);
0019     static Platform *instance()
0020     {
0021         if (m_instance)
0022             return m_instance;
0023 
0024         m_instance = new Platform;
0025         return m_instance;
0026     }
0027 
0028     Platform(const Platform &) = delete;
0029     Platform &operator=(const Platform &) = delete;
0030     Platform(Platform &&) = delete;
0031     Platform &operator=(Platform &&) = delete;
0032 
0033     // AbstractPlatform interface
0034 public Q_SLOTS:
0035     void shareFiles(const QList<QUrl> &urls) override final;
0036     void shareText(const QString &text) override final;
0037     bool hasKeyboard() override final;
0038     bool hasMouse() override final;    
0039     bool darkModeEnabled() override final;
0040 
0041 private:
0042     static Platform *m_instance;
0043 
0044     AbstractPlatform *m_platform;
0045 
0046 };