1 #ifndef _KwSongDatabaseNode_h_
2 #define _KwSongDatabaseNode_h_
5 * @file KwSongDatabaseNode.h
6 * @brief A node on a song database tree.
7 * @author James Hogan <james@albanarts.com>
13 class KwDisplayManager
;
15 /// A node on a playlist tree.
17 * Inherit from this class for each playlist node type.
19 class KwSongDatabaseNode
24 * Constructors + destructor.
27 /// Primary constructor.
28 KwSongDatabaseNode(KwSongDatabaseNode
* parent
);
31 virtual ~KwSongDatabaseNode();
38 KwSongDatabaseNode
* getParent();
40 /// Get a child node by index.
41 KwSongDatabaseNode
* getChild(int index
);
43 /// Get the index of a certain child.
44 int getChildIndex(KwSongDatabaseNode
* node
) const;
46 /// Get data associated with the node.
47 virtual QVariant
getData(int role
, int column
);
49 /// Get the number of children.
50 virtual int getChildCount() const;
52 /// Activate the node using a display manager.
53 virtual void activate(KwDisplayManager
* manager
);
57 /// Get a child node by index.
58 virtual KwSongDatabaseNode
* _getChild(int index
);
67 KwSongDatabaseNode
* m_parent
;
70 QVector
<KwSongDatabaseNode
*> m_children
;
73 #endif // _KwSongDatabaseNode_h_