#pragma once

#include "AlterableObject.hpp"

/*
   Class: Label

     Implements a label object.

     *Inherits* from <AlterableObject>.
*/
class Label: public AlterableObject {
  public:
    /*
       Constructor: Label

         Initializes the object.

       Parameters:

         sText - The text for the label.
         iStyle - Style flags for the label.
         iLeft - X value of the label in QPainter coordinates.
         iTop - Y value of the label in QPainter coordinates.
         iOrientation - <ORIENTATION_HORIZONTAL> or <ORIENTATION_VERTICAL>.
         iAlignment - Qt::AlignCenter, Qt::AlignLeft or Qt::AlignRight.
    */
    Label(QString sText, int iStyle, int iLeft, int iTop, int iOrientation, int iAlignment);

    /*
       Destructor: ~Label

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


    /*
       Function: Draw

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

       Parameters:

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

    /*
       Function: DrawLabels

         Unused function. *Inherited* from <AlterableObject>.

       Parameters:

         pPainter - Unused parameter.
    */
    void DrawLabels(QPainter* pPainter);

    /*
       Function: ChangePosition

         Changes the position of the label.

       Parameters:

         iLeft - Total horizontal distance in pixels.
         iTop - Total vertical distance in pixels.
    */
    void ChangePosition(int iLeft, int iTop);

    /*
       Function: ChangePosition

         Calls ChangePosition(int, int). *Inherited* from <AlterableObject>.

       Parameters:

         fDeltaLeft - Total horizontal distance in pixels.
         fDeltaTop - Total vertical distance according to the upper vertices in pixels.
         fDeltaBottom - Unused parameter.
    */
    void ChangePosition(float fDeltaLeft, float fDeltaTop, float fDeltaBottom);

    /*
       Function: ChangeText

         Changes the text of the label.

       Parameters:

         sText - New text to be displayed.
    */
    void ChangeText(QString sText);

    /*
       Function: ChangeAlpha

         Changes the alpha value of the label's font.

       Parameters:

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

    /*
       Function: GetRed

         Returns the red color value of the label's font.

       Returns:

         The red color value of the label's font.
    */
    float GetRed();

    /*
       Function: GetGreen

         Returns the green color value of the label's font.

       Returns:

         The green color value of the label's font.
    */
    float GetGreen();

    /*
       Function: GetBlue

         Returns the blue color value of the label's font.

       Returns:

         The blue color value of the label's font.
    */
    float GetBlue();

    /*
       Function: GetAlpha

         Returns the alpha color value of the label's font.

       Returns:

         The alpha color value of the label's font.
    */
    float GetAlpha();

    /*
       Function: GetText

         Returns the text of the label.

       Returns:

         The text of the label.
    */
    QString GetText();

    /*
       Function: GetLeft

         Returns the X coordinate of the label.

       Returns:

         The X coordinate of the label.
    */
    int GetLeft();

    /*
       Function: GetTop

         Returns the Y coordinate of the label.

       Returns:

         The Y coordinate of the label.
    */
    int GetTop();

    /*
       Function: GetOrientation

         Returns the orientation of the label, either <ORIENTATION_HORIZONTAL> or <ORIENTATION_VERTICAL>.

       Returns:

         The orientation of the label.
    */
    int GetOrientation();

    /*
       Function: GetAlignment

         Returns the alignment of the label, either Qt::AlignCenter, Qt::AlignLeft or Qt::AlignRight.

       Returns:

         The alignment of the label.
    */
    int GetAlignment();

    /*
       Function: GetStyle

         Returns the style flags of the label.

       Returns:

         The style flags of the label.
    */
    int GetStyle();

  private:
    QString sText;
    QFont oFont;
    QColor oColor;
    int iLeft;
    int iOriginalLeft;
    int iTop;
    int iOriginalTop;
    int iWidth;
    int iHeight;
    int iStyle;
    int iOrientation;
    int iAlignment;
};