{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.WebKit.Objects.DOMHTMLHeadingElement
    ( 

-- * Exported types
    DOMHTMLHeadingElement(..)               ,
    DOMHTMLHeadingElementK                  ,
    toDOMHTMLHeadingElement                 ,
    noDOMHTMLHeadingElement                 ,


 -- * Methods
-- ** dOMHTMLHeadingElementGetAlign
    dOMHTMLHeadingElementGetAlign           ,


-- ** dOMHTMLHeadingElementSetAlign
    dOMHTMLHeadingElementSetAlign           ,




 -- * Properties
-- ** Align
    DOMHTMLHeadingElementAlignPropertyInfo  ,
    constructDOMHTMLHeadingElementAlign     ,
    getDOMHTMLHeadingElementAlign           ,
    setDOMHTMLHeadingElementAlign           ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.WebKit.Types
import GI.WebKit.Callbacks
import qualified GI.GObject as GObject

newtype DOMHTMLHeadingElement = DOMHTMLHeadingElement (ForeignPtr DOMHTMLHeadingElement)
foreign import ccall "webkit_dom_html_heading_element_get_type"
    c_webkit_dom_html_heading_element_get_type :: IO GType

type instance ParentTypes DOMHTMLHeadingElement = DOMHTMLHeadingElementParentTypes
type DOMHTMLHeadingElementParentTypes = '[DOMHTMLElement, DOMElement, DOMNode, DOMObject, GObject.Object, DOMEventTarget]

instance GObject DOMHTMLHeadingElement where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_webkit_dom_html_heading_element_get_type
    

class GObject o => DOMHTMLHeadingElementK o
instance (GObject o, IsDescendantOf DOMHTMLHeadingElement o) => DOMHTMLHeadingElementK o

toDOMHTMLHeadingElement :: DOMHTMLHeadingElementK o => o -> IO DOMHTMLHeadingElement
toDOMHTMLHeadingElement = unsafeCastTo DOMHTMLHeadingElement

noDOMHTMLHeadingElement :: Maybe DOMHTMLHeadingElement
noDOMHTMLHeadingElement = Nothing

-- VVV Prop "align"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]

getDOMHTMLHeadingElementAlign :: (MonadIO m, DOMHTMLHeadingElementK o) => o -> m T.Text
getDOMHTMLHeadingElementAlign obj = liftIO $ getObjectPropertyString obj "align"

setDOMHTMLHeadingElementAlign :: (MonadIO m, DOMHTMLHeadingElementK o) => o -> T.Text -> m ()
setDOMHTMLHeadingElementAlign obj val = liftIO $ setObjectPropertyString obj "align" val

constructDOMHTMLHeadingElementAlign :: T.Text -> IO ([Char], GValue)
constructDOMHTMLHeadingElementAlign val = constructObjectPropertyString "align" val

data DOMHTMLHeadingElementAlignPropertyInfo
instance AttrInfo DOMHTMLHeadingElementAlignPropertyInfo where
    type AttrAllowedOps DOMHTMLHeadingElementAlignPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DOMHTMLHeadingElementAlignPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DOMHTMLHeadingElementAlignPropertyInfo = DOMHTMLHeadingElementK
    type AttrGetType DOMHTMLHeadingElementAlignPropertyInfo = T.Text
    type AttrLabel DOMHTMLHeadingElementAlignPropertyInfo = "DOMHTMLHeadingElement::align"
    attrGet _ = getDOMHTMLHeadingElementAlign
    attrSet _ = setDOMHTMLHeadingElementAlign
    attrConstruct _ = constructDOMHTMLHeadingElementAlign

type instance AttributeList DOMHTMLHeadingElement = DOMHTMLHeadingElementAttributeList
type DOMHTMLHeadingElementAttributeList = ('[ '("access-key", DOMHTMLElementAccessKeyPropertyInfo), '("align", DOMHTMLHeadingElementAlignPropertyInfo), '("attributes", DOMElementAttributesPropertyInfo), '("base-uri", DOMNodeBaseUriPropertyInfo), '("child-element-count", DOMElementChildElementCountPropertyInfo), '("child-nodes", DOMNodeChildNodesPropertyInfo), '("children", DOMHTMLElementChildrenPropertyInfo), '("class-list", DOMElementClassListPropertyInfo), '("class-name", DOMElementClassNamePropertyInfo), '("client-height", DOMElementClientHeightPropertyInfo), '("client-left", DOMElementClientLeftPropertyInfo), '("client-top", DOMElementClientTopPropertyInfo), '("client-width", DOMElementClientWidthPropertyInfo), '("content-editable", DOMHTMLElementContentEditablePropertyInfo), '("core-object", DOMObjectCoreObjectPropertyInfo), '("dir", DOMHTMLElementDirPropertyInfo), '("draggable", DOMHTMLElementDraggablePropertyInfo), '("first-child", DOMNodeFirstChildPropertyInfo), '("first-element-child", DOMElementFirstElementChildPropertyInfo), '("hidden", DOMHTMLElementHiddenPropertyInfo), '("id", DOMElementIdPropertyInfo), '("inner-html", DOMHTMLElementInnerHtmlPropertyInfo), '("inner-text", DOMHTMLElementInnerTextPropertyInfo), '("is-content-editable", DOMHTMLElementIsContentEditablePropertyInfo), '("lang", DOMHTMLElementLangPropertyInfo), '("last-child", DOMNodeLastChildPropertyInfo), '("last-element-child", DOMElementLastElementChildPropertyInfo), '("local-name", DOMNodeLocalNamePropertyInfo), '("namespace-uri", DOMNodeNamespaceUriPropertyInfo), '("next-element-sibling", DOMElementNextElementSiblingPropertyInfo), '("next-sibling", DOMNodeNextSiblingPropertyInfo), '("node-name", DOMNodeNodeNamePropertyInfo), '("node-type", DOMNodeNodeTypePropertyInfo), '("node-value", DOMNodeNodeValuePropertyInfo), '("offset-height", DOMElementOffsetHeightPropertyInfo), '("offset-left", DOMElementOffsetLeftPropertyInfo), '("offset-parent", DOMElementOffsetParentPropertyInfo), '("offset-top", DOMElementOffsetTopPropertyInfo), '("offset-width", DOMElementOffsetWidthPropertyInfo), '("outer-html", DOMHTMLElementOuterHtmlPropertyInfo), '("outer-text", DOMHTMLElementOuterTextPropertyInfo), '("owner-document", DOMNodeOwnerDocumentPropertyInfo), '("parent-element", DOMNodeParentElementPropertyInfo), '("parent-node", DOMNodeParentNodePropertyInfo), '("prefix", DOMNodePrefixPropertyInfo), '("previous-element-sibling", DOMElementPreviousElementSiblingPropertyInfo), '("previous-sibling", DOMNodePreviousSiblingPropertyInfo), '("scroll-height", DOMElementScrollHeightPropertyInfo), '("scroll-left", DOMElementScrollLeftPropertyInfo), '("scroll-top", DOMElementScrollTopPropertyInfo), '("scroll-width", DOMElementScrollWidthPropertyInfo), '("spellcheck", DOMHTMLElementSpellcheckPropertyInfo), '("style", DOMElementStylePropertyInfo), '("tab-index", DOMHTMLElementTabIndexPropertyInfo), '("tag-name", DOMElementTagNamePropertyInfo), '("text-content", DOMNodeTextContentPropertyInfo), '("title", DOMHTMLElementTitlePropertyInfo), '("translate", DOMHTMLElementTranslatePropertyInfo), '("webkit-region-overset", DOMElementWebkitRegionOversetPropertyInfo), '("webkitdropzone", DOMHTMLElementWebkitdropzonePropertyInfo)] :: [(Symbol, *)])

type instance SignalList DOMHTMLHeadingElement = DOMHTMLHeadingElementSignalList
type DOMHTMLHeadingElementSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method DOMHTMLHeadingElement::get_align
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMHTMLHeadingElement", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMHTMLHeadingElement", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_html_heading_element_get_align" webkit_dom_html_heading_element_get_align :: 
    Ptr DOMHTMLHeadingElement ->            -- _obj : TInterface "WebKit" "DOMHTMLHeadingElement"
    IO CString


dOMHTMLHeadingElementGetAlign ::
    (MonadIO m, DOMHTMLHeadingElementK a) =>
    a ->                                    -- _obj
    m T.Text
dOMHTMLHeadingElementGetAlign _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_html_heading_element_get_align _obj'
    checkUnexpectedReturnNULL "webkit_dom_html_heading_element_get_align" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr _obj
    return result'

-- method DOMHTMLHeadingElement::set_align
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMHTMLHeadingElement", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMHTMLHeadingElement", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_html_heading_element_set_align" webkit_dom_html_heading_element_set_align :: 
    Ptr DOMHTMLHeadingElement ->            -- _obj : TInterface "WebKit" "DOMHTMLHeadingElement"
    CString ->                              -- value : TBasicType TUTF8
    IO ()


dOMHTMLHeadingElementSetAlign ::
    (MonadIO m, DOMHTMLHeadingElementK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- value
    m ()
dOMHTMLHeadingElementSetAlign _obj value = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    value' <- textToCString value
    webkit_dom_html_heading_element_set_align _obj' value'
    touchManagedPtr _obj
    freeMem value'
    return ()