{-# 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.QScrollArea (
  castQScrollAreaToQAbstractScrollArea,
  castQAbstractScrollAreaToQScrollArea,
  castQScrollAreaToQWidget,
  castQWidgetToQScrollArea,
  castQScrollAreaToQObject,
  castQObjectToQScrollArea,
  QScrollAreaValue (..),
  QScrollAreaConstPtr (..),
  alignment,
  widget,
  widgetResizable,
  QScrollAreaPtr (..),
  setAlignment,
  ensureVisible,
  ensureVisibleWithMargins,
  ensureWidgetVisible,
  ensureWidgetVisibleWithMargins,
  takeWidget,
  setWidget,
  setWidgetResizable,
  QScrollAreaConst (..),
  castQScrollAreaToConst,
  QScrollArea (..),
  castQScrollAreaToNonconst,
  new,
  newWithParent,
  QScrollAreaSuper (..),
  QScrollAreaSuperConst (..),
  ) where

import qualified Foreign as HoppyF
import qualified Foreign.C as HoppyFC
import qualified Foreign.Hoppy.Runtime as HoppyFHR
import qualified Graphics.UI.Qtah.Generated.Core.QObject as M30
import qualified Graphics.UI.Qtah.Generated.Core.Types as M58
import qualified Graphics.UI.Qtah.Generated.Widgets.QAbstractScrollArea as M168
import qualified Graphics.UI.Qtah.Generated.Widgets.QWidget as M280
import Prelude (($), (.), (/=), (==))
import qualified Prelude as HoppyP

foreign import ccall "genpop__QScrollArea_new" new' ::  HoppyP.IO (HoppyF.Ptr QScrollArea)
foreign import ccall "genpop__QScrollArea_newWithParent" newWithParent' ::  HoppyF.Ptr M280.QWidget -> HoppyP.IO (HoppyF.Ptr QScrollArea)
foreign import ccall "genpop__QScrollArea_alignment" alignment' ::  HoppyF.Ptr QScrollAreaConst -> HoppyP.IO HoppyFC.CInt
foreign import ccall "genpop__QScrollArea_setAlignment" setAlignment' ::  HoppyF.Ptr QScrollArea -> HoppyFC.CInt -> HoppyP.IO ()
foreign import ccall "genpop__QScrollArea_ensureVisible" ensureVisible' ::  HoppyF.Ptr QScrollArea -> HoppyFC.CInt -> HoppyFC.CInt -> HoppyP.IO ()
foreign import ccall "genpop__QScrollArea_ensureVisibleWithMargins" ensureVisibleWithMargins' ::  HoppyF.Ptr QScrollArea -> HoppyFC.CInt -> HoppyFC.CInt -> HoppyFC.CInt -> HoppyFC.CInt -> HoppyP.IO ()
foreign import ccall "genpop__QScrollArea_ensureWidgetVisible" ensureWidgetVisible' ::  HoppyF.Ptr QScrollArea -> HoppyF.Ptr M280.QWidget -> HoppyP.IO ()
foreign import ccall "genpop__QScrollArea_ensureWidgetVisibleWithMargins" ensureWidgetVisibleWithMargins' ::  HoppyF.Ptr QScrollArea -> HoppyF.Ptr M280.QWidget -> HoppyFC.CInt -> HoppyFC.CInt -> HoppyP.IO ()
foreign import ccall "genpop__QScrollArea_takeWidget" takeWidget' ::  HoppyF.Ptr QScrollArea -> HoppyP.IO (HoppyF.Ptr M280.QWidget)
foreign import ccall "genpop__QScrollArea_widget" widget' ::  HoppyF.Ptr QScrollAreaConst -> HoppyP.IO (HoppyF.Ptr M280.QWidget)
foreign import ccall "genpop__QScrollArea_setWidget" setWidget' ::  HoppyF.Ptr QScrollArea -> HoppyF.Ptr M280.QWidget -> HoppyP.IO ()
foreign import ccall "genpop__QScrollArea_widgetResizable" widgetResizable' ::  HoppyF.Ptr QScrollAreaConst -> HoppyP.IO HoppyFHR.CBool
foreign import ccall "genpop__QScrollArea_setWidgetResizable" setWidgetResizable' ::  HoppyF.Ptr QScrollArea -> HoppyFHR.CBool -> HoppyP.IO ()
foreign import ccall "gencast__QScrollArea__QAbstractScrollArea" castQScrollAreaToQAbstractScrollArea :: HoppyF.Ptr QScrollAreaConst -> HoppyF.Ptr M168.QAbstractScrollAreaConst
foreign import ccall "gencast__QAbstractScrollArea__QScrollArea" castQAbstractScrollAreaToQScrollArea :: HoppyF.Ptr M168.QAbstractScrollAreaConst -> HoppyF.Ptr QScrollAreaConst
foreign import ccall "gencast__QScrollArea__QWidget" castQScrollAreaToQWidget :: HoppyF.Ptr QScrollAreaConst -> HoppyF.Ptr M280.QWidgetConst
foreign import ccall "gencast__QWidget__QScrollArea" castQWidgetToQScrollArea :: HoppyF.Ptr M280.QWidgetConst -> HoppyF.Ptr QScrollAreaConst
foreign import ccall "gencast__QScrollArea__QObject" castQScrollAreaToQObject :: HoppyF.Ptr QScrollAreaConst -> HoppyF.Ptr M30.QObjectConst
foreign import ccall "gencast__QObject__QScrollArea" castQObjectToQScrollArea :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr QScrollAreaConst
foreign import ccall "gendel__QScrollArea" delete'QScrollArea :: HoppyF.Ptr QScrollAreaConst -> HoppyP.IO ()
foreign import ccall "&gendel__QScrollArea" deletePtr'QScrollArea :: HoppyF.FunPtr (HoppyF.Ptr QScrollAreaConst -> HoppyP.IO ())

