2021-03-02 20:33:24 +03:00
/*
* Copyright 2021 Michail Vourlakos < mvourlakos @ gmail . com >
*
*
* This file is part of Latte - Dock and is a Fork of PlasmaCore : : IconItem
*
* 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/>.
*/
# ifndef CONTAINMENTLAYOUTMANAGER_H
# define CONTAINMENTLAYOUTMANAGER_H
//Qt
# include <QObject>
2021-03-03 21:17:58 +03:00
# include <QQmlPropertyMap>
2021-03-02 20:33:24 +03:00
# include <QQuickItem>
namespace Latte {
namespace Containment {
class LayoutManager : public QObject
{
Q_OBJECT
2021-03-03 21:17:58 +03:00
Q_PROPERTY ( QObject * plasmoidObj READ plasmoid ( ) WRITE setPlasmoid NOTIFY plasmoidChanged )
Q_PROPERTY ( QQuickItem * rootItem READ rootItem WRITE setRootItem NOTIFY rootItemChanged )
2021-03-02 20:33:24 +03:00
Q_PROPERTY ( QQuickItem * mainLayout READ mainLayout WRITE setMainLayout NOTIFY mainLayoutChanged )
Q_PROPERTY ( QQuickItem * startLayout READ startLayout WRITE setStartLayout NOTIFY startLayoutChanged )
Q_PROPERTY ( QQuickItem * endLayout READ endLayout WRITE setEndLayout NOTIFY endLayoutChanged )
2021-03-03 21:17:58 +03:00
Q_PROPERTY ( QQuickItem * metrics READ metrics WRITE setMetrics NOTIFY metricsChanged )
2021-03-02 20:33:24 +03:00
public :
LayoutManager ( QObject * parent = nullptr ) ;
2021-03-03 21:17:58 +03:00
QObject * plasmoid ( ) const ;
void setPlasmoid ( QObject * plasmoid ) ;
QQuickItem * rootItem ( ) const ;
void setRootItem ( QQuickItem * root ) ;
2021-03-02 20:33:24 +03:00
QQuickItem * mainLayout ( ) const ;
void setMainLayout ( QQuickItem * main ) ;
QQuickItem * startLayout ( ) const ;
void setStartLayout ( QQuickItem * start ) ;
QQuickItem * endLayout ( ) const ;
void setEndLayout ( QQuickItem * end ) ;
2021-03-03 21:17:58 +03:00
QQuickItem * metrics ( ) const ;
void setMetrics ( QQuickItem * metrics ) ;
2021-03-02 20:33:24 +03:00
public slots :
Q_INVOKABLE void moveAppletsInJustifyAlignment ( ) ;
2021-03-03 21:17:58 +03:00
Q_INVOKABLE void insertAtCoordinates ( QQuickItem * item , const int & x , const int & y ) ;
2021-03-02 20:33:24 +03:00
signals :
2021-03-03 21:17:58 +03:00
void plasmoidChanged ( ) ;
void rootItemChanged ( ) ;
2021-03-02 20:33:24 +03:00
void mainLayoutChanged ( ) ;
2021-03-03 21:17:58 +03:00
void metricsChanged ( ) ;
2021-03-02 20:33:24 +03:00
void startLayoutChanged ( ) ;
void endLayoutChanged ( ) ;
private :
2021-03-03 21:17:58 +03:00
bool insertAtLayoutCoordinates ( QQuickItem * layout , QQuickItem * item , int x , int y ) ;
private :
QQuickItem * m_rootItem { nullptr } ;
2021-03-02 20:33:24 +03:00
QQuickItem * m_mainLayout { nullptr } ;
QQuickItem * m_startLayout { nullptr } ;
QQuickItem * m_endLayout { nullptr } ;
2021-03-03 21:17:58 +03:00
QQuickItem * m_metrics { nullptr } ;
2021-03-02 20:33:24 +03:00
2021-03-03 21:17:58 +03:00
QObject * m_plasmoid { nullptr } ;
QQmlPropertyMap * m_configuration { nullptr } ;
2021-03-02 20:33:24 +03:00
} ;
}
}
# endif // CONTAINMENTLAYOUTMANAGER_H