2014-04-11 09:51:21 +00:00
|
|
|
/*
|
2023-01-01 17:05:57 +01:00
|
|
|
Copyright 2006-2023 The QElectroTech Team
|
2020-10-17 20:25:30 +02:00
|
|
|
This file is part of QElectroTech.
|
2014-04-11 09:51:21 +00:00
|
|
|
|
2020-10-17 20:25:30 +02:00
|
|
|
QElectroTech 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.
|
2014-04-11 09:51:21 +00:00
|
|
|
|
2020-10-17 20:25:30 +02:00
|
|
|
QElectroTech 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.
|
2014-04-11 09:51:21 +00:00
|
|
|
|
2020-10-17 20:25:30 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
2014-04-11 09:51:21 +00:00
|
|
|
*/
|
|
|
|
#ifndef PROPERTIESINTERFACE_H
|
|
|
|
#define PROPERTIESINTERFACE_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QSettings>
|
|
|
|
#include <QDomElement>
|
|
|
|
|
|
|
|
/**
|
2020-10-17 20:25:30 +02:00
|
|
|
@brief The PropertiesInterface class
|
|
|
|
This class is an interface for have common way
|
|
|
|
to use properties in QElectroTech
|
2020-07-19 20:05:13 +02:00
|
|
|
*/
|
2014-04-11 09:51:21 +00:00
|
|
|
class PropertiesInterface
|
|
|
|
{
|
2020-10-17 20:25:30 +02:00
|
|
|
public:
|
2021-03-11 19:52:50 +01:00
|
|
|
PropertiesInterface();
|
2020-10-17 20:25:30 +02:00
|
|
|
virtual ~PropertiesInterface();
|
|
|
|
/**
|
|
|
|
@brief toSettings
|
|
|
|
Save properties to setting file.
|
|
|
|
@param settings : is use for prefix a word
|
2022-12-04 08:21:12 -05:00
|
|
|
before the name of each parameter
|
2020-10-17 20:25:30 +02:00
|
|
|
@param QString
|
|
|
|
*/
|
2021-03-11 19:52:50 +01:00
|
|
|
virtual void toSettings (QSettings &settings,
|
|
|
|
const QString = QString()) const =0;
|
2020-10-17 20:25:30 +02:00
|
|
|
/**
|
|
|
|
@brief fromSettings
|
|
|
|
load properties to setting file.
|
|
|
|
@param settings : is use for prefix a word
|
2022-12-04 08:21:12 -05:00
|
|
|
before the name of each parameter
|
2020-10-17 20:25:30 +02:00
|
|
|
@param QString
|
|
|
|
*/
|
2021-03-11 19:52:50 +01:00
|
|
|
virtual void fromSettings (const QSettings &settings,
|
|
|
|
const QString = QString()) =0;
|
2020-10-17 20:25:30 +02:00
|
|
|
/**
|
|
|
|
@brief toXml
|
|
|
|
Save properties to xml element
|
|
|
|
@param xml_document
|
|
|
|
@return QDomElement
|
|
|
|
*/
|
2021-03-11 19:52:50 +01:00
|
|
|
virtual QDomElement toXml (QDomDocument &xml_document) const =0;
|
2020-10-17 20:25:30 +02:00
|
|
|
/**
|
|
|
|
@brief fromXml
|
|
|
|
load properties to xml element
|
|
|
|
@param xml_element
|
|
|
|
@return true / false
|
|
|
|
*/
|
2021-03-11 19:52:50 +01:00
|
|
|
virtual bool fromXml (const QDomElement &xml_element) =0;
|
2014-04-11 09:51:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PROPERTIESINTERFACE_H
|