module TextData.Data {-(
  Title
, Text
, FlashTextState
, Layout
, Options
, Settings
, FlashText
, Header
, Body
, BodyContent
, Summation
, SummationContent
, SummationItem
, Section
, SubSection
, SectionContent
, defaultSettings)-}
 where
import Control.Monad.State.Lazy

{-Type def-}
type Title = String
type Text  = String
type FlashTextState a = State Settings a

{-SETTINGS-}
data Layout = Article deriving (Eq, Show)
data Options = TableOfContents deriving (Eq, Show)
data Settings = Settings {
                           output :: Maybe FilePath,
                           template :: FilePath,
                           layout :: Layout,
                           textSize :: Int,
                           titlePage :: Bool,
                           tableOfContents :: Bool} deriving (Eq, Show)

{-Default settings-}
defaultSettings :: Settings
defaultSettings = Settings {
                    layout = Article,
                    textSize = 12,
                    template = "./Templates/Simple.tex",
                    output = Nothing,
                    titlePage = True,
                    tableOfContents = True
}

{-FORMAT-}
data FlashText = FlashText1{ header :: Header,
                             body :: Body}
               | FlashText2 {body:: Body} deriving (Eq, Show)

{-Header-}
data Header = Header { header_title :: String,
                       firstname :: String,
                       lastname :: String,
                       date :: String} deriving(Eq, Show)

{-Body-}
data Body = Body [BodyContent] deriving (Eq, Show)
data BodyContent = Text_body Text -- Text not supported at the moment
                 | Section_Body Section deriving (Eq, Show)

{-summations-}
data Summation = Summation SummationContent deriving (Eq, Show)

data SummationContent = Numbered [SummationItem]
                      | Normal [SummationItem] deriving (Eq, Show)

data SummationItem = SummationItem Text deriving(Eq, Show)

{-sections-}
data Section = Section { section_title :: Title,
                         section_body :: [SectionContent]} deriving (Eq, Show)

data SubSection = SubSection { sub_section_title :: Title,
                               sub_section_body :: [SectionContent]} deriving (Eq, Show)

data SectionContent = Text_Section Text
                    | SubSection_Section SubSection
                    | Summation_Section Summation deriving (Eq, Show)





{-Template-}

data  Template = Template [TemplateContent]
data TemplateContent = TemplateText Text
                     | TemplateFirstName Text
                     | TemplateLastName Text
