{-# LANGUAGE CPP, FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, ScopedTypeVariables, TypeSynonymInstances, UndecidableInstances #-}
#if !MIN_VERSION_base(4,8,0)
{-# LANGUAGE OverlappingInstances #-}
#endif

---------- GENERATED FILE, EDITS WILL BE LOST ----------

module Graphics.UI.Qtah.Generated.Widgets.QAbstractScrollArea (
  castQAbstractScrollAreaToQWidget,
  castQWidgetToQAbstractScrollArea,
  castQAbstractScrollAreaToQObject,
  castQObjectToQAbstractScrollArea,
  QAbstractScrollAreaValue (..),
  QAbstractScrollAreaConstPtr (..),
  cornerWidget,
  horizontalScrollBar,
  horizontalScrollBarPolicy,
  maximumViewportSize,
  verticalScrollBar,
  verticalScrollBarPolicy,
  viewport,
  QAbstractScrollAreaPtr (..),
  addScrollBarWidget,
  setCornerWidget,
  setHorizontalScrollBar,
  setHorizontalScrollBarPolicy,
  setVerticalScrollBar,
  setVerticalScrollBarPolicy,
  setViewport,
  QAbstractScrollAreaConst (..),
  castQAbstractScrollAreaToConst,
  QAbstractScrollArea (..),
  castQAbstractScrollAreaToNonconst,
  new,
  newWithParent,
  QAbstractScrollAreaSuper (..),
  QAbstractScrollAreaSuperConst (..),
  ) where

import qualified Foreign as HoppyF
import qualified Foreign.C as HoppyFC
import qualified Foreign.Hoppy.Runtime as HoppyFHR
import qualified Graphics.UI.Qtah.Core.HSize as HSize
import qualified Graphics.UI.Qtah.Generated.Core.QObject as M30
import qualified Graphics.UI.Qtah.Generated.Core.QSize as M42
import qualified Graphics.UI.Qtah.Generated.Core.Types as M58
import qualified Graphics.UI.Qtah.Generated.Widgets.QScrollBar as M256
import qualified Graphics.UI.Qtah.Generated.Widgets.QWidget as M280
import Prelude (($), (.), (=<<), (==))
import qualified Prelude as HoppyP

foreign import ccall "genpop__QAbstractScrollArea_new" new' ::  HoppyP.IO (HoppyF.Ptr QAbstractScrollArea)
foreign import ccall "genpop__QAbstractScrollArea_newWithParent" newWithParent' ::  HoppyF.Ptr M280.QWidget -> HoppyP.IO (HoppyF.Ptr QAbstractScrollArea)
foreign import ccall "genpop__QAbstractScrollArea_addScrollBarWidget" addScrollBarWidget' ::  HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr M280.QWidget -> HoppyFC.CInt -> HoppyP.IO ()
foreign import ccall "genpop__QAbstractScrollArea_cornerWidget" cornerWidget' ::  HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO (HoppyF.Ptr M280.QWidget)
foreign import ccall "genpop__QAbstractScrollArea_horizontalScrollBar" horizontalScrollBar' ::  HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO (HoppyF.Ptr M256.QScrollBar)
foreign import ccall "genpop__QAbstractScrollArea_horizontalScrollBarPolicy" horizontalScrollBarPolicy' ::  HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO HoppyFC.CInt
foreign import ccall "genpop__QAbstractScrollArea_maximumViewportSize" maximumViewportSize' ::  HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO (HoppyF.Ptr M42.QSizeConst)
foreign import ccall "genpop__QAbstractScrollArea_setCornerWidget" setCornerWidget' ::  HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr M280.QWidget -> HoppyP.IO ()
foreign import ccall "genpop__QAbstractScrollArea_setHorizontalScrollBar" setHorizontalScrollBar' ::  HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr M256.QScrollBar -> HoppyP.IO ()
foreign import ccall "genpop__QAbstractScrollArea_setHorizontalScrollBarPolicy" setHorizontalScrollBarPolicy' ::  HoppyF.Ptr QAbstractScrollArea -> HoppyFC.CInt -> HoppyP.IO ()
foreign import ccall "genpop__QAbstractScrollArea_setVerticalScrollBar" setVerticalScrollBar' ::  HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr M256.QScrollBar -> HoppyP.IO ()
foreign import ccall "genpop__QAbstractScrollArea_setVerticalScrollBarPolicy" setVerticalScrollBarPolicy' ::  HoppyF.Ptr QAbstractScrollArea -> HoppyFC.CInt -> HoppyP.IO ()
foreign import ccall "genpop__QAbstractScrollArea_setViewport" setViewport' ::  HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr M280.QWidget -> HoppyP.IO ()
foreign import ccall "genpop__QAbstractScrollArea_verticalScrollBar" verticalScrollBar' ::  HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO (HoppyF.Ptr M256.QScrollBar)
foreign import ccall "genpop__QAbstractScrollArea_verticalScrollBarPolicy" verticalScrollBarPolicy' ::  HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO HoppyFC.CInt
foreign import ccall "genpop__QAbstractScrollArea_viewport" viewport' ::  HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO (HoppyF.Ptr M280.QWidget)
foreign import ccall "gencast__QAbstractScrollArea__QWidget" castQAbstractScrollAreaToQWidget :: HoppyF.Ptr QAbstractScrollAreaConst -> HoppyF.Ptr M280.QWidgetConst
foreign import ccall "gencast__QWidget__QAbstractScrollArea" castQWidgetToQAbstractScrollArea :: HoppyF.Ptr M280.QWidgetConst -> HoppyF.Ptr QAbstractScrollAreaConst
foreign import ccall "gencast__QAbstractScrollArea__QObject" castQAbstractScrollAreaToQObject :: HoppyF.Ptr QAbstractScrollAreaConst -> HoppyF.Ptr M30.QObjectConst
foreign import ccall "gencast__QObject__QAbstractScrollArea" castQObjectToQAbstractScrollArea :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr QAbstractScrollAreaConst
foreign import ccall "gendel__QAbstractScrollArea" delete'QAbstractScrollArea :: HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO ()
foreign import ccall "&gendel__QAbstractScrollArea" deletePtr'QAbstractScrollArea :: HoppyF.FunPtr (HoppyF.Ptr QAbstractScrollAreaConst -> HoppyP.IO ())

class QAbstractScrollAreaValue a where
  withQAbstractScrollAreaPtr :: a -> (QAbstractScrollAreaConst -> HoppyP.IO b) -> HoppyP.IO b

#if MIN_VERSION_base(4,8,0)
instance {-# OVERLAPPABLE #-} QAbstractScrollAreaConstPtr a => QAbstractScrollAreaValue a where
#else
instance QAbstractScrollAreaConstPtr a => QAbstractScrollAreaValue a where
#endif
  withQAbstractScrollAreaPtr = HoppyP.flip ($) . toQAbstractScrollAreaConst

class (M280.QWidgetConstPtr this) => QAbstractScrollAreaConstPtr this where
  toQAbstractScrollAreaConst :: this -> QAbstractScrollAreaConst

cornerWidget :: (QAbstractScrollAreaValue arg'1) => arg'1 -> HoppyP.IO M280.QWidget
cornerWidget arg'1 =
  withQAbstractScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap M280.QWidget
  (cornerWidget' arg'1')

horizontalScrollBar :: (QAbstractScrollAreaValue arg'1) => arg'1 -> HoppyP.IO M256.QScrollBar
horizontalScrollBar arg'1 =
  withQAbstractScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap M256.QScrollBar
  (horizontalScrollBar' arg'1')

horizontalScrollBarPolicy :: (QAbstractScrollAreaValue arg'1) => arg'1 -> HoppyP.IO M58.QtScrollBarPolicy
horizontalScrollBarPolicy arg'1 =
  withQAbstractScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap (HoppyP.toEnum . HoppyFHR.coerceIntegral)
  (horizontalScrollBarPolicy' arg'1')

maximumViewportSize :: (QAbstractScrollAreaValue arg'1) => arg'1 -> HoppyP.IO HSize.HSize
maximumViewportSize arg'1 =
  withQAbstractScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  (HoppyFHR.decodeAndDelete . M42.QSizeConst) =<<
  (maximumViewportSize' arg'1')

verticalScrollBar :: (QAbstractScrollAreaValue arg'1) => arg'1 -> HoppyP.IO M256.QScrollBar
verticalScrollBar arg'1 =
  withQAbstractScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap M256.QScrollBar
  (verticalScrollBar' arg'1')

verticalScrollBarPolicy :: (QAbstractScrollAreaValue arg'1) => arg'1 -> HoppyP.IO M58.QtScrollBarPolicy
verticalScrollBarPolicy arg'1 =
  withQAbstractScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap (HoppyP.toEnum . HoppyFHR.coerceIntegral)
  (verticalScrollBarPolicy' arg'1')

viewport :: (QAbstractScrollAreaValue arg'1) => arg'1 -> HoppyP.IO M280.QWidget
viewport arg'1 =
  withQAbstractScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap M280.QWidget
  (viewport' arg'1')

class (QAbstractScrollAreaConstPtr this, M280.QWidgetPtr this) => QAbstractScrollAreaPtr this where
  toQAbstractScrollArea :: this -> QAbstractScrollArea

addScrollBarWidget :: (QAbstractScrollAreaPtr arg'1, M280.QWidgetPtr arg'2, M58.IsQtAlignment arg'3) => arg'1 -> arg'2 -> arg'3 -> HoppyP.IO ()
addScrollBarWidget arg'1 arg'2 arg'3 =
  HoppyFHR.withCppPtr (toQAbstractScrollArea arg'1) $ \arg'1' ->
  HoppyFHR.withCppPtr (M280.toQWidget arg'2) $ \arg'2' ->
  let arg'3' = M58.fromQtAlignment $ M58.toQtAlignment arg'3 in
  (addScrollBarWidget' arg'1' arg'2' arg'3')

setCornerWidget :: (QAbstractScrollAreaPtr arg'1, M280.QWidgetPtr arg'2) => arg'1 -> arg'2 -> HoppyP.IO ()
setCornerWidget arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQAbstractScrollArea arg'1) $ \arg'1' ->
  HoppyFHR.withCppPtr (M280.toQWidget arg'2) $ \arg'2' ->
  (setCornerWidget' arg'1' arg'2')

setHorizontalScrollBar :: (QAbstractScrollAreaPtr arg'1, M256.QScrollBarPtr arg'2) => arg'1 -> arg'2 -> HoppyP.IO ()
setHorizontalScrollBar arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQAbstractScrollArea arg'1) $ \arg'1' ->
  HoppyFHR.withCppPtr (M256.toQScrollBar arg'2) $ \arg'2' ->
  (setHorizontalScrollBar' arg'1' arg'2')

setHorizontalScrollBarPolicy :: (QAbstractScrollAreaPtr arg'1) => arg'1 -> M58.QtScrollBarPolicy -> HoppyP.IO ()
setHorizontalScrollBarPolicy arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQAbstractScrollArea arg'1) $ \arg'1' ->
  let arg'2' = HoppyFHR.coerceIntegral $ HoppyP.fromEnum arg'2 in
  (setHorizontalScrollBarPolicy' arg'1' arg'2')

setVerticalScrollBar :: (QAbstractScrollAreaPtr arg'1, M256.QScrollBarPtr arg'2) => arg'1 -> arg'2 -> HoppyP.IO ()
setVerticalScrollBar arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQAbstractScrollArea arg'1) $ \arg'1' ->
  HoppyFHR.withCppPtr (M256.toQScrollBar arg'2) $ \arg'2' ->
  (setVerticalScrollBar' arg'1' arg'2')

setVerticalScrollBarPolicy :: (QAbstractScrollAreaPtr arg'1) => arg'1 -> M58.QtScrollBarPolicy -> HoppyP.IO ()
setVerticalScrollBarPolicy arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQAbstractScrollArea arg'1) $ \arg'1' ->
  let arg'2' = HoppyFHR.coerceIntegral $ HoppyP.fromEnum arg'2 in
  (setVerticalScrollBarPolicy' arg'1' arg'2')

setViewport :: (QAbstractScrollAreaPtr arg'1, M280.QWidgetPtr arg'2) => arg'1 -> arg'2 -> HoppyP.IO ()
setViewport arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQAbstractScrollArea arg'1) $ \arg'1' ->
  HoppyFHR.withCppPtr (M280.toQWidget arg'2) $ \arg'2' ->
  (setViewport' arg'1' arg'2')

data QAbstractScrollAreaConst =
    QAbstractScrollAreaConst (HoppyF.Ptr QAbstractScrollAreaConst)
  | QAbstractScrollAreaConstGc (HoppyF.ForeignPtr ()) (HoppyF.Ptr QAbstractScrollAreaConst)
  deriving (HoppyP.Show)

instance HoppyP.Eq QAbstractScrollAreaConst where
  x == y = HoppyFHR.toPtr x == HoppyFHR.toPtr y

instance HoppyP.Ord QAbstractScrollAreaConst where
  compare x y = HoppyP.compare (HoppyFHR.toPtr x) (HoppyFHR.toPtr y)

castQAbstractScrollAreaToConst :: QAbstractScrollArea -> QAbstractScrollAreaConst
castQAbstractScrollAreaToConst (QAbstractScrollArea ptr') = QAbstractScrollAreaConst $ HoppyF.castPtr ptr'
castQAbstractScrollAreaToConst (QAbstractScrollAreaGc fptr' ptr') = QAbstractScrollAreaConstGc fptr' $ HoppyF.castPtr ptr'

instance HoppyFHR.CppPtr QAbstractScrollAreaConst where
  nullptr = QAbstractScrollAreaConst HoppyF.nullPtr
  
  withCppPtr (QAbstractScrollAreaConst ptr') f' = f' ptr'
  withCppPtr (QAbstractScrollAreaConstGc fptr' ptr') f' = HoppyF.withForeignPtr fptr' $ \_ -> f' ptr'
  
  toPtr (QAbstractScrollAreaConst ptr') = ptr'
  toPtr (QAbstractScrollAreaConstGc _ ptr') = ptr'
  
  touchCppPtr (QAbstractScrollAreaConst _) = HoppyP.return ()
  touchCppPtr (QAbstractScrollAreaConstGc fptr' _) = HoppyF.touchForeignPtr fptr'

instance HoppyFHR.Deletable QAbstractScrollAreaConst where
  delete (QAbstractScrollAreaConst ptr') = delete'QAbstractScrollArea ptr'
  delete (QAbstractScrollAreaConstGc _ _) = HoppyP.fail $ HoppyP.concat ["Deletable.delete: Asked to delete a GC-managed ", "QAbstractScrollAreaConst", " object."]
  
  toGc this'@(QAbstractScrollAreaConst ptr') = if ptr' == HoppyF.nullPtr then HoppyP.return this' else HoppyP.fmap (HoppyP.flip QAbstractScrollAreaConstGc ptr') $ HoppyF.newForeignPtr (HoppyF.castFunPtr deletePtr'QAbstractScrollArea :: HoppyF.FunPtr (HoppyF.Ptr () -> HoppyP.IO ())) (HoppyF.castPtr ptr' :: HoppyF.Ptr ())
  toGc this'@(QAbstractScrollAreaConstGc {}) = HoppyP.return this'

instance QAbstractScrollAreaConstPtr QAbstractScrollAreaConst where
  toQAbstractScrollAreaConst = HoppyP.id

instance M280.QWidgetConstPtr QAbstractScrollAreaConst where
  toQWidgetConst (QAbstractScrollAreaConst ptr') = M280.QWidgetConst $ castQAbstractScrollAreaToQWidget ptr'
  toQWidgetConst (QAbstractScrollAreaConstGc fptr' ptr') = M280.QWidgetConstGc fptr' $ castQAbstractScrollAreaToQWidget ptr'

instance M30.QObjectConstPtr QAbstractScrollAreaConst where
  toQObjectConst (QAbstractScrollAreaConst ptr') = M30.QObjectConst $ castQAbstractScrollAreaToQObject ptr'
  toQObjectConst (QAbstractScrollAreaConstGc fptr' ptr') = M30.QObjectConstGc fptr' $ castQAbstractScrollAreaToQObject ptr'

data QAbstractScrollArea =
    QAbstractScrollArea (HoppyF.Ptr QAbstractScrollArea)
  | QAbstractScrollAreaGc (HoppyF.ForeignPtr ()) (HoppyF.Ptr QAbstractScrollArea)
  deriving (HoppyP.Show)

instance HoppyP.Eq QAbstractScrollArea where
  x == y = HoppyFHR.toPtr x == HoppyFHR.toPtr y

instance HoppyP.Ord QAbstractScrollArea where
  compare x y = HoppyP.compare (HoppyFHR.toPtr x) (HoppyFHR.toPtr y)

castQAbstractScrollAreaToNonconst :: QAbstractScrollAreaConst -> QAbstractScrollArea
castQAbstractScrollAreaToNonconst (QAbstractScrollAreaConst ptr') = QAbstractScrollArea $ HoppyF.castPtr ptr'
castQAbstractScrollAreaToNonconst (QAbstractScrollAreaConstGc fptr' ptr') = QAbstractScrollAreaGc fptr' $ HoppyF.castPtr ptr'

instance HoppyFHR.CppPtr QAbstractScrollArea where
  nullptr = QAbstractScrollArea HoppyF.nullPtr
  
  withCppPtr (QAbstractScrollArea ptr') f' = f' ptr'
  withCppPtr (QAbstractScrollAreaGc fptr' ptr') f' = HoppyF.withForeignPtr fptr' $ \_ -> f' ptr'
  
  toPtr (QAbstractScrollArea ptr') = ptr'
  toPtr (QAbstractScrollAreaGc _ ptr') = ptr'
  
  touchCppPtr (QAbstractScrollArea _) = HoppyP.return ()
  touchCppPtr (QAbstractScrollAreaGc fptr' _) = HoppyF.touchForeignPtr fptr'

instance HoppyFHR.Deletable QAbstractScrollArea where
  delete (QAbstractScrollArea ptr') = delete'QAbstractScrollArea $ (HoppyF.castPtr ptr' :: HoppyF.Ptr QAbstractScrollAreaConst)
  delete (QAbstractScrollAreaGc _ _) = HoppyP.fail $ HoppyP.concat ["Deletable.delete: Asked to delete a GC-managed ", "QAbstractScrollArea", " object."]
  
  toGc this'@(QAbstractScrollArea ptr') = if ptr' == HoppyF.nullPtr then HoppyP.return this' else HoppyP.fmap (HoppyP.flip QAbstractScrollAreaGc ptr') $ HoppyF.newForeignPtr (HoppyF.castFunPtr deletePtr'QAbstractScrollArea :: HoppyF.FunPtr (HoppyF.Ptr () -> HoppyP.IO ())) (HoppyF.castPtr ptr' :: HoppyF.Ptr ())
  toGc this'@(QAbstractScrollAreaGc {}) = HoppyP.return this'

instance QAbstractScrollAreaConstPtr QAbstractScrollArea where
  toQAbstractScrollAreaConst (QAbstractScrollArea ptr') = QAbstractScrollAreaConst $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'
  toQAbstractScrollAreaConst (QAbstractScrollAreaGc fptr' ptr') = QAbstractScrollAreaConstGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'

instance QAbstractScrollAreaPtr QAbstractScrollArea where
  toQAbstractScrollArea = HoppyP.id

instance M280.QWidgetConstPtr QAbstractScrollArea where
  toQWidgetConst (QAbstractScrollArea ptr') = M280.QWidgetConst $ castQAbstractScrollAreaToQWidget $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'
  toQWidgetConst (QAbstractScrollAreaGc fptr' ptr') = M280.QWidgetConstGc fptr' $ castQAbstractScrollAreaToQWidget $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'

instance M280.QWidgetPtr QAbstractScrollArea where
  toQWidget (QAbstractScrollArea ptr') = M280.QWidget $ (HoppyF.castPtr :: HoppyF.Ptr M280.QWidgetConst -> HoppyF.Ptr M280.QWidget) $ castQAbstractScrollAreaToQWidget $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'
  toQWidget (QAbstractScrollAreaGc fptr' ptr') = M280.QWidgetGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M280.QWidgetConst -> HoppyF.Ptr M280.QWidget) $ castQAbstractScrollAreaToQWidget $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'

instance M30.QObjectConstPtr QAbstractScrollArea where
  toQObjectConst (QAbstractScrollArea ptr') = M30.QObjectConst $ castQAbstractScrollAreaToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'
  toQObjectConst (QAbstractScrollAreaGc fptr' ptr') = M30.QObjectConstGc fptr' $ castQAbstractScrollAreaToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'

instance M30.QObjectPtr QAbstractScrollArea where
  toQObject (QAbstractScrollArea ptr') = M30.QObject $ (HoppyF.castPtr :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr M30.QObject) $ castQAbstractScrollAreaToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'
  toQObject (QAbstractScrollAreaGc fptr' ptr') = M30.QObjectGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr M30.QObject) $ castQAbstractScrollAreaToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QAbstractScrollArea -> HoppyF.Ptr QAbstractScrollAreaConst) ptr'

new ::  HoppyP.IO QAbstractScrollArea
new =
  HoppyP.fmap QAbstractScrollArea
  (new')

newWithParent :: (M280.QWidgetPtr arg'1) => arg'1 -> HoppyP.IO QAbstractScrollArea
newWithParent arg'1 =
  HoppyFHR.withCppPtr (M280.toQWidget arg'1) $ \arg'1' ->
  HoppyP.fmap QAbstractScrollArea
  (newWithParent' arg'1')

class QAbstractScrollAreaSuper a where
  downToQAbstractScrollArea :: a -> QAbstractScrollArea

instance QAbstractScrollAreaSuper M280.QWidget where
  downToQAbstractScrollArea = castQAbstractScrollAreaToNonconst . cast' . M280.castQWidgetToConst
    where
      cast' (M280.QWidgetConst ptr') = QAbstractScrollAreaConst $ castQWidgetToQAbstractScrollArea ptr'
      cast' (M280.QWidgetConstGc fptr' ptr') = QAbstractScrollAreaConstGc fptr' $ castQWidgetToQAbstractScrollArea ptr'
instance QAbstractScrollAreaSuper M30.QObject where
  downToQAbstractScrollArea = castQAbstractScrollAreaToNonconst . cast' . M30.castQObjectToConst
    where
      cast' (M30.QObjectConst ptr') = QAbstractScrollAreaConst $ castQObjectToQAbstractScrollArea ptr'
      cast' (M30.QObjectConstGc fptr' ptr') = QAbstractScrollAreaConstGc fptr' $ castQObjectToQAbstractScrollArea ptr'

class QAbstractScrollAreaSuperConst a where
  downToQAbstractScrollAreaConst :: a -> QAbstractScrollAreaConst

instance QAbstractScrollAreaSuperConst M280.QWidgetConst where
  downToQAbstractScrollAreaConst = cast'
    where
      cast' (M280.QWidgetConst ptr') = QAbstractScrollAreaConst $ castQWidgetToQAbstractScrollArea ptr'
      cast' (M280.QWidgetConstGc fptr' ptr') = QAbstractScrollAreaConstGc fptr' $ castQWidgetToQAbstractScrollArea ptr'
instance QAbstractScrollAreaSuperConst M30.QObjectConst where
  downToQAbstractScrollAreaConst = cast'
    where
      cast' (M30.QObjectConst ptr') = QAbstractScrollAreaConst $ castQObjectToQAbstractScrollArea ptr'
      cast' (M30.QObjectConstGc fptr' ptr') = QAbstractScrollAreaConstGc fptr' $ castQObjectToQAbstractScrollArea ptr'

instance HoppyFHR.Assignable (HoppyF.Ptr (HoppyF.Ptr QAbstractScrollArea)) QAbstractScrollArea where
  assign ptr' value' = HoppyF.poke ptr' $ HoppyFHR.toPtr value'

instance HoppyFHR.Decodable (HoppyF.Ptr (HoppyF.Ptr QAbstractScrollArea)) QAbstractScrollArea where
  decode = HoppyP.fmap QAbstractScrollArea . HoppyF.peek