/////////////////////////////////////////////////////////////////////////////
// Name:        turn.h
// Author:      Klaus Rettinghaus
// Created:     2017
// Copyright (c) Authors and others. All rights reserved.
/////////////////////////////////////////////////////////////////////////////

#ifndef __VRV_TURN_H__
#define __VRV_TURN_H__

#include "atts_cmn.h"
#include "atts_cmnornaments.h"
#include "atts_externalsymbols.h"
#include "controlelement.h"
#include "timeinterface.h"

namespace vrv {

//----------------------------------------------------------------------------
// Turn
//----------------------------------------------------------------------------

/**
 * This class models the MEI <turn> element.
 */
class Turn : public ControlElement,
             public TimePointInterface,
             public AttColor,
             public AttExtSym,
             public AttOrnamentAccid,
             public AttPlacementRelStaff,
             public AttTurnLog {
public:
    /**
     * @name Constructors, destructors, and other standard methods
     * Reset method reset all attribute classes
     */
    ///@{
    Turn();
    virtual ~Turn();
    Object *Clone() const override { return new Turn(*this); }
    void Reset() override;
    std::string GetClassName() const override { return "Turn"; }
    ///@}

    /**
     * @name Getter to interfaces
     */
    ///@{
    TimePointInterface *GetTimePointInterface() override { return dynamic_cast<TimePointInterface *>(this); }
    ///@}

    /**
     * Get the SMuFL glyph for the turn based on form or glyph.num
     */
    wchar_t GetTurnGlyph() const;

    //----------//
    // Functors //
    //----------//

    /**
     * See Object::PrepareDelayedTurns
     */
    int PrepareDelayedTurns(FunctorParams *functorParams) override;

    /**
     * See Object::ResetDrawing
     */
    int ResetDrawing(FunctorParams *functorParams) override;

protected:
    //
private:
    //
public:
    /**
     * The end point of a delayed turn when @startid is used
     */
    LayerElement *m_drawingEndElement;

private:
    //
};

} // namespace vrv

#endif
