QElectroTech  0.8-dev
nameslist.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 NAMES_LIST_H
19 #define NAMES_LIST_H
20 #include <QtXml>
21 #include "pugixml.hpp"
30 class NamesList {
31  // constructors, destructor
32  public:
33  NamesList();
34  virtual ~NamesList();
35 
36  // attributes
37  private:
38  QHash<QString, QString> hash_names;
39 
40  public:
41  static int MetaTypeId;
42 
43  // methods
44  public:
45  // methods relatives a la gestion de la liste
46  void addName(const QString &, const QString &);
47  void removeName(const QString &);
48  void clearNames();
49  QList<QString> langs() const;
50  bool isEmpty() const;
51  int count() const;
52  QString &operator[](const QString &);
53  const QString operator[](const QString &) const;
54  bool operator!=(const NamesList &) const;
55  bool operator==(const NamesList &) const;
56  QString name(const QString & = QString()) const;
57 
58  // methods relatives a XML
59  void fromXml(const QDomElement &, const QHash<QString, QString> & = QHash<QString, QString>());
60  void fromXml(const pugi::xml_node &xml_element, const QHash<QString, QString> &xml_options = QHash<QString, QString>());
61  QDomElement toXml(QDomDocument &, const QHash<QString, QString> & = QHash<QString, QString>()) const;
62 
63  protected:
64  QHash<QString, QString> getXmlOptions(const QHash<QString, QString> & = QHash<QString, QString>()) const;
65 };
67 #endif
NamesList::addName
void addName(const QString &, const QString &)
Definition: nameslist.cpp:43
QETApp
The QETApp class This class represents the QElectroTech application.
Definition: qetapp.h:55
nameslist.h
delete_old_log_files
void delete_old_log_files(int days)
delete_old_log_files delete old log files
Definition: main.cpp:129
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(NamesList)
QET::Icons::nl
QIcon nl
Definition: qeticons.cpp:203
NamesList::isEmpty
bool isEmpty() const
Definition: nameslist.cpp:73
MacOSXOpenEvent
The MacOSXOpenEvent class.
Definition: macosxopenevent.h:26
main
int main(int argc, char **argv)
main Main function of QElectroTech
Definition: main.cpp:162
QETArguments::arguments
virtual QList< QString > arguments() const
Definition: qetarguments.cpp:120
Machine_info::send_info_to_debug
void send_info_to_debug()
Machine_info::send_info_to_debug.
Definition: machine_info.cpp:45
macosxopenevent.h
NamesList::removeName
void removeName(const QString &)
Definition: nameslist.cpp:52
qetapp.h
QETArguments
Definition: qetarguments.h:26
NamesList::clearNames
void clearNames()
Definition: nameslist.cpp:59
qet.h
NamesList::count
int count() const
Definition: nameslist.cpp:80
NamesList::name
QString name(const QString &=QString()) const
Definition: nameslist.cpp:231
machine_info.h
NamesList::MetaTypeId
static int MetaTypeId
Definition: nameslist.h:41
NamesList::hash_names
QHash< QString, QString > hash_names
Definition: nameslist.h:38
QETApp::receiveMessage
void receiveMessage(int instanceId, QByteArray message)
QETApp::receiveMessage openFiles from message.
Definition: qetapp.cpp:1342
NamesList::fromXml
void fromXml(const QDomElement &, const QHash< QString, QString > &=QHash< QString, QString >())
Definition: nameslist.cpp:113
QETApp::instance
static QETApp * instance()
QETApp::instance.
Definition: qetapp.cpp:153
myMessageOutput
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
myMessageOutput for debugging
Definition: main.cpp:32
NamesList::~NamesList
virtual ~NamesList()
Definition: nameslist.cpp:33
NamesList::langs
QList< QString > langs() const
Definition: nameslist.cpp:66
NamesList
Definition: nameslist.h:30
NamesList::getXmlOptions
QHash< QString, QString > getXmlOptions(const QHash< QString, QString > &=QHash< QString, QString >()) const
Definition: nameslist.cpp:190
NamesList::operator!=
bool operator!=(const NamesList &) const
Definition: nameslist.cpp:208
NamesList::operator==
bool operator==(const NamesList &) const
Definition: nameslist.cpp:216
NamesList::operator[]
QString & operator[](const QString &)
Definition: nameslist.cpp:89
Machine_info
The Machine_info class This class hold information from your PC.
Definition: machine_info.h:29
NamesList::toXml
QDomElement toXml(QDomDocument &, const QHash< QString, QString > &=QHash< QString, QString >()) const
Definition: nameslist.cpp:169
NamesList::NamesList
NamesList()
Definition: nameslist.cpp:27
QETApp::langFromSetting
static QString langFromSetting()
QETApp::langFromSetting.
Definition: qetapp.cpp:205
QETApp::configDir
static QString configDir()
QETApp::configDir Return the QET configuration folder, i.e. the path to the folder in which QET will ...
Definition: qetapp.cpp:805
QET::joinWithSpaces
QString joinWithSpaces(const QStringList &)
Definition: qet.cpp:452