Documentation ¶
Overview ¶
Package states defines constants of the substates used in golem's state machine.
Index ¶
Constants ¶
const ( // NormalSubstateNormal indicates "normal mode" NormalSubstateNormal cmd.Substate = iota // NormalSubstateQuickmark indicates quickmark bindings mode. NormalSubstateQuickmark // NormalSubstateQuickmarkTab indicates quickmark bindings mode opening in // a new tab. NormalSubstateQuickmarkTab // NormalSubstateQuickmarkWindow indicates quickmark bindings mode opening // in a new window. NormalSubstateQuickmarkWindow // NormalSubstateQuickmarksRapid indicates quickmark bindings mode opening // several quickmarks in background tabs. NormalSubstateQuickmarksRapid )
const ( // CommandLineSubstateCommand indicates a command being entered. CommandLineSubstateCommand cmd.Substate = iota // CommandLineSubstateSearch indicates a search being entered. CommandLineSubstateSearch // CommandLineSubstateBackSearch indicates a backwards search being entered. CommandLineSubstateBackSearch )
const ( // StatusSubstateMinor indicates a minor, inconsequential status. StatusSubstateMinor cmd.Substate = iota // StatusSubstateMajor indicates a more important status. StatusSubstateMajor // StatusSubstateError indicates an error status. StatusSubstateError )
const ( // HintsSubstateFollow indicates to follow (click) an item. HintsSubstateFollow cmd.Substate = iota // HintsSubstateBackground indicates to follow a link in a background tab. HintsSubstateBackground // HintsSubstateRapid indicates to follow several links in background tabs. HintsSubstateRapid // HintsSubstateTab indicates to follow a link in a new tab. HintsSubstateTab // HintsSubstateWindow indicates to follow a link in a new window. HintsSubstateWindow // HintsSubstateSearchEngine indicates to register a new search engine on // the page. HintsSubstateSearchEngine )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HintsCallback ¶
type HintsCallback interface { LinkHintsMode() (int64, error) FormVariableHintsMode() (int64, error) ClickHintsMode() (int64, error) EndHintsMode() error FilterHintsMode(string) (bool, error) }
HintsCallback is an interface for golem.(*webView), implementing the methods needed by hints. (mostly web extension calls)
type HintsMode ¶
type HintsMode struct { *cmd.StateIndependant cmd.Substate HintsCallback CurrentKeys []cmd.Key ExecuterFunction func(string) bool }
HintsMode is a mode which displays key strings on items of intrest in a web view, and allows the selection of said items by typing these key strings.
func NewHintsMode ¶
func NewHintsMode( s cmd.State, st cmd.Substate, cb HintsCallback, e func(string) bool) (*HintsMode, <-chan error)
NewHintsMode creates a new hints mode.
It returns a hints mode, and asynchronously either an error or nil in the given channel.
The special error nil is returned if no error occured, but hints mode should stop.
The channel is closed when initialization finishes.
func (*HintsMode) GetStateIndependant ¶
func (s *HintsMode) GetStateIndependant() *cmd.StateIndependant
GetStateIndependant gets the state independant associated with this state.
func (*HintsMode) GetSubstate ¶
GetSubstate gets the substate associated with this state.