mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
replace tabs by 4 spaces
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
Copyright 2006-2020 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
Copyright 2006-2020 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef DIAGRAM_CONTEXT_H
|
||||
#define DIAGRAM_CONTEXT_H
|
||||
@@ -26,9 +26,9 @@
|
||||
|
||||
#include "pugixml.hpp"
|
||||
/**
|
||||
This class represents a diagram context, i.e. the data (a list of key/value
|
||||
pairs) of a diagram at a given time. It is notably used by titleblock templates
|
||||
to fetch the informations they need to do their rendering, or element for retrieve information about itself
|
||||
This class represents a diagram context, i.e. the data (a list of key/value
|
||||
pairs) of a diagram at a given time. It is notably used by titleblock templates
|
||||
to fetch the informations they need to do their rendering, or element for retrieve information about itself
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -54,41 +54,41 @@
|
||||
*/
|
||||
class DiagramContext
|
||||
{
|
||||
public:
|
||||
enum KeyOrder {
|
||||
None,
|
||||
Alphabetical,
|
||||
DecreasingLength
|
||||
};
|
||||
|
||||
void add(DiagramContext other);
|
||||
void remove(const QString &key);
|
||||
QList<QString> keys(KeyOrder = None) const;
|
||||
bool contains(const QString &) const;
|
||||
const QVariant operator[](const QString &) const;
|
||||
bool addValue(const QString &, const QVariant &, bool show = true);
|
||||
QVariant value(const QString &key) const;
|
||||
void clear();
|
||||
int count();
|
||||
bool keyMustShow (const QString &) const;
|
||||
|
||||
bool operator==(const DiagramContext &) const;
|
||||
bool operator!=(const DiagramContext &) const;
|
||||
|
||||
void toXml(QDomElement &, const QString & = "property") const;
|
||||
void fromXml(const QDomElement &, const QString & = "property");
|
||||
void fromXml(const pugi::xml_node &dom_element, const QString &tag_name = "property");
|
||||
void toSettings(QSettings &, const QString &) const;
|
||||
void fromSettings(QSettings &, const QString &);
|
||||
|
||||
static QString validKeyRegExp();
|
||||
|
||||
private:
|
||||
static bool stringLongerThan(const QString &, const QString &);
|
||||
bool keyIsAcceptable(const QString &) const;
|
||||
/// Diagram context data (key/value pairs)
|
||||
QHash<QString, QVariant> m_content;
|
||||
QHash<QString, bool> m_content_show;
|
||||
public:
|
||||
enum KeyOrder {
|
||||
None,
|
||||
Alphabetical,
|
||||
DecreasingLength
|
||||
};
|
||||
|
||||
void add(DiagramContext other);
|
||||
void remove(const QString &key);
|
||||
QList<QString> keys(KeyOrder = None) const;
|
||||
bool contains(const QString &) const;
|
||||
const QVariant operator[](const QString &) const;
|
||||
bool addValue(const QString &, const QVariant &, bool show = true);
|
||||
QVariant value(const QString &key) const;
|
||||
void clear();
|
||||
int count();
|
||||
bool keyMustShow (const QString &) const;
|
||||
|
||||
bool operator==(const DiagramContext &) const;
|
||||
bool operator!=(const DiagramContext &) const;
|
||||
|
||||
void toXml(QDomElement &, const QString & = "property") const;
|
||||
void fromXml(const QDomElement &, const QString & = "property");
|
||||
void fromXml(const pugi::xml_node &dom_element, const QString &tag_name = "property");
|
||||
void toSettings(QSettings &, const QString &) const;
|
||||
void fromSettings(QSettings &, const QString &);
|
||||
|
||||
static QString validKeyRegExp();
|
||||
|
||||
private:
|
||||
static bool stringLongerThan(const QString &, const QString &);
|
||||
bool keyIsAcceptable(const QString &) const;
|
||||
/// Diagram context data (key/value pairs)
|
||||
QHash<QString, QVariant> m_content;
|
||||
QHash<QString, bool> m_content_show;
|
||||
};
|
||||
|
||||
QDebug operator <<(QDebug debug, const DiagramContext &context);
|
||||
|
||||
Reference in New Issue
Block a user