--------------------------------------------------------------------------------

module
    Hable.BoxChar
        ( BoxChar(..)
        , HAxis(..)
        , VAxis(..)
        )
  where


--------------------------------------------------------------------------------

-- | Describes a styled box character. You can use any data type to
-- represent a style as long as the 'charset' of your 'Config' supports it.
--
-- Be careful with all these getter functions like 'bcVStyle' as they are not
-- complete. (E.g. @'bcHStyle' ('Bar' ())@ will fail with an exception error.)

data BoxChar style
    =

      -- | Represents a box character in the shape of @|@.

      Bar
        { bcVStyle :: style }

      -- | Represents a box character in the shape of @–@.

    | Dash
        { bcHStyle :: style }

      -- | Represents any other box character.
      --
      -- Imagine a 2x2 table. The 'bcVPos' and 'bcHPos' use the 'Align' data
      -- type to describe the position of the angled box character this 'Angled'
      -- constructor represents.
      --
      -- E.g. @'Angled' 'HLeft' foo 'VBottom' bar@ represents an @L@-like
      -- shaped box character as that's the shape of the character at the
      -- bottom-left edge of a 2x2 table.
      --
      -- Another example: @'Angled' 'HCenter' 'HCenter'@ describes a box character
      -- shaped like a plus @+@.

    | Angled
        { bcHPos :: HAxis
        , bcHStyle :: style
        , bcVPos :: VAxis
        , bcVStyle :: style
        }


--------------------------------------------------------------------------------

-- | Describe a value (e.g. direction or position) on the horizontal axis.

data HAxis

    -- | Means either /on the left/ (in context of 'BoxChar')
    -- or /to the left/ (in context of 'hAlign').

    = HLeft

    -- | Means either /inbetween left and right/ (in context of 'BoxChar')
    -- or /(horizontally) centered/ (in context of 'hAlign').

    | HCenter

    -- | Means either /on the right/ (in context of 'BoxChar')
    -- or /to the right/ (in context of 'hAlign').

    | HRight

  deriving Enum


--------------------------------------------------------------------------------

-- | Describe a value (e.g. direction or position) on the vertical axis.

data VAxis

    -- | Means /at the top/.

    = VTop

    -- | Means either /inbetween top and bottom/ (in context of 'BoxChar')
    -- or /(vertically) centered/ (in context of 'vAlign').

    | VCenter

    -- | Means /at the bottom/.

    | VBottom

  deriving Enum