#include <MP7Doc.hpp>
Signals | |
| void | modificationChanged (bool m) |
| This signal is emitted when the modification status of the MPEG-7 document has changed. | |
Public Member Functions | |
| MP7Doc (QListView *listView) | |
| Constructor. | |
| bool | parse (const QString &filename) |
| Parse a valid MPEG-7 file in XML format. | |
| bool | save (const QString &filename) |
| Save the MPEG-7 document in XML format to the given file. | |
| QString | filePath () const |
| Return the filename (full path name) of the document. | |
| QString | dirPath () const |
| Return the directory path of the document's filename. | |
| bool | isModified () const |
Return true if this document has been modified. | |
| MP7ListViewItem * | addElement (MP7ListViewItem *parent, MP7ListViewItem *after, const QString &name) |
Add an XML element as child of parent. | |
| MP7ListViewItem * | addElement (MP7ListViewItem *parent, const QString &name, int pos=-1) |
Add an XML element as child of parent. | |
| int | setElementValue (MP7ListViewItem *item, const QString &value) |
| Set the text value of the XML element corresponding to the MP7ListViewItem object. | |
| bool | setAttribute (MP7ListViewItem *item, const QString &attribute, const QString &value) |
| Set an attribute of the XML element corresponding to the MP7ListViewItem object. | |
| bool | moveElement (MP7ListViewItem *item, MP7ListViewItem *newParent, MP7ListViewItem *newSibling=NULL) |
| Move an XML element (with all children) to a new parent node, right after the given new sibling. | |
| bool | removeElementDeep (MP7ListViewItem *item) |
| Remove an XML element and all its descendants recursively. | |
| int | removeChildrenDeep (MP7ListViewItem *parent, const QString &name=QString::null) |
| Remove all XML child elements with the given tag name and its descendants recursively. | |
| MP7ListViewItem * | nodeByPath (const QString &path, MP7ListViewItem *root=NULL, bool create=false) |
| Return the element specified by a simple XML path. | |
| QPtrList< MP7ListViewItem > | children (MP7ListViewItem *parent, const QString &name=QString::null) const |
| Return all XML child elements with the given tag name. | |
| MP7ListViewItem * | nearestElement (MP7ListViewItem *start, const QString &name, bool searchUp) const |
| Find the nearest XML element with the given tag name. | |
| MP7ListViewItem * | nearestElement (MP7ListViewItem *start, const QStringList &names, bool searchUp) const |
| Find the nearest XML element equal to one of the given tag names. | |
Protected Member Functions | |
| void | updateTreeWidget () |
| Traverse the DOM tree recursively and construct a tree of QListViewItem objects corresponding to XML elements. | |
| void | setModified (bool modified) |
| Set the document modification status and emit a modificationChanged() signal if the status is being changed. | |
It manages a graphical tree representation of the document within a QListView widget.
|
|
Constructor. Creates an MPEG-7 document consisting of an empty Mpeg7 descriptor.
|
|
||||||||||||||||
|
Add an XML element as child of
|
|
||||||||||||||||
|
Add an XML element as child of
|
|
||||||||||||
|
Return all XML child elements with the given tag name.
|
|
|
Return the directory path of the document's filename.
If no filename has been set, |
|
|
Return the filename (full path name) of the document.
If none has been set, |
|
|
This signal is emitted when the modification status of the MPEG-7 document has changed.
|
|
||||||||||||||||
|
Move an XML element (with all children) to a new parent node, right after the given new sibling.
|
|
||||||||||||||||
|
Find the nearest XML element equal to one of the given tag names.
|
|
||||||||||||||||
|
Find the nearest XML element with the given tag name.
|
|
||||||||||||||||
|
Return the element specified by a simple XML path. Path element names are case-insensitive.
|
|
|
Parse a valid MPEG-7 file in XML format. The QListView widget is populated with QListViewItem objects corresponding to XML elements.
|
|
||||||||||||
|
Remove all XML child elements with the given tag name and its descendants recursively.
|
|
|
Remove an XML element and all its descendants recursively.
|
|
|
Save the MPEG-7 document in XML format to the given file.
|
|
||||||||||||||||
|
Set an attribute of the XML element corresponding to the MP7ListViewItem object.
|
|
||||||||||||
|
Set the text value of the XML element corresponding to the MP7ListViewItem object. If there is no text child node of the XML element, one will be created.
|
1.3.2