#pragma once

#include "CompoundTransition.hpp"

/*
   Class: ChangeChartTypeTransition

     Implements a complex sequence of transitions that changes the chart type to the desired type.

     *Inherits* from <CompoundTransition>.
*/
class ChangeChartTypeTransition: public CompoundTransition {
  public:
    /*
       Constructor: ChangeChartTypeTransition

         Initializes the object by creating all transitions and intermediate objects.

       Parameters:

         pInitialChart - Pointer to the chart to be modified.
         iChartIndex - <BAR_CHART>, <GROUPED_BAR_CHART>, <STACKED_BAR_CHART> or <PIE_CHART>.
    */
    ChangeChartTypeTransition(Chart* pInitialChart, int iChartIndex);

    /*
       Destructor: ~ChangeChartTypeTransition

         Releases all allocated resources.
    */
    ~ChangeChartTypeTransition();


    /*
       Function: Update

         Updates the transition by executing the active child transition. *Inherited* from <Transition>.
    */
    void Update();

    /*
       Function: Draw

         Draws the transition by drawing the initial chart. *Inherited* from <CompoundTransition>.

       Parameters:

         pPainter - The QPainter object that shall be used for painting.
    */
    void Draw(QPainter* pPainter);

    /*
       Function: Complete

         Checks if all child transitions are completed. *Inherited* from <Transition>.

       Returns:

         A boolean value indicating if all child transitions are completed.
    */
    bool Complete();

    /*
       Function: GetActiveChart

         Returns the active chart of the transition. This is the active chart of the active transition if present, else the initial chart. *Inherited* from <CompoundTransition>.

       Returns:

         Returns the active chart of the transition.
    */
    Chart* GetActiveChart();
};