1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-09 00:58:15 +03:00
latte-dock/app/dockcorona.h

99 lines
2.6 KiB
C
Raw Normal View History

2017-01-02 17:05:30 -05:00
/*
* Copyright 2016 Smith AR <audoban@openmailbox.org>
* Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2016-12-30 16:25:27 -05:00
#ifndef NOWDOCKCORONA_H
#define NOWDOCKCORONA_H
#include "dockview.h"
#include <QObject>
2017-01-29 00:16:28 -05:00
#include <KAboutApplicationDialog>
2016-12-30 16:25:27 -05:00
namespace Plasma {
class Corona;
class Containment;
class Types;
}
namespace KActivities {
class Consumer;
}
2016-12-30 16:25:27 -05:00
namespace Latte {
class DockCorona : public Plasma::Corona {
Q_OBJECT
2017-01-16 14:07:49 -05:00
2016-12-30 16:25:27 -05:00
public:
DockCorona(QStringList debugFlags = QStringList(), QObject *parent = nullptr);
2016-12-30 16:25:27 -05:00
virtual ~DockCorona();
2017-01-16 14:07:49 -05:00
2016-12-30 16:25:27 -05:00
int numScreens() const override;
QRect screenGeometry(int id) const override;
QRegion availableScreenRegion(int id) const override;
QRect availableScreenRect(int id) const override;
2017-01-16 14:07:49 -05:00
2016-12-30 16:25:27 -05:00
QList<Plasma::Types::Location> freeEdges(int screen) const;
2017-01-16 14:07:49 -05:00
QStringList debugFlags() const;
int docksCount(int screen) const;
2016-12-30 16:25:27 -05:00
int screenForContainment(const Plasma::Containment *containment) const override;
2017-01-16 14:07:49 -05:00
2016-12-30 16:25:27 -05:00
void addDock(Plasma::Containment *containment);
2017-01-16 14:07:49 -05:00
2017-01-29 00:16:28 -05:00
void aboutApplication();
void closeApplication();
2017-01-16 14:07:49 -05:00
2016-12-30 16:25:27 -05:00
public slots:
void loadDefaultLayout() override;
void dockContainmentDestroyed(QObject *cont);
2017-01-16 14:07:49 -05:00
2016-12-30 16:25:27 -05:00
signals:
void configurationShown(PlasmaQuick::ConfigView *configView);
2017-01-16 13:24:46 -05:00
void docksCountChanged();
void dockLocationChanged();
2017-01-16 14:07:49 -05:00
private slots:
void destroyedChanged(bool destroyed);
void load();
2017-01-16 14:07:49 -05:00
2016-12-30 16:25:27 -05:00
private:
2017-02-05 20:55:41 -05:00
bool appletExists(uint containmentId, uint appletId) const;
void cleanConfig();
2017-02-05 20:55:41 -05:00
bool containmentExists(uint id) const;
2016-12-30 16:25:27 -05:00
void qmlRegisterTypes() const;
int primaryScreenId() const;
2017-01-16 14:07:49 -05:00
bool m_activitiesStarting{true};
QStringList m_debugFlags;
QHash<const Plasma::Containment *, DockView *> m_dockViews;
QHash<const Plasma::Containment *, DockView *> m_waitingDockViews;
2017-01-16 14:07:49 -05:00
KActivities::Consumer *m_activityConsumer;
2017-01-29 00:16:28 -05:00
QPointer<KAboutApplicationDialog> aboutDialog;
2016-12-30 16:25:27 -05:00
};
}
#endif