hbro-1.1.2.0: Minimal KISS compliant browser

Safe HaskellNone

Hbro.Config

Synopsis

Documentation

data ResourceAction Source

Constructors

Load 
Download 

data Verbosity Source

Constructors

Quiet 
Normal 
Verbose 

data Config m Source

Custom settings provided by the user

Constructors

Config 

Fields

_homePage :: URI

Startup page Parameters

_verbosity :: Verbosity

Logs verbosity Hooks

_keyBindings :: Map Mode (Bindings m)

Key bindings

_onDownload :: URI -> String -> Int -> m ()

Callback triggered when a download is requested

_onKeyStroke :: [Stroke] -> m ()

Callback triggered when a key is pressed

_onLinkClicked :: MouseButton -> URI -> m ()

Callback triggered when a link is clicked

_onLoadRequested :: URI -> m ()

Callback triggered when a load is requested

_onLoadFinished :: m ()

Callback triggered when a load is finished

_onNewWindow :: URI -> m ()

Callback triggered when a new window is requested

_onResourceOpened :: URI -> String -> m ResourceAction

Callback triggered when opening a non HTML resource

_onTitleChanged :: String -> m ()

Callback triggered when document title is changed

_commands :: CommandsMap m

Commands recognized through IPC system

Instances

ConfigReader n ((->) (Config n)) 
Show (Config m) 
Default (Config K) 

onTitleChanged :: forall m. Lens' (Config m) (String -> m ())Source

onNewWindow :: forall m. Lens' (Config m) (URI -> m ())Source

onLoadRequested :: forall m. Lens' (Config m) (URI -> m ())Source

onLoadFinished :: forall m. Lens' (Config m) (m ())Source

onLinkClicked :: forall m. Lens' (Config m) (MouseButton -> URI -> m ())Source

onKeyStroke :: forall m. Lens' (Config m) ([Stroke] -> m ())Source

onDownload :: forall m. Lens' (Config m) (URI -> String -> Int -> m ())Source

homePage :: forall m. Lens' (Config m) URISource

commands :: forall m. Lens' (Config m) (CommandsMap m)Source

class Monad m => ConfigReader n m | m -> n whereSource

MonadReader for Config

Methods

readConfig :: Simple Lens (Config n) a -> m aSource

Instances

class Monad m => ConfigWriter n m | m -> n whereSource

MonadWriter for Config

Methods

writeConfig :: Simple Lens (Config n) a -> a -> m ()Source

Instances

type ConfigState n m = (ConfigReader n m, ConfigWriter n m)Source

MonadState for Config

modifyConfig :: ConfigState n m => Simple Lens (Config n) a -> (a -> a) -> m ()Source

unlessQuiet :: (MonadBase IO m, ConfigReader n m) => m () -> m ()Source

Run an action unless verbosity is Quiet

whenLoud :: (MonadBase IO m, ConfigReader n m) => m () -> m ()Source

Run an action when verbosity is Verbose

log :: (MonadBase IO m, ConfigReader n m) => String -> m ()Source

logV :: (MonadBase IO m, ConfigReader n m) => String -> m ()Source

bind :: (MonadBase IO m, ConfigState m m) => Mode -> String -> m () -> m ()Source

Bind a keystrokes chain to a callback, in a given mode