MauiKit Controls

platform.h
1#pragma once
2#include <QObject>
3#include <QQmlEngine>
4
5#include "mauikit_export.h"
6
7#include "abstractplatform.h"
8
9class MAUIKIT_EXPORT Platform : public AbstractPlatform
10{
11 Q_OBJECT
12 QML_ELEMENT
13 QML_ATTACHED(Platform)
14 QML_UNCREATABLE("Cannot be created Platform")
15public:
16 explicit Platform(QObject *parent = nullptr);
17
18 static Platform *qmlAttachedProperties(QObject *object);
19 static Platform *instance()
20 {
21 if (m_instance)
22 return m_instance;
23
24 m_instance = new Platform;
25 return m_instance;
26 }
27
28 Platform(const Platform &) = delete;
29 Platform &operator=(const Platform &) = delete;
30 Platform(Platform &&) = delete;
31 Platform &operator=(Platform &&) = delete;
32
33 // AbstractPlatform interface
34public Q_SLOTS:
35 void shareFiles(const QList<QUrl> &urls) override final;
36 void shareText(const QString &text) override final;
37 bool hasKeyboard() override final;
38 bool hasMouse() override final;
39 bool darkModeEnabled() override final;
40
41private:
42 static Platform *m_instance;
43
44 AbstractPlatform *m_platform;
45
46};
The AbstractPlatform class Defines abstract methods and properties that are common to be implemeted b...
virtual void shareText(const QString &urls)=0
shareText
virtual void shareFiles(const QList< QUrl > &urls)=0
shareFiles
virtual bool hasKeyboard()=0
hasKeyboard
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.