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 ;
}
2017-01-07 15:27:26 +02:00
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 :
2017-02-01 21:19:50 +02:00
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
2017-02-01 21:19:50 +02:00
QStringList debugFlags ( ) const ;
2017-01-15 23:59:15 +02:00
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 ( ) ;
2017-01-05 00:28:25 +02:00
void closeApplication ( ) ;
2017-01-16 14:07:49 -05:00
2016-12-30 16:25:27 -05:00
public slots :
void loadDefaultLayout ( ) override ;
2017-01-05 00:28:25 +02:00
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 ( ) ;
2017-01-22 13:29:40 +02:00
void dockLocationChanged ( ) ;
2017-01-16 14:07:49 -05:00
2017-01-07 15:27:26 +02:00
private slots :
2017-01-15 23:59:15 +02:00
void destroyedChanged ( bool destroyed ) ;
2017-01-07 15:27:26 +02:00
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 ;
2017-01-21 20:08:47 +02:00
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
2017-01-24 20:32:22 +02:00
bool m_activitiesStarting { true } ;
2017-02-01 21:19:50 +02:00
QStringList m_debugFlags ;
2017-01-05 00:28:25 +02:00
QHash < const Plasma : : Containment * , DockView * > m_dockViews ;
2017-01-15 23:59:15 +02:00
QHash < const Plasma : : Containment * , DockView * > m_waitingDockViews ;
2017-01-16 14:07:49 -05:00
2017-01-07 15:27:26 +02: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