| 1 |
/**************************************************************************************** |
| 2 |
* Copyright (c) 2008 Nikolaj Hald Nielsen <nhn@kde.org> * |
| 3 |
* Copyright (c) 2009-2010 Bart Cerneels <bart.cerneels@kde.org> * |
| 4 |
* * |
| 5 |
* This program is free software; you can redistribute it and/or modify it under * |
| 6 |
* the terms of the GNU General Public License as published by the Free Software * |
| 7 |
* Foundation; either version 2 of the License, or (at your option) any later * |
| 8 |
* version. * |
| 9 |
* * |
| 10 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY * |
| 11 |
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * |
| 12 |
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * |
| 13 |
* * |
| 14 |
* You should have received a copy of the GNU General Public License along with * |
| 15 |
* this program. If not, see <http://www.gnu.org/licenses/>. * |
| 16 |
****************************************************************************************/ |
| 17 |
|
| 18 |
#ifndef OPMLOUTLINE_H |
| 19 |
#define OPMLOUTLINE_H |
| 20 |
|
| 21 |
#include "amarok_export.h" |
| 22 |
|
| 23 |
#include <QMap> |
| 24 |
#include <QString> |
| 25 |
|
| 26 |
class AMAROK_EXPORT OpmlOutline |
| 27 |
{ |
| 28 |
public: |
| 29 |
OpmlOutline( OpmlOutline *parent = 0 ); |
| 30 |
~OpmlOutline() {} |
| 31 |
|
| 32 |
OpmlOutline *parent() const { return m_parent; } |
| 33 |
bool isRootItem() const { return m_parent == 0; } |
| 34 |
|
| 35 |
QMap<QString,QString> attributes() const { return m_attributes; } |
| 36 |
void addAttribute( const QString &key, const QString &value ) |
| 37 |
{ m_attributes.insert( key, value ); } |
| 38 |
|
| 39 |
QList<OpmlOutline *> children() const { return m_children; } |
| 40 |
void setHasChildren( bool hasChildren ) { m_hasChildren = hasChildren; } |
| 41 |
bool hasChildren() const { return m_hasChildren; } |
| 42 |
void addChild( OpmlOutline *outline ) { m_children << outline; } |
| 43 |
void addChildren( QList<OpmlOutline *> outlineList ) |
| 44 |
{ m_children << outlineList; } |
| 45 |
|
| 46 |
private: |
| 47 |
OpmlOutline *m_parent; |
| 48 |
QMap<QString,QString> m_attributes; |
| 49 |
|
| 50 |
bool m_hasChildren; |
| 51 |
QList<OpmlOutline *> m_children; |
| 52 |
}; |
| 53 |
|
| 54 |
#endif // OPMLOUTLINE_H |