File indexing completed on 2024-05-19 05:34:38

0001 /*
0002     SPDX-FileCopyrightText: 2014 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #ifndef CORONATEST_H
0007 #define CORONATEST_H
0008 
0009 #include <QTest>
0010 
0011 #include <QTimer>
0012 
0013 #include "plasma/corona.h"
0014 #include "plasma/pluginloader.h"
0015 
0016 class SimpleCorona : public Plasma::Corona
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     explicit SimpleCorona(QObject *parent = nullptr);
0022     ~SimpleCorona() override;
0023 
0024     QRect screenGeometry(int) const override;
0025     int screenForContainment(const Plasma::Containment *) const override;
0026 };
0027 
0028 class SimpleApplet : public Plasma::Applet
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033     explicit SimpleApplet(QObject *parentObject, const KPluginMetaData &data, const QVariantList &args);
0034 
0035 private:
0036     QTimer m_timer;
0037 };
0038 
0039 class SimpleContainment : public Plasma::Containment
0040 {
0041     Q_OBJECT
0042 
0043 public:
0044     explicit SimpleContainment(QObject *parentObject, const KPluginMetaData &data, const QVariantList &args);
0045 
0046 private:
0047     QTimer m_timer;
0048 };
0049 
0050 class SimpleNoScreenContainment : public Plasma::Containment
0051 {
0052     Q_OBJECT
0053 
0054 public:
0055     explicit SimpleNoScreenContainment(QObject *parentObject, const KPluginMetaData &data, const QVariantList &args);
0056 };
0057 
0058 class CoronaTest : public QObject
0059 {
0060     Q_OBJECT
0061 
0062 public Q_SLOTS:
0063     void initTestCase();
0064     void cleanupTestCase();
0065 
0066 private Q_SLOTS:
0067     void restore();
0068     void checkOrder();
0069     void startupCompletion();
0070     void addRemoveApplets();
0071     void immutability();
0072 
0073 private:
0074     SimpleCorona *m_corona;
0075     QDir m_configDir;
0076 };
0077 
0078 #endif