{- |
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.DOMHTMLMenuElement
    ( 

-- * Exported types
    DOMHTMLMenuElement(..)                  ,
    DOMHTMLMenuElementK                     ,
    toDOMHTMLMenuElement                    ,
    noDOMHTMLMenuElement                    ,


 -- * Methods
-- ** dOMHTMLMenuElementGetCompact
    dOMHTMLMenuElementGetCompact            ,


-- ** dOMHTMLMenuElementSetCompact
    dOMHTMLMenuElementSetCompact            ,




 -- * Properties
-- ** Compact
    DOMHTMLMenuElementCompactPropertyInfo   ,
    constructDOMHTMLMenuElementCompact      ,
    getDOMHTMLMenuElementCompact            ,
    setDOMHTMLMenuElementCompact            ,




    ) 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 DOMHTMLMenuElement = DOMHTMLMenuElement (ForeignPtr DOMHTMLMenuElement)
foreign import ccall "webkit_dom_html_menu_element_get_type"
    c_webkit_dom_html_menu_element_get_type :: IO GType

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

instance GObject DOMHTMLMenuElement where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_webkit_dom_html_menu_element_get_type
    

class GObject o => DOMHTMLMenuElementK o
instance (GObject o, IsDescendantOf DOMHTMLMenuElement o) => DOMHTMLMenuElementK o

toDOMHTMLMenuElement :: DOMHTMLMenuElementK o => o -> IO DOMHTMLMenuElement
toDOMHTMLMenuElement = unsafeCastTo DOMHTMLMenuElement

noDOMHTMLMenuElement :: Maybe DOMHTMLMenuElement
noDOMHTMLMenuElement = Nothing

-- VVV Prop "compact"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]

getDOMHTMLMenuElementCompact :: (MonadIO m, DOMHTMLMenuElementK o) => o -> m Bool
getDOMHTMLMenuElementCompact obj = liftIO $ getObjectPropertyBool obj "compact"

setDOMHTMLMenuElementCompact :: (MonadIO m, DOMHTMLMenuElementK o) => o -> Bool -> m ()
setDOMHTMLMenuElementCompact obj val = liftIO $ setObjectPropertyBool obj "compact" val

constructDOMHTMLMenuElementCompact :: Bool -> IO ([Char], GValue)
constructDOMHTMLMenuElementCompact val = constructObjectPropertyBool "compact" val

data DOMHTMLMenuElementCompactPropertyInfo
instance AttrInfo DOMHTMLMenuElementCompactPropertyInfo where
    type AttrAllowedOps DOMHTMLMenuElementCompactPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DOMHTMLMenuElementCompactPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint DOMHTMLMenuElementCompactPropertyInfo = DOMHTMLMenuElementK
    type AttrGetType DOMHTMLMenuElementCompactPropertyInfo = Bool
    type AttrLabel DOMHTMLMenuElementCompactPropertyInfo = "DOMHTMLMenuElement::compact"
    attrGet _ = getDOMHTMLMenuElementCompact
    attrSet _ = setDOMHTMLMenuElementCompact
    attrConstruct _ = constructDOMHTMLMenuElementCompact

type instance AttributeList DOMHTMLMenuElement = DOMHTMLMenuElementAttributeList
type DOMHTMLMenuElementAttributeList = ('[ '("access-key", DOMHTMLElementAccessKeyPropertyInfo), '("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), '("compact", DOMHTMLMenuElementCompactPropertyInfo), '("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 DOMHTMLMenuElement = DOMHTMLMenuElementSignalList
type DOMHTMLMenuElementSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

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

foreign import ccall "webkit_dom_html_menu_element_get_compact" webkit_dom_html_menu_element_get_compact :: 
    Ptr DOMHTMLMenuElement ->               -- _obj : TInterface "WebKit" "DOMHTMLMenuElement"
    IO CInt


dOMHTMLMenuElementGetCompact ::
    (MonadIO m, DOMHTMLMenuElementK a) =>
    a ->                                    -- _obj
    m Bool
dOMHTMLMenuElementGetCompact _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_html_menu_element_get_compact _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method DOMHTMLMenuElement::set_compact
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMHTMLMenuElement", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMHTMLMenuElement", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TBoolean, 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_menu_element_set_compact" webkit_dom_html_menu_element_set_compact :: 
    Ptr DOMHTMLMenuElement ->               -- _obj : TInterface "WebKit" "DOMHTMLMenuElement"
    CInt ->                                 -- value : TBasicType TBoolean
    IO ()


dOMHTMLMenuElementSetCompact ::
    (MonadIO m, DOMHTMLMenuElementK a) =>
    a ->                                    -- _obj
    Bool ->                                 -- value
    m ()
dOMHTMLMenuElementSetCompact _obj value = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let value' = (fromIntegral . fromEnum) value
    webkit_dom_html_menu_element_set_compact _obj' value'
    touchManagedPtr _obj
    return ()