module Propellor.Property.Installer.Types where

-- | The disk device to install to.
newtype TargetDiskDevice = TargetDiskDevice FilePath
	deriving (ReadPrec [TargetDiskDevice]
ReadPrec TargetDiskDevice
Int -> ReadS TargetDiskDevice
ReadS [TargetDiskDevice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TargetDiskDevice]
$creadListPrec :: ReadPrec [TargetDiskDevice]
readPrec :: ReadPrec TargetDiskDevice
$creadPrec :: ReadPrec TargetDiskDevice
readList :: ReadS [TargetDiskDevice]
$creadList :: ReadS [TargetDiskDevice]
readsPrec :: Int -> ReadS TargetDiskDevice
$creadsPrec :: Int -> ReadS TargetDiskDevice
Read, Int -> TargetDiskDevice -> ShowS
[TargetDiskDevice] -> ShowS
TargetDiskDevice -> FilePath
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [TargetDiskDevice] -> ShowS
$cshowList :: [TargetDiskDevice] -> ShowS
show :: TargetDiskDevice -> FilePath
$cshow :: TargetDiskDevice -> FilePath
showsPrec :: Int -> TargetDiskDevice -> ShowS
$cshowsPrec :: Int -> TargetDiskDevice -> ShowS
Show)

data DiskEraseConfirmed = DiskEraseConfirmed
	deriving (ReadPrec [DiskEraseConfirmed]
ReadPrec DiskEraseConfirmed
Int -> ReadS DiskEraseConfirmed
ReadS [DiskEraseConfirmed]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DiskEraseConfirmed]
$creadListPrec :: ReadPrec [DiskEraseConfirmed]
readPrec :: ReadPrec DiskEraseConfirmed
$creadPrec :: ReadPrec DiskEraseConfirmed
readList :: ReadS [DiskEraseConfirmed]
$creadList :: ReadS [DiskEraseConfirmed]
readsPrec :: Int -> ReadS DiskEraseConfirmed
$creadsPrec :: Int -> ReadS DiskEraseConfirmed
Read, Int -> DiskEraseConfirmed -> ShowS
[DiskEraseConfirmed] -> ShowS
DiskEraseConfirmed -> FilePath
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [DiskEraseConfirmed] -> ShowS
$cshowList :: [DiskEraseConfirmed] -> ShowS
show :: DiskEraseConfirmed -> FilePath
$cshow :: DiskEraseConfirmed -> FilePath
showsPrec :: Int -> DiskEraseConfirmed -> ShowS
$cshowsPrec :: Int -> DiskEraseConfirmed -> ShowS
Show)

-- | Class of user input that an installer might prompt for.
class UserInput i where
	-- | Get the disk device the user selected to install to.
	targetDiskDevice :: i -> Maybe TargetDiskDevice
	-- | Check if the user has confirmed they want to erase the target
	-- disk device.
	diskEraseConfirmed :: i -> Maybe DiskEraseConfirmed