module Text.Layout.Table.Internal where

import Text.Layout.Table.Position
import Text.Layout.Table.Primitives.Basic

-- | Specifies the layout of a column.
data ColSpec = ColSpec
             { lenSpec     :: LenSpec
             , position    :: Position H
             , alignSpec   :: AlignSpec
             , cutMarkSpec :: CutMarkSpec
             }

-- | Determines how long a column will be.
data LenSpec = Expand | Fixed Int | ExpandUntil Int | FixedUntil Int

-- | Determines whether a column will align at a specific letter.
data AlignSpec = AlignPred OccSpec | NoAlign

-- | Specifies an occurence of a letter.
data OccSpec = OccSpec (Char -> Bool) Int

-- | Groups rows together, which are not seperated from each other.
data RowGroup = RowGroup
              { rows     :: [[String]] 
              }

-- | Specifies how a header is layout, by omitting the cut mark it will use the
-- one specified in the 'ColSpec' like the other cells in that column.
data HeaderColSpec = HeaderColSpec (Position H) (Maybe CutMarkSpec)