Libksysguard

sensorfacepackage.cpp
1 /******************************************************************************
2 * Copyright 2007-2009 by Aaron Seigo <[email protected]> *
3 * Copyright 2020 by Marco Martin <[email protected]> *
4 * *
5 * This library is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU Library General Public *
7 * License as published by the Free Software Foundation; either *
8 * version 2 of the License, or (at your option) any later version. *
9 * *
10 * This library is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13 * Library General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU Library General Public License *
16 * along with this library; see the file COPYING.LIB. If not, write to *
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
18 * Boston, MA 02110-1301, USA. *
19 *******************************************************************************/
20 
21 #include <KLocalizedString>
22 #include <kpackage/package.h>
23 #include <kpackage/packagestructure.h>
24 
25 class SensorFacePackage : public KPackage::PackageStructure
26 {
27  Q_OBJECT
28 public:
29  SensorFacePackage(QObject *parent = nullptr, const QVariantList &args = QVariantList()) : KPackage::PackageStructure(parent, args) {}
30 
31  void initPackage(KPackage::Package *package) override
32  {
33  package->setDefaultPackageRoot(QStringLiteral("ksysguard/sensorfaces"));
34 
35  package->addDirectoryDefinition("ui", QStringLiteral("ui"), i18n("User Interface"));
36 
37  package->addFileDefinition("CompactRepresentation", QStringLiteral("ui/CompactRepresentation.qml"), i18n("The compact representation of the sensors plasmoid when collapsed, for instance in a panel."));
38  package->setRequired("CompactRepresentation", true);
39 
40  package->addFileDefinition("FullRepresentation", QStringLiteral("ui/FullRepresentation.qml"), i18n("The representation of the plasmoid when it's fully expanded."));
41  package->setRequired("FullRepresentation", true);
42 
43  package->addFileDefinition("ConfigUI", QStringLiteral("ui/Config.qml"), i18n("The optional configuration page for this face."));
44 
45  package->addDirectoryDefinition("config", QStringLiteral("config"), i18n("Configuration support"));
46  package->addFileDefinition("mainconfigxml", QStringLiteral("config/main.xml"), i18n("KConfigXT xml file for face-specific configuration options."));
47 
48  package->addFileDefinition("FaceProperties", QStringLiteral("faceproperties"), i18n("The configuration file that describes face properties and capabilities."));
49  package->setRequired("FaceProperties", true);
50  }
51 };
52 
53 K_EXPORT_KPACKAGE_PACKAGE_WITH_JSON(SensorFacePackage, "sensorface-packagestructure.json")
54 
55 #include "sensorfacepackage.moc"
void addFileDefinition(const QByteArray &key, const QString &path, const QString &name)
void addDirectoryDefinition(const QByteArray &key, const QString &path, const QString &name)
void setDefaultPackageRoot(const QString &packageRoot)
virtual void initPackage(Package *package)
Q_OBJECTQ_OBJECT
QString i18n(const char *text, const TYPE &arg...)
void setRequired(const QByteArray &key, bool required)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Mar 2 2021 02:46:14 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.