#pragma once

#include "DataElement.hpp"

/*
   Class: Bar

     Implements a bar data element.

     *Inherits* from <DataElement>.
*/
class Bar: public DataElement {
  public:
    /*
       Constructor: Bar

         Initializes the object.

       Parameters:

         pDataEntry - Pointer to the data entry object that shall be represented by the bar.
         fLeft - The x value of the bar.
         fTop - The upper y value of the bar.
         fBottom - The lower y value of the bar.
         fWidth - The width of the bar.
         pLabel - A label that shall be assigned to the bar instead of creating a new one. Default value is NULL.
    */
    Bar(DataEntry* pDataEntry, float fLeft, float fTop, float fBottom, float fWidth, Label* pLabel = NULL);

    /*
       Destructor: ~Bar

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


    /*
       Function: Draw

         Draws the bar. *Inherited* from <AlterableObject>.

       Parameters:

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

    /*
       Function: DrawLabels

         Draws the label assigned to the bar. *Inherited* from <AlterableObject>.

       Parameters:

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

    /*
       Function: ChangePosition

         Changes the position of the bar. *Inherited* from <AlterableObject>.

       Parameters:

         fDeltaLeft - Total horizontal distance.
         fDeltaTop - Total vertical distance according to the upper vertices.
         fDeltaBottom - Total vertical distance according to the lower vertices. Default value is 0.0f.
    */
    void ChangePosition(float fDeltaLeft, float fDeltaTop, float fDeltaBottom = 0.0f);

    /*
       Function: Scale

         Scales the object. *Inherited* from <DataElement>.

       Parameters:

         fDeltaWidth - Total horizontal scaling value.
         fDeltaHeight - Total vertical scaling value.
    */
    void Scale(float fDeltaWidth, float fDeltaHeight);

    /*
       Function: ChangeAlpha

         Changes the alpha value of the bar. *Inherited* from <AlterableObject>.

       Parameters:

         fDeltaAlpha - Change of alpha value.
    */
    void ChangeAlpha(float fDeltaAlpha);
};