mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Define abstract Visitor for menu items, and concrete subclass...
... The general visitation procedure will find reuse with other specific actions, and maybe for other non-menu trees too
This commit is contained in:
@@ -524,6 +524,23 @@ namespace Registry {
|
||||
using GroupItem::GroupItem;
|
||||
~TransparentGroupItem() override;
|
||||
};
|
||||
|
||||
// Define actions to be done in Visit.
|
||||
// Default implementations do nothing
|
||||
// The supplied path does not include the name of the item
|
||||
class Visitor
|
||||
{
|
||||
public:
|
||||
virtual ~Visitor();
|
||||
using Path = std::vector< Identifier >;
|
||||
virtual void BeginGroup( GroupItem &item, const Path &path );
|
||||
virtual void EndGroup( GroupItem &item, const Path &path );
|
||||
virtual void Visit( SingleItem &item, const Path &path );
|
||||
};
|
||||
|
||||
// Top-down visitation of all items and groups in a tree
|
||||
void Visit(
|
||||
Visitor &visitor, AudacityProject &project, BaseItem *pTopItem );
|
||||
}
|
||||
|
||||
// Define items that populate tables that specifically describe menu trees
|
||||
|
||||
Reference in New Issue
Block a user