// ========================================================= //
//                                                           //
//   File      : TreeLabeler.h                               //
//   Purpose   : Generate labels for TreeNode                //
//                                                           //
//   Coded by Ralf Westram (coder@reallysoft.de) in Aug 21   //
//   http://www.arb-home.de/                                 //
//                                                           //
// ========================================================= //

#ifndef TREELABELER_H
#define TREELABELER_H

// -----------------------------------------
//      TreeLabeler and specialisations

struct TreeLabeler {
    virtual ~TreeLabeler() {}

    virtual const char *speciesLabel(GBDATA *gb_main, GBDATA *gb_species, TreeNode *species, const char *tree_name) const = 0;
    virtual const char *groupLabel  (GBDATA *gb_main, GBDATA *gb_group,   TreeNode *species, const char *tree_name) const = 0;
};

struct Node_ID_Labeler : public TreeLabeler {
    // simply returns the 'name' of the node
    // (=species ID if !zombie; zombie ID; group ID or NULp for inner nodes which are no group)

    const char *speciesLabel(GBDATA *, GBDATA *, TreeNode *species, const char *) const OVERRIDE;
    const char *groupLabel(GBDATA *, GBDATA *, TreeNode *species, const char *) const OVERRIDE;
};



#else
#error TreeLabeler.h included twice
#endif // TREELABELER_H
