Warning, file /plasma/plasma-welcome/src/controller.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Felipe Kinoshita <kinofhek@gmail.com> 0003 * SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 #pragma once 0009 0010 #include "plasma-welcome-version.h" 0011 #include <QObject> 0012 #include <QVersionNumber> 0013 #include <qqmlregistration.h> 0014 0015 class Controller : public QObject 0016 { 0017 Q_OBJECT 0018 QML_ELEMENT 0019 QML_SINGLETON 0020 0021 public: 0022 Controller(); 0023 0024 Q_INVOKABLE static void launchApp(const QString &program); 0025 Q_INVOKABLE static void runCommand(const QString &command); 0026 Q_INVOKABLE static void runCommand(const QString &command, const QString &desktopFilename); 0027 Q_INVOKABLE bool networkAlreadyConnected(); 0028 Q_INVOKABLE bool userFeedbackAvailable(); 0029 Q_INVOKABLE QStringList distroPages(); 0030 Q_INVOKABLE QString distroName(); 0031 Q_INVOKABLE QString distroIcon(); 0032 Q_INVOKABLE QString distroUrl(); 0033 Q_INVOKABLE QString installPrefix(); 0034 0035 Q_PROPERTY(Mode mode MEMBER m_mode CONSTANT) 0036 Q_PROPERTY(QString shownVersion MEMBER m_shownVersion CONSTANT) 0037 Q_PROPERTY(int patchVersion MEMBER m_patchVersion CONSTANT) 0038 Q_PROPERTY(QString releaseUrl MEMBER m_releaseUrl CONSTANT) 0039 Q_PROPERTY(QString customIntroText MEMBER m_customIntroText CONSTANT) 0040 Q_PROPERTY(QString customIntroIcon MEMBER m_customIntroIcon CONSTANT) 0041 Q_PROPERTY(QString customIntroIconLink MEMBER m_customIntroIconLink CONSTANT) 0042 Q_PROPERTY(QString customIntroIconCaption MEMBER m_customIntroIconCaption CONSTANT) 0043 0044 enum Mode { Update, Beta, Live, Welcome }; 0045 Q_ENUM(Mode) 0046 0047 void setMode(Mode mode); 0048 0049 Q_SIGNALS: 0050 void modeChanged(); 0051 0052 private: 0053 Mode m_mode = Mode::Welcome; 0054 QVersionNumber m_version; 0055 QString m_shownVersion; 0056 int m_patchVersion; 0057 QString m_releaseUrl; 0058 QString m_customIntroText; 0059 QString m_customIntroIcon; 0060 QString m_customIntroIconLink; 0061 QString m_customIntroIconCaption; 0062 };