class QScrollAreaValue a where
  withQScrollAreaPtr :: a -> (QScrollAreaConst -> HoppyP.IO b) -> HoppyP.IO b

#if MIN_VERSION_base(4,8,0)
instance {-# OVERLAPPABLE #-} QScrollAreaConstPtr a => QScrollAreaValue a where
#else
instance QScrollAreaConstPtr a => QScrollAreaValue a where
#endif
  withQScrollAreaPtr = HoppyP.flip ($) . toQScrollAreaConst

class (M168.QAbstractScrollAreaConstPtr this) => QScrollAreaConstPtr this where
  toQScrollAreaConst :: this -> QScrollAreaConst

alignment :: (QScrollAreaValue arg'1) => arg'1 -> HoppyP.IO M58.QtAlignment
alignment arg'1 =
  withQScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap M58.QtAlignment
  (alignment' arg'1')

widget :: (QScrollAreaValue arg'1) => arg'1 -> HoppyP.IO M280.QWidget
widget arg'1 =
  withQScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap M280.QWidget
  (widget' arg'1')

widgetResizable :: (QScrollAreaValue arg'1) => arg'1 -> HoppyP.IO HoppyP.Bool
widgetResizable arg'1 =
  withQScrollAreaPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
  HoppyP.fmap (/= 0)
  (widgetResizable' arg'1')

class (QScrollAreaConstPtr this, M168.QAbstractScrollAreaPtr this) => QScrollAreaPtr this where
  toQScrollArea :: this -> QScrollArea

setAlignment :: (QScrollAreaPtr arg'1, M58.IsQtAlignment arg'2) => arg'1 -> arg'2 -> HoppyP.IO ()
setAlignment arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQScrollArea arg'1) $ \arg'1' ->
  let arg'2' = M58.fromQtAlignment $ M58.toQtAlignment arg'2 in
  (setAlignment' arg'1' arg'2')

ensureVisible :: (QScrollAreaPtr arg'1) => arg'1 -> HoppyP.Int -> HoppyP.Int -> HoppyP.IO ()
ensureVisible arg'1 arg'2 arg'3 =
  HoppyFHR.withCppPtr (toQScrollArea arg'1) $ \arg'1' ->
  let arg'2' = HoppyFHR.coerceIntegral arg'2 in
  let arg'3' = HoppyFHR.coerceIntegral arg'3 in
  (ensureVisible' arg'1' arg'2' arg'3')

ensureVisibleWithMargins :: (QScrollAreaPtr arg'1) => arg'1 -> HoppyP.Int -> HoppyP.Int -> HoppyP.Int -> HoppyP.Int -> HoppyP.IO ()
ensureVisibleWithMargins arg'1 arg'2 arg'3 arg'4 arg'5 =
  HoppyFHR.withCppPtr (toQScrollArea arg'1) $ \arg'1' ->
  let arg'2' = HoppyFHR.coerceIntegral arg'2 in
  let arg'3' = HoppyFHR.coerceIntegral arg'3 in
  let arg'4' = HoppyFHR.coerceIntegral arg'4 in
  let arg'5' = HoppyFHR.coerceIntegral arg'5 in
  (ensureVisibleWithMargins' arg'1' arg'2' arg'3' arg'4' arg'5')

ensureWidgetVisible :: (QScrollAreaPtr arg'1, M280.QWidgetPtr arg'2) => arg'1 -> arg'2 -> HoppyP.IO ()
ensureWidgetVisible arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQScrollArea arg'1) $ \arg'1' ->
  HoppyFHR.withCppPtr (M280.toQWidget arg'2) $ \arg'2' ->
  (ensureWidgetVisible' arg'1' arg'2')

ensureWidgetVisibleWithMargins :: (QScrollAreaPtr arg'1, M280.QWidgetPtr arg'2) => arg'1 -> arg'2 -> HoppyP.Int -> HoppyP.Int -> HoppyP.IO ()
ensureWidgetVisibleWithMargins arg'1 arg'2 arg'3 arg'4 =
  HoppyFHR.withCppPtr (toQScrollArea arg'1) $ \arg'1' ->
  HoppyFHR.withCppPtr (M280.toQWidget arg'2) $ \arg'2' ->
  let arg'3' = HoppyFHR.coerceIntegral arg'3 in
  let arg'4' = HoppyFHR.coerceIntegral arg'4 in
  (ensureWidgetVisibleWithMargins' arg'1' arg'2' arg'3' arg'4')

takeWidget :: (QScrollAreaPtr arg'1) => arg'1 -> HoppyP.IO M280.QWidget
takeWidget arg'1 =
  HoppyFHR.withCppPtr (toQScrollArea arg'1) $ \arg'1' ->
  HoppyP.fmap M280.QWidget
  (takeWidget' arg'1')

setWidget :: (QScrollAreaPtr arg'1, M280.QWidgetPtr arg'2) => arg'1 -> arg'2 -> HoppyP.IO ()
setWidget arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQScrollArea arg'1) $ \arg'1' ->
  HoppyFHR.withCppPtr (M280.toQWidget arg'2) $ \arg'2' ->
  (setWidget' arg'1' arg'2')

setWidgetResizable :: (QScrollAreaPtr arg'1) => arg'1 -> HoppyP.Bool -> HoppyP.IO ()
setWidgetResizable arg'1 arg'2 =
  HoppyFHR.withCppPtr (toQScrollArea arg'1) $ \arg'1' ->
  let arg'2' = if arg'2 then 1 else 0 in
  (setWidgetResizable' arg'1' arg'2')

data QScrollAreaConst =
    QScrollAreaConst (HoppyF.Ptr QScrollAreaConst)
  | QScrollAreaConstGc (HoppyF.ForeignPtr ()) (HoppyF.Ptr QScrollAreaConst)
  deriving (HoppyP.Show)

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

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

castQScrollAreaToConst :: QScrollArea -> QScrollAreaConst
castQScrollAreaToConst (QScrollArea ptr') = QScrollAreaConst $ HoppyF.castPtr ptr'
castQScrollAreaToConst (QScrollAreaGc fptr' ptr') = QScrollAreaConstGc fptr' $ HoppyF.castPtr ptr'

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

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

instance QScrollAreaConstPtr QScrollAreaConst where
  toQScrollAreaConst = HoppyP.id

instance M168.QAbstractScrollAreaConstPtr QScrollAreaConst where
  toQAbstractScrollAreaConst (QScrollAreaConst ptr') = M168.QAbstractScrollAreaConst $ castQScrollAreaToQAbstractScrollArea ptr'
  toQAbstractScrollAreaConst (QScrollAreaConstGc fptr' ptr') = M168.QAbstractScrollAreaConstGc fptr' $ castQScrollAreaToQAbstractScrollArea ptr'

instance M280.QWidgetConstPtr QScrollAreaConst where
  toQWidgetConst (QScrollAreaConst ptr') = M280.QWidgetConst $ castQScrollAreaToQWidget ptr'
  toQWidgetConst (QScrollAreaConstGc fptr' ptr') = M280.QWidgetConstGc fptr' $ castQScrollAreaToQWidget ptr'

instance M30.QObjectConstPtr QScrollAreaConst where
  toQObjectConst (QScrollAreaConst ptr') = M30.QObjectConst $ castQScrollAreaToQObject ptr'
  toQObjectConst (QScrollAreaConstGc fptr' ptr') = M30.QObjectConstGc fptr' $ castQScrollAreaToQObject ptr'

data QScrollArea =
    QScrollArea (HoppyF.Ptr QScrollArea)
  | QScrollAreaGc (HoppyF.ForeignPtr ()) (HoppyF.Ptr QScrollArea)
  deriving (HoppyP.Show)

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

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

castQScrollAreaToNonconst :: QScrollAreaConst -> QScrollArea
castQScrollAreaToNonconst (QScrollAreaConst ptr') = QScrollArea $ HoppyF.castPtr ptr'
castQScrollAreaToNonconst (QScrollAreaConstGc fptr' ptr') = QScrollAreaGc fptr' $ HoppyF.castPtr ptr'

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

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

instance QScrollAreaConstPtr QScrollArea where
  toQScrollAreaConst (QScrollArea ptr') = QScrollAreaConst $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'
  toQScrollAreaConst (QScrollAreaGc fptr' ptr') = QScrollAreaConstGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'

instance QScrollAreaPtr QScrollArea where
  toQScrollArea = HoppyP.id

instance M168.QAbstractScrollAreaConstPtr QScrollArea where
  toQAbstractScrollAreaConst (QScrollArea ptr') = M168.QAbstractScrollAreaConst $ castQScrollAreaToQAbstractScrollArea $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'
  toQAbstractScrollAreaConst (QScrollAreaGc fptr' ptr') = M168.QAbstractScrollAreaConstGc fptr' $ castQScrollAreaToQAbstractScrollArea $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'

instance M168.QAbstractScrollAreaPtr QScrollArea where
  toQAbstractScrollArea (QScrollArea ptr') = M168.QAbstractScrollArea $ (HoppyF.castPtr :: HoppyF.Ptr M168.QAbstractScrollAreaConst -> HoppyF.Ptr M168.QAbstractScrollArea) $ castQScrollAreaToQAbstractScrollArea $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'
  toQAbstractScrollArea (QScrollAreaGc fptr' ptr') = M168.QAbstractScrollAreaGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M168.QAbstractScrollAreaConst -> HoppyF.Ptr M168.QAbstractScrollArea) $ castQScrollAreaToQAbstractScrollArea $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'

instance M280.QWidgetConstPtr QScrollArea where
  toQWidgetConst (QScrollArea ptr') = M280.QWidgetConst $ castQScrollAreaToQWidget $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'
  toQWidgetConst (QScrollAreaGc fptr' ptr') = M280.QWidgetConstGc fptr' $ castQScrollAreaToQWidget $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'

instance M280.QWidgetPtr QScrollArea where
  toQWidget (QScrollArea ptr') = M280.QWidget $ (HoppyF.castPtr :: HoppyF.Ptr M280.QWidgetConst -> HoppyF.Ptr M280.QWidget) $ castQScrollAreaToQWidget $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'
  toQWidget (QScrollAreaGc fptr' ptr') = M280.QWidgetGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M280.QWidgetConst -> HoppyF.Ptr M280.QWidget) $ castQScrollAreaToQWidget $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'

instance M30.QObjectConstPtr QScrollArea where
  toQObjectConst (QScrollArea ptr') = M30.QObjectConst $ castQScrollAreaToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'
  toQObjectConst (QScrollAreaGc fptr' ptr') = M30.QObjectConstGc fptr' $ castQScrollAreaToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'

instance M30.QObjectPtr QScrollArea where
  toQObject (QScrollArea ptr') = M30.QObject $ (HoppyF.castPtr :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr M30.QObject) $ castQScrollAreaToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'
  toQObject (QScrollAreaGc fptr' ptr') = M30.QObjectGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr M30.QObject) $ castQScrollAreaToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QScrollArea -> HoppyF.Ptr QScrollAreaConst) ptr'

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

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

class QScrollAreaSuper a where
  downToQScrollArea :: a -> QScrollArea

instance QScrollAreaSuper M168.QAbstractScrollArea where
  downToQScrollArea = castQScrollAreaToNonconst . cast' . M168.castQAbstractScrollAreaToConst
    where
      cast' (M168.QAbstractScrollAreaConst ptr') = QScrollAreaConst $ castQAbstractScrollAreaToQScrollArea ptr'
      cast' (M168.QAbstractScrollAreaConstGc fptr' ptr') = QScrollAreaConstGc fptr' $ castQAbstractScrollAreaToQScrollArea ptr'
instance QScrollAreaSuper M280.QWidget where
  downToQScrollArea = castQScrollAreaToNonconst . cast' . M280.castQWidgetToConst
    where
      cast' (M280.QWidgetConst ptr') = QScrollAreaConst $ castQWidgetToQScrollArea ptr'
      cast' (M280.QWidgetConstGc fptr' ptr') = QScrollAreaConstGc fptr' $ castQWidgetToQScrollArea ptr'
instance QScrollAreaSuper M30.QObject where
  downToQScrollArea = castQScrollAreaToNonconst . cast' . M30.castQObjectToConst
    where
      cast' (M30.QObjectConst ptr') = QScrollAreaConst $ castQObjectToQScrollArea ptr'
      cast' (M30.QObjectConstGc fptr' ptr') = QScrollAreaConstGc fptr' $ castQObjectToQScrollArea ptr'

class QScrollAreaSuperConst a where
  downToQScrollAreaConst :: a -> QScrollAreaConst

instance QScrollAreaSuperConst M168.QAbstractScrollAreaConst where
  downToQScrollAreaConst = cast'
    where
      cast' (M168.QAbstractScrollAreaConst ptr') = QScrollAreaConst $ castQAbstractScrollAreaToQScrollArea ptr'
      cast' (M168.QAbstractScrollAreaConstGc fptr' ptr') = QScrollAreaConstGc fptr' $ castQAbstractScrollAreaToQScrollArea ptr'
instance QScrollAreaSuperConst M280.QWidgetConst where
  downToQScrollAreaConst = cast'
    where
      cast' (M280.QWidgetConst ptr') = QScrollAreaConst $ castQWidgetToQScrollArea ptr'
      cast' (M280.QWidgetConstGc fptr' ptr') = QScrollAreaConstGc fptr' $ castQWidgetToQScrollArea ptr'
instance QScrollAreaSuperConst M30.QObjectConst where
  downToQScrollAreaConst = cast'
    where
      cast' (M30.QObjectConst ptr') = QScrollAreaConst $ castQObjectToQScrollArea ptr'
      cast' (M30.QObjectConstGc fptr' ptr') = QScrollAreaConstGc fptr' $ castQObjectToQScrollArea ptr'

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

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