#ifndef __CDTreeNodes__H
#define __CDTreeNodes__H

#include "WimpLib:List.h"
#include "CDDesc.h"
#include "CDTrack.h"
#include "WimpLib:OTreeList.h"

#define CDItemAction_EditCollective  (EWOTreeItemArea_User + 0)
#define CDItemAction_EditAlbumAuthor (EWOTreeItemArea_User + 1)
#define CDItemAction_EditBox         (EWOTreeItemArea_User + 2)
#define CDItemAction_EditAlbum       (EWOTreeItemArea_User + 3)
#define CDItemAction_EditAuthor      (EWOTreeItemArea_User + 4)
#define CDItemAction_EditTitle       (EWOTreeItemArea_User + 5)
#define CDItemAction_ResizeColumn0   (EWOTreeItemArea_User + 256)

#define CDTreeMode_GroupBy_Collective   0x00000100
#define CDTreeMode_GroupBy_Artist       0x00000200
#define CDTreeMode_GroupBy_Box          0x00000400
#define CDTreeMode_GroupBy_CompByArtist 0x00002000

#define CDTreeMode_OrderBy_Alphabetic   0x00000000
#define CDTreeMode_OrderBy_TrackNumber  0x01000000

#define CDTreeMode_SortAlbum_Date       0x04000000

#define CDTreeMode_Flat                 0x10000000

#define CDTreeMode_Mask_Keys            0x000000ff
#define CDTreeMode_Mask_GroupBy         0x00002700
#define CDTreeMode_Mask_OrderBy         0x01000000
#define CDTreeMode_Mask_Flags           0x80000000
#define CDTreeMode_Mask_Read            0x15002700

void throw_CDTreeNodes_CDTreeNodes(void);
void CDTreeNodes_NotCDTreeNodes(void);
OTreeNode* throw_CDTreeNodes_NewCDListNode(unsigned int treetype);
OTreeNode* throw_CDTreeNodes_NewSearchNode(unsigned int treetype);
OTreeNode* throw_CDTreeNodes_InsertTrack(OTreeList* pOList, const CDTrack* pTrack);
void CDTreeNodes_Remove(OTreeList* pOList, OTreeNode*);
bool     CDTreeNodes_IsCDDesc(const OTreeNode*);
bool     CDTreeNodes_IsTrack(const OTreeNode*);
CDDesc*  throw_CDTreeNodes_GetCDDesc(const OTreeNode*);
CDTrack* throw_CDTreeNodes_GetTrack(const OTreeNode*);
int CDTreeNodes_ShowNode(const OTreeNode*, bool bForce);
void CDTreeNodes_GetChildDescs(const OTreeNode* pNode, List* pList);
void CDTreeNodes_GetChildTracks(const OTreeNode* pNode, List* pList);
int CDHeaderNode_GetFirstColumnPos(void);
const char* CDTreeNodes_GetField(const OTreeNode* pNode, EMetaId id, bool cd);

#endif
