2020-08-12 12:02:46 +03:00
/*
* Copyright 2020 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/>.
*/
# ifndef TEMPLATESMANAGER_H
# define TEMPLATESMANAGER_H
// local
# include "../lattecorona.h"
# include "../data/layoutdata.h"
2020-08-12 12:27:35 +03:00
# include "../data/layoutstable.h"
2020-08-12 12:02:46 +03:00
// Qt
# include <QObject>
2020-08-13 20:42:38 +03:00
// KDE
# include <KLocalizedString>
2020-08-12 12:02:46 +03:00
namespace Latte {
class Corona ;
}
namespace Latte {
namespace Templates {
2020-08-12 12:55:43 +03:00
const char DEFAULTLAYOUTTEMPLATENAME [ ] = " Default " ;
const char EMPTYLAYOUTTEMPLATENAME [ ] = " Empty " ;
2020-08-12 12:02:46 +03:00
class Manager : public QObject
{
Q_OBJECT
public :
Manager ( Latte : : Corona * corona = nullptr ) ;
~ Manager ( ) override ;
Latte : : Corona * corona ( ) ;
void init ( ) ;
2020-08-12 13:42:45 +03:00
Data : : Layout layoutTemplateForName ( const QString & layoutName ) ;
2020-08-12 18:56:46 +03:00
Data : : LayoutsTable systemLayoutTemplates ( ) ;
2020-08-13 21:28:52 +03:00
//! creates a new layout with layoutName based on specific layout template and returns the new layout path
2020-08-13 20:42:38 +03:00
QString newLayout ( QString layoutName , QString layoutTemplate = i18n ( DEFAULTLAYOUTTEMPLATENAME ) ) ;
2020-08-14 09:57:39 +03:00
void importSystemLayouts ( ) ;
2020-08-13 21:28:52 +03:00
signals :
void newLayoutAdded ( const QString & path ) ;
2020-08-12 12:02:46 +03:00
private :
void exposeTranslatedTemplateNames ( ) ;
private :
Latte : : Corona * m_corona ;
2020-08-12 12:27:35 +03:00
Data : : LayoutsTable m_layoutTemplates ;
2020-08-12 12:02:46 +03:00
} ;
}
}
# endif //TEMPLATESMANAGER_H