{- |
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.WebKit2WebExtension.Objects.DOMProcessingInstruction
    ( 

-- * Exported types
    DOMProcessingInstruction(..)            ,
    IsDOMProcessingInstruction              ,
    toDOMProcessingInstruction              ,
    noDOMProcessingInstruction              ,


 -- * Methods
-- ** getSheet #method:getSheet#
    DOMProcessingInstructionGetSheetMethodInfo,
    dOMProcessingInstructionGetSheet        ,


-- ** getTarget #method:getTarget#
    DOMProcessingInstructionGetTargetMethodInfo,
    dOMProcessingInstructionGetTarget       ,




 -- * Properties
-- ** sheet #attr:sheet#
    DOMProcessingInstructionSheetPropertyInfo,
    dOMProcessingInstructionSheet           ,
    getDOMProcessingInstructionSheet        ,


-- ** target #attr:target#
    DOMProcessingInstructionTargetPropertyInfo,
    dOMProcessingInstructionTarget          ,
    getDOMProcessingInstructionTarget       ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Interfaces.DOMEventTarget as WebKit2WebExtension.DOMEventTarget
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMCharacterData as WebKit2WebExtension.DOMCharacterData
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMNode as WebKit2WebExtension.DOMNode
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMObject as WebKit2WebExtension.DOMObject
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMStyleSheet as WebKit2WebExtension.DOMStyleSheet

newtype DOMProcessingInstruction = DOMProcessingInstruction (ManagedPtr DOMProcessingInstruction)
foreign import ccall "webkit_dom_processing_instruction_get_type"
    c_webkit_dom_processing_instruction_get_type :: IO GType

instance GObject DOMProcessingInstruction where
    gobjectType _ = c_webkit_dom_processing_instruction_get_type
    

class GObject o => IsDOMProcessingInstruction o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DOMProcessingInstruction a) =>
    IsDOMProcessingInstruction a
#endif
instance IsDOMProcessingInstruction DOMProcessingInstruction
instance WebKit2WebExtension.DOMCharacterData.IsDOMCharacterData DOMProcessingInstruction
instance WebKit2WebExtension.DOMNode.IsDOMNode DOMProcessingInstruction
instance WebKit2WebExtension.DOMObject.IsDOMObject DOMProcessingInstruction
instance GObject.Object.IsObject DOMProcessingInstruction
instance WebKit2WebExtension.DOMEventTarget.IsDOMEventTarget DOMProcessingInstruction

toDOMProcessingInstruction :: IsDOMProcessingInstruction o => o -> IO DOMProcessingInstruction
toDOMProcessingInstruction = unsafeCastTo DOMProcessingInstruction

noDOMProcessingInstruction :: Maybe DOMProcessingInstruction
noDOMProcessingInstruction = Nothing

type family ResolveDOMProcessingInstructionMethod (t :: Symbol) (o :: *) :: * where
    ResolveDOMProcessingInstructionMethod "addEventListener" o = WebKit2WebExtension.DOMEventTarget.DOMEventTargetAddEventListenerMethodInfo
    ResolveDOMProcessingInstructionMethod "appendChild" o = WebKit2WebExtension.DOMNode.DOMNodeAppendChildMethodInfo
    ResolveDOMProcessingInstructionMethod "appendData" o = WebKit2WebExtension.DOMCharacterData.DOMCharacterDataAppendDataMethodInfo
    ResolveDOMProcessingInstructionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDOMProcessingInstructionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDOMProcessingInstructionMethod "cloneNodeWithError" o = WebKit2WebExtension.DOMNode.DOMNodeCloneNodeWithErrorMethodInfo
    ResolveDOMProcessingInstructionMethod "compareDocumentPosition" o = WebKit2WebExtension.DOMNode.DOMNodeCompareDocumentPositionMethodInfo
    ResolveDOMProcessingInstructionMethod "contains" o = WebKit2WebExtension.DOMNode.DOMNodeContainsMethodInfo
    ResolveDOMProcessingInstructionMethod "deleteData" o = WebKit2WebExtension.DOMCharacterData.DOMCharacterDataDeleteDataMethodInfo
    ResolveDOMProcessingInstructionMethod "dispatchEvent" o = WebKit2WebExtension.DOMEventTarget.DOMEventTargetDispatchEventMethodInfo
    ResolveDOMProcessingInstructionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDOMProcessingInstructionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDOMProcessingInstructionMethod "hasChildNodes" o = WebKit2WebExtension.DOMNode.DOMNodeHasChildNodesMethodInfo
    ResolveDOMProcessingInstructionMethod "insertBefore" o = WebKit2WebExtension.DOMNode.DOMNodeInsertBeforeMethodInfo
    ResolveDOMProcessingInstructionMethod "insertData" o = WebKit2WebExtension.DOMCharacterData.DOMCharacterDataInsertDataMethodInfo
    ResolveDOMProcessingInstructionMethod "isDefaultNamespace" o = WebKit2WebExtension.DOMNode.DOMNodeIsDefaultNamespaceMethodInfo
    ResolveDOMProcessingInstructionMethod "isEqualNode" o = WebKit2WebExtension.DOMNode.DOMNodeIsEqualNodeMethodInfo
    ResolveDOMProcessingInstructionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDOMProcessingInstructionMethod "isSameNode" o = WebKit2WebExtension.DOMNode.DOMNodeIsSameNodeMethodInfo
    ResolveDOMProcessingInstructionMethod "isSupported" o = WebKit2WebExtension.DOMNode.DOMNodeIsSupportedMethodInfo
    ResolveDOMProcessingInstructionMethod "lookupNamespaceUri" o = WebKit2WebExtension.DOMNode.DOMNodeLookupNamespaceUriMethodInfo
    ResolveDOMProcessingInstructionMethod "lookupPrefix" o = WebKit2WebExtension.DOMNode.DOMNodeLookupPrefixMethodInfo
    ResolveDOMProcessingInstructionMethod "normalize" o = WebKit2WebExtension.DOMNode.DOMNodeNormalizeMethodInfo
    ResolveDOMProcessingInstructionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDOMProcessingInstructionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDOMProcessingInstructionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDOMProcessingInstructionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDOMProcessingInstructionMethod "removeChild" o = WebKit2WebExtension.DOMNode.DOMNodeRemoveChildMethodInfo
    ResolveDOMProcessingInstructionMethod "removeEventListener" o = WebKit2WebExtension.DOMEventTarget.DOMEventTargetRemoveEventListenerMethodInfo
    ResolveDOMProcessingInstructionMethod "replaceChild" o = WebKit2WebExtension.DOMNode.DOMNodeReplaceChildMethodInfo
    ResolveDOMProcessingInstructionMethod "replaceData" o = WebKit2WebExtension.DOMCharacterData.DOMCharacterDataReplaceDataMethodInfo
    ResolveDOMProcessingInstructionMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveDOMProcessingInstructionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDOMProcessingInstructionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDOMProcessingInstructionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDOMProcessingInstructionMethod "substringData" o = WebKit2WebExtension.DOMCharacterData.DOMCharacterDataSubstringDataMethodInfo
    ResolveDOMProcessingInstructionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDOMProcessingInstructionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDOMProcessingInstructionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDOMProcessingInstructionMethod "getBaseUri" o = WebKit2WebExtension.DOMNode.DOMNodeGetBaseUriMethodInfo
    ResolveDOMProcessingInstructionMethod "getChildNodes" o = WebKit2WebExtension.DOMNode.DOMNodeGetChildNodesMethodInfo
    ResolveDOMProcessingInstructionMethod "getData" o = WebKit2WebExtension.DOMCharacterData.DOMCharacterDataGetDataMethodInfo
    ResolveDOMProcessingInstructionMethod "getFirstChild" o = WebKit2WebExtension.DOMNode.DOMNodeGetFirstChildMethodInfo
    ResolveDOMProcessingInstructionMethod "getLastChild" o = WebKit2WebExtension.DOMNode.DOMNodeGetLastChildMethodInfo
    ResolveDOMProcessingInstructionMethod "getLength" o = WebKit2WebExtension.DOMCharacterData.DOMCharacterDataGetLengthMethodInfo
    ResolveDOMProcessingInstructionMethod "getLocalName" o = WebKit2WebExtension.DOMNode.DOMNodeGetLocalNameMethodInfo
    ResolveDOMProcessingInstructionMethod "getNamespaceUri" o = WebKit2WebExtension.DOMNode.DOMNodeGetNamespaceUriMethodInfo
    ResolveDOMProcessingInstructionMethod "getNextSibling" o = WebKit2WebExtension.DOMNode.DOMNodeGetNextSiblingMethodInfo
    ResolveDOMProcessingInstructionMethod "getNodeName" o = WebKit2WebExtension.DOMNode.DOMNodeGetNodeNameMethodInfo
    ResolveDOMProcessingInstructionMethod "getNodeType" o = WebKit2WebExtension.DOMNode.DOMNodeGetNodeTypeMethodInfo
    ResolveDOMProcessingInstructionMethod "getNodeValue" o = WebKit2WebExtension.DOMNode.DOMNodeGetNodeValueMethodInfo
    ResolveDOMProcessingInstructionMethod "getOwnerDocument" o = WebKit2WebExtension.DOMNode.DOMNodeGetOwnerDocumentMethodInfo
    ResolveDOMProcessingInstructionMethod "getParentElement" o = WebKit2WebExtension.DOMNode.DOMNodeGetParentElementMethodInfo
    ResolveDOMProcessingInstructionMethod "getParentNode" o = WebKit2WebExtension.DOMNode.DOMNodeGetParentNodeMethodInfo
    ResolveDOMProcessingInstructionMethod "getPrefix" o = WebKit2WebExtension.DOMNode.DOMNodeGetPrefixMethodInfo
    ResolveDOMProcessingInstructionMethod "getPreviousSibling" o = WebKit2WebExtension.DOMNode.DOMNodeGetPreviousSiblingMethodInfo
    ResolveDOMProcessingInstructionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDOMProcessingInstructionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDOMProcessingInstructionMethod "getSheet" o = DOMProcessingInstructionGetSheetMethodInfo
    ResolveDOMProcessingInstructionMethod "getTarget" o = DOMProcessingInstructionGetTargetMethodInfo
    ResolveDOMProcessingInstructionMethod "getTextContent" o = WebKit2WebExtension.DOMNode.DOMNodeGetTextContentMethodInfo
    ResolveDOMProcessingInstructionMethod "setData" o = WebKit2WebExtension.DOMCharacterData.DOMCharacterDataSetDataMethodInfo
    ResolveDOMProcessingInstructionMethod "setNodeValue" o = WebKit2WebExtension.DOMNode.DOMNodeSetNodeValueMethodInfo
    ResolveDOMProcessingInstructionMethod "setPrefix" o = WebKit2WebExtension.DOMNode.DOMNodeSetPrefixMethodInfo
    ResolveDOMProcessingInstructionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDOMProcessingInstructionMethod "setTextContent" o = WebKit2WebExtension.DOMNode.DOMNodeSetTextContentMethodInfo
    ResolveDOMProcessingInstructionMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDOMProcessingInstructionMethod t DOMProcessingInstruction, O.MethodInfo info DOMProcessingInstruction p) => O.IsLabelProxy t (DOMProcessingInstruction -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDOMProcessingInstructionMethod t DOMProcessingInstruction, O.MethodInfo info DOMProcessingInstruction p) => O.IsLabel t (DOMProcessingInstruction -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "sheet"
   -- Type: TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMStyleSheet"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDOMProcessingInstructionSheet :: (MonadIO m, IsDOMProcessingInstruction o) => o -> m (Maybe WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet)
getDOMProcessingInstructionSheet obj = liftIO $ getObjectPropertyObject obj "sheet" WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet

data DOMProcessingInstructionSheetPropertyInfo
instance AttrInfo DOMProcessingInstructionSheetPropertyInfo where
    type AttrAllowedOps DOMProcessingInstructionSheetPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMProcessingInstructionSheetPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMProcessingInstructionSheetPropertyInfo = IsDOMProcessingInstruction
    type AttrGetType DOMProcessingInstructionSheetPropertyInfo = (Maybe WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet)
    type AttrLabel DOMProcessingInstructionSheetPropertyInfo = "sheet"
    type AttrOrigin DOMProcessingInstructionSheetPropertyInfo = DOMProcessingInstruction
    attrGet _ = getDOMProcessingInstructionSheet
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "target"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDOMProcessingInstructionTarget :: (MonadIO m, IsDOMProcessingInstruction o) => o -> m (Maybe T.Text)
getDOMProcessingInstructionTarget obj = liftIO $ getObjectPropertyString obj "target"

data DOMProcessingInstructionTargetPropertyInfo
instance AttrInfo DOMProcessingInstructionTargetPropertyInfo where
    type AttrAllowedOps DOMProcessingInstructionTargetPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMProcessingInstructionTargetPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMProcessingInstructionTargetPropertyInfo = IsDOMProcessingInstruction
    type AttrGetType DOMProcessingInstructionTargetPropertyInfo = (Maybe T.Text)
    type AttrLabel DOMProcessingInstructionTargetPropertyInfo = "target"
    type AttrOrigin DOMProcessingInstructionTargetPropertyInfo = DOMProcessingInstruction
    attrGet _ = getDOMProcessingInstructionTarget
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList DOMProcessingInstruction
type instance O.AttributeList DOMProcessingInstruction = DOMProcessingInstructionAttributeList
type DOMProcessingInstructionAttributeList = ('[ '("baseUri", WebKit2WebExtension.DOMNode.DOMNodeBaseUriPropertyInfo), '("childNodes", WebKit2WebExtension.DOMNode.DOMNodeChildNodesPropertyInfo), '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("data", WebKit2WebExtension.DOMCharacterData.DOMCharacterDataDataPropertyInfo), '("firstChild", WebKit2WebExtension.DOMNode.DOMNodeFirstChildPropertyInfo), '("lastChild", WebKit2WebExtension.DOMNode.DOMNodeLastChildPropertyInfo), '("length", WebKit2WebExtension.DOMCharacterData.DOMCharacterDataLengthPropertyInfo), '("nextSibling", WebKit2WebExtension.DOMNode.DOMNodeNextSiblingPropertyInfo), '("nodeName", WebKit2WebExtension.DOMNode.DOMNodeNodeNamePropertyInfo), '("nodeType", WebKit2WebExtension.DOMNode.DOMNodeNodeTypePropertyInfo), '("nodeValue", WebKit2WebExtension.DOMNode.DOMNodeNodeValuePropertyInfo), '("ownerDocument", WebKit2WebExtension.DOMNode.DOMNodeOwnerDocumentPropertyInfo), '("parentElement", WebKit2WebExtension.DOMNode.DOMNodeParentElementPropertyInfo), '("parentNode", WebKit2WebExtension.DOMNode.DOMNodeParentNodePropertyInfo), '("previousSibling", WebKit2WebExtension.DOMNode.DOMNodePreviousSiblingPropertyInfo), '("sheet", DOMProcessingInstructionSheetPropertyInfo), '("target", DOMProcessingInstructionTargetPropertyInfo), '("textContent", WebKit2WebExtension.DOMNode.DOMNodeTextContentPropertyInfo)] :: [(Symbol, *)])

dOMProcessingInstructionSheet :: AttrLabelProxy "sheet"
dOMProcessingInstructionSheet = AttrLabelProxy

dOMProcessingInstructionTarget :: AttrLabelProxy "target"
dOMProcessingInstructionTarget = AttrLabelProxy

type instance O.SignalList DOMProcessingInstruction = DOMProcessingInstructionSignalList
type DOMProcessingInstructionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method DOMProcessingInstruction::get_sheet
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMProcessingInstruction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMProcessingInstruction", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMStyleSheet"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_processing_instruction_get_sheet" webkit_dom_processing_instruction_get_sheet :: 
    Ptr DOMProcessingInstruction ->         -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMProcessingInstruction"})
    IO (Ptr WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet)

{- |
/No description available in the introspection data./
-}
dOMProcessingInstructionGetSheet ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMProcessingInstruction a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMProcessingInstruction.DOMProcessingInstruction' -}
    -> m WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet
    {- ^ __Returns:__ A 'GI.WebKit2WebExtension.Objects.DOMStyleSheet.DOMStyleSheet' -}
dOMProcessingInstructionGetSheet self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_processing_instruction_get_sheet self'
    checkUnexpectedReturnNULL "dOMProcessingInstructionGetSheet" result
    result' <- (wrapObject WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet) result
    touchManagedPtr self
    return result'

data DOMProcessingInstructionGetSheetMethodInfo
instance (signature ~ (m WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet), MonadIO m, IsDOMProcessingInstruction a) => O.MethodInfo DOMProcessingInstructionGetSheetMethodInfo a signature where
    overloadedMethod _ = dOMProcessingInstructionGetSheet

-- method DOMProcessingInstruction::get_target
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMProcessingInstruction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMProcessingInstruction", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_processing_instruction_get_target" webkit_dom_processing_instruction_get_target :: 
    Ptr DOMProcessingInstruction ->         -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMProcessingInstruction"})
    IO CString

{- |
/No description available in the introspection data./
-}
dOMProcessingInstructionGetTarget ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMProcessingInstruction a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMProcessingInstruction.DOMProcessingInstruction' -}
    -> m T.Text
    {- ^ __Returns:__ A @/gchar/@ -}
dOMProcessingInstructionGetTarget self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_processing_instruction_get_target self'
    checkUnexpectedReturnNULL "dOMProcessingInstructionGetTarget" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

data DOMProcessingInstructionGetTargetMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDOMProcessingInstruction a) => O.MethodInfo DOMProcessingInstructionGetTargetMethodInfo a signature where
    overloadedMethod _ = dOMProcessingInstructionGetTarget