1 /* 2 Copyright 2006-2019 The QElectroTech Team 3 This file is part of QElectroTech. 4 5 QElectroTech is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 2 of the License, or 8 (at your option) any later version. 9 10 QElectroTech 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 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 #ifndef PROPERTIESINTERFACE_H 19 #define PROPERTIESINTERFACE_H 20 21 #include <QString> 22 #include <QSettings> 23 #include <QDomElement> 24 25 /** 26 * @brief The PropertiesInterface class 27 * This class is an interface for have common way to use properties in QElectroTech 28 */ 29 class PropertiesInterface 30 { 31 public: 32 PropertiesInterface(); 33 // Save/load properties to setting file. QString is use for prefix a word befor the name of each paramètre 34 virtual void toSettings (QSettings &settings, const QString = QString()) const =0; 35 virtual void fromSettings (const QSettings &settings, const QString = QString()) =0; 36 // Save/load properties to xml element 37 virtual void toXml (QDomElement &xml_element) const =0; 38 virtual void fromXml (const QDomElement &xml_element) =0; 39 }; 40 41 #endif // PROPERTIESINTERFACE_H 42