29 #include <QModelIndex>
30 #include <QDomDocument>
32 #include <QStringList>
69 EXmlModel(QUrl validationUrl, QObject *parent = 0);
78 bool load(QDomElement element);
82 bool load(QDomDocument document);
86 bool load(QFile *file);
90 bool load(QString file);
96 bool load(QByteArray data);
102 bool save(QDomElement &useElem);
106 bool save(QFile *file);
110 bool save(QString file);
123 EXmlItem *itemFromIndex(QModelIndex index)
const;
124 QModelIndex indexFromItem(
EXmlItem *item)
const;
128 bool removeItem(QModelIndex index);
143 virtual void setRootItem(
EXmlItem* item);
157 bool isModified()
const;
161 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const;
162 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole);
163 int columnCount(
const QModelIndex& parent = QModelIndex())
const;
164 int rowCount(
const QModelIndex& parent = QModelIndex())
const;
165 QModelIndex parent(
const QModelIndex& child)
const;
166 QModelIndex index(
int row,
int column,
const QModelIndex& parent = QModelIndex())
const;
167 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
168 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
171 void modified(
bool status);
192 void setValidationSchema(QUrl url);
213 virtual void itemChanged(
EXmlItem *item);
219 virtual void itemRowsAboutToBeInserted(
EXmlItem *parent,
int start,
int end);
225 virtual void itemRowsInserted();
231 virtual void itemRowsAboutToBeRemoved(
EXmlItem *parent,
int start,
int end);
237 virtual void itemRowsRemoved();
240 void setModified(
bool status);
251 #endif // EXMLMODEL_H
Replacement of QAbstractItemModel to provide convenience signals for message handling.
Definition: eabstractitemmodel.h:36
virtual bool prepareForSaving()
Called by save(QDomElement) to prepare model for saving.
Definition: exmlmodel.h:199
bool _isModified
Definition: exmlmodel.h:248
An EXmlItem is used to handle XML tags and it's atrributes and or child tags.
Definition: exmlitem.h:48
#define E_CORE_EXPORT
Definition: eglobal.h:107
QUrl validationUrl
Definition: exmlmodel.h:245
QStringList headerList
Definition: exmlmodel.h:204
QMap< QString, EXmlParserItem * > parsers
Definition: exmlmodel.h:246
ExmlModel is a base class to handle XML files very easily.
Definition: exmlmodel.h:60
Used to connect tagNames to EXmlItem's.
Definition: exmlparseritem.h:41
EXmlItem * myRootItem
Definition: exmlmodel.h:247