widgets

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2019 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIGURE_BASICS   = iota
	CONFIGURE_INCOMING = iota
	CONFIGURE_OUTGOING = iota
	CONFIGURE_COMPLETE = iota
)
View Source
const (
	IMAP_OVER_TLS = iota
	IMAP_STARTTLS = iota
	IMAP_INSECURE = iota
)
View Source
const (
	SMTP_OVER_TLS = iota
	SMTP_STARTTLS = iota
	SMTP_INSECURE = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountView

type AccountView struct {
	// contains filtered or unexported fields
}

func NewAccountView

func NewAccountView(conf *config.AercConfig, acct *config.AccountConfig,
	logger *log.Logger, host TabHost) *AccountView

func (*AccountView) AccountConfig

func (acct *AccountView) AccountConfig() *config.AccountConfig

func (*AccountView) Children

func (acct *AccountView) Children() []ui.Drawable

func (*AccountView) Directories

func (acct *AccountView) Directories() *DirectoryList

func (*AccountView) Draw

func (acct *AccountView) Draw(ctx *ui.Context)

func (*AccountView) Focus

func (acct *AccountView) Focus(focus bool)

func (*AccountView) Invalidate

func (acct *AccountView) Invalidate()

func (*AccountView) Logger

func (acct *AccountView) Logger() *log.Logger

func (*AccountView) Messages

func (acct *AccountView) Messages() *MessageList

func (*AccountView) Name

func (acct *AccountView) Name() string

func (*AccountView) OnInvalidate

func (acct *AccountView) OnInvalidate(onInvalidate func(d ui.Drawable))

func (*AccountView) SelectedAccount

func (acct *AccountView) SelectedAccount() *AccountView

func (*AccountView) SelectedMessage

func (acct *AccountView) SelectedMessage() *types.MessageInfo

func (*AccountView) Store

func (acct *AccountView) Store() *lib.MessageStore

func (*AccountView) Tick

func (acct *AccountView) Tick() bool

func (*AccountView) Worker

func (acct *AccountView) Worker() *types.Worker

type AccountWizard

type AccountWizard struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func NewAccountWizard

func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard

func (*AccountWizard) Draw

func (wizard *AccountWizard) Draw(ctx *ui.Context)

func (*AccountWizard) Event

func (wizard *AccountWizard) Event(event tcell.Event) bool

func (*AccountWizard) Focus

func (wizard *AccountWizard) Focus(focus bool)

func (*AccountWizard) Invalidate

func (wizard *AccountWizard) Invalidate()

type Aerc

type Aerc struct {
	// contains filtered or unexported fields
}

func NewAerc

func NewAerc(conf *config.AercConfig, logger *log.Logger,
	cmd func(cmd string) error) *Aerc

func (*Aerc) BeginExCommand

func (aerc *Aerc) BeginExCommand()

func (*Aerc) Children

func (aerc *Aerc) Children() []ui.Drawable

func (*Aerc) Config

func (aerc *Aerc) Config() *config.AercConfig

func (*Aerc) Draw

func (aerc *Aerc) Draw(ctx *libui.Context)

func (*Aerc) Event

func (aerc *Aerc) Event(event tcell.Event) bool

func (*Aerc) Focus

func (aerc *Aerc) Focus(focus bool)

func (*Aerc) Invalidate

func (aerc *Aerc) Invalidate()

func (*Aerc) NewTab

func (aerc *Aerc) NewTab(drawable ui.Drawable, name string) *ui.Tab

func (*Aerc) NextTab

func (aerc *Aerc) NextTab()

func (*Aerc) OnInvalidate

func (aerc *Aerc) OnInvalidate(onInvalidate func(d libui.Drawable))

func (*Aerc) PrevTab

func (aerc *Aerc) PrevTab()

func (*Aerc) PushError

func (aerc *Aerc) PushError(text string)

func (*Aerc) PushStatus

func (aerc *Aerc) PushStatus(text string, expiry time.Duration) *StatusMessage

func (*Aerc) RemoveTab

func (aerc *Aerc) RemoveTab(tab ui.Drawable)

func (*Aerc) SelectedAccount

func (aerc *Aerc) SelectedAccount() *AccountView

func (*Aerc) SelectedTab

func (aerc *Aerc) SelectedTab() ui.Drawable

func (*Aerc) SetStatus

func (aerc *Aerc) SetStatus(status string) *StatusMessage

TODO: Use per-account status lines, but a global ex line

func (*Aerc) Tick

func (aerc *Aerc) Tick() bool

type Composer

type Composer struct {
	// contains filtered or unexported fields
}

func NewComposer

func NewComposer(conf *config.AercConfig,
	acct *config.AccountConfig, worker *types.Worker) *Composer

TODO: Let caller configure headers, initial body (for replies), etc

func (*Composer) Bindings

func (c *Composer) Bindings() string

func (*Composer) Close

func (c *Composer) Close()

func (*Composer) Config

func (c *Composer) Config() *config.AccountConfig

func (*Composer) Defaults

func (c *Composer) Defaults(defaults map[string]string) *Composer

Sets additional headers to be added to the outgoing email (e.g. In-Reply-To)

func (*Composer) Draw

func (c *Composer) Draw(ctx *ui.Context)

func (*Composer) Event

func (c *Composer) Event(event tcell.Event) bool

func (*Composer) Focus

func (c *Composer) Focus(focus bool)

func (*Composer) FocusTerminal

func (c *Composer) FocusTerminal() *Composer

func (*Composer) Invalidate

func (c *Composer) Invalidate()

func (*Composer) NextField

func (c *Composer) NextField()

func (*Composer) OnInvalidate

func (c *Composer) OnInvalidate(fn func(d ui.Drawable))

func (*Composer) OnSubjectChange

func (c *Composer) OnSubjectChange(fn func(subject string))

func (*Composer) PrepareHeader

func (c *Composer) PrepareHeader() (*mail.Header, []string, error)

func (*Composer) PrevField

func (c *Composer) PrevField()

func (*Composer) SetContents

func (c *Composer) SetContents(reader io.Reader) *Composer

Note: this does not reload the editor. You must call this before the first Draw() call.

func (*Composer) ShowTerminal

func (c *Composer) ShowTerminal()

func (*Composer) Worker

func (c *Composer) Worker() *types.Worker

func (*Composer) WriteMessage

func (c *Composer) WriteMessage(header *mail.Header, writer io.Writer) error

type DirectoryList

type DirectoryList struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func NewDirectoryList

func NewDirectoryList(conf *config.AccountConfig,
	logger *log.Logger, worker *types.Worker) *DirectoryList

func (*DirectoryList) Draw

func (dirlist *DirectoryList) Draw(ctx *ui.Context)

func (*DirectoryList) Invalidate

func (dirlist *DirectoryList) Invalidate()

func (*DirectoryList) Next

func (dirlist *DirectoryList) Next()

func (*DirectoryList) Prev

func (dirlist *DirectoryList) Prev()

func (*DirectoryList) Select

func (dirlist *DirectoryList) Select(name string)

func (*DirectoryList) Selected

func (dirlist *DirectoryList) Selected() string

func (*DirectoryList) UpdateList

func (dirlist *DirectoryList) UpdateList(done func(dirs []string))

type ExLine

type ExLine struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func NewExLine

func NewExLine(commit func(cmd string), cancel func()) *ExLine

func (*ExLine) Draw

func (ex *ExLine) Draw(ctx *ui.Context)

func (*ExLine) Event

func (ex *ExLine) Event(event tcell.Event) bool

func (*ExLine) Focus

func (ex *ExLine) Focus(focus bool)

func (*ExLine) Invalidate

func (ex *ExLine) Invalidate()

type HeaderView

type HeaderView struct {
	ui.Invalidatable
	Name  string
	Value string
}

func (*HeaderView) Draw

func (hv *HeaderView) Draw(ctx *ui.Context)

func (*HeaderView) Invalidate

func (hv *HeaderView) Invalidate()

type MessageList

type MessageList struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func NewMessageList

func NewMessageList(conf *config.AercConfig, logger *log.Logger) *MessageList

func (*MessageList) Draw

func (ml *MessageList) Draw(ctx *ui.Context)

func (*MessageList) Empty

func (ml *MessageList) Empty() bool

func (*MessageList) Height

func (ml *MessageList) Height() int

func (*MessageList) Invalidate

func (ml *MessageList) Invalidate()

func (*MessageList) Next

func (ml *MessageList) Next()

func (*MessageList) Prev

func (ml *MessageList) Prev()

func (*MessageList) Select

func (ml *MessageList) Select(index int)

func (*MessageList) Selected

func (ml *MessageList) Selected() *types.MessageInfo

func (*MessageList) SetStore

func (ml *MessageList) SetStore(store *lib.MessageStore)

func (*MessageList) Store

func (ml *MessageList) Store() *lib.MessageStore

type MessageViewer

type MessageViewer struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func NewMessageViewer

func NewMessageViewer(acct *AccountView, conf *config.AercConfig,
	store *lib.MessageStore, msg *types.MessageInfo) *MessageViewer

func (*MessageViewer) CurrentPart

func (mv *MessageViewer) CurrentPart() *PartInfo

func (*MessageViewer) Draw

func (mv *MessageViewer) Draw(ctx *ui.Context)

func (*MessageViewer) Event

func (mv *MessageViewer) Event(event tcell.Event) bool

func (*MessageViewer) Focus

func (mv *MessageViewer) Focus(focus bool)

func (*MessageViewer) Invalidate

func (mv *MessageViewer) Invalidate()

func (*MessageViewer) NextPart

func (mv *MessageViewer) NextPart()

func (*MessageViewer) OnInvalidate

func (mv *MessageViewer) OnInvalidate(fn func(d ui.Drawable))

func (*MessageViewer) PreviousPart

func (mv *MessageViewer) PreviousPart()

func (*MessageViewer) SelectedAccount

func (mv *MessageViewer) SelectedAccount() *AccountView

func (*MessageViewer) SelectedMessage

func (mv *MessageViewer) SelectedMessage() *types.MessageInfo

func (*MessageViewer) Store

func (mv *MessageViewer) Store() *lib.MessageStore

type PartInfo

type PartInfo struct {
	Index []int
	Msg   *types.MessageInfo
	Part  *imap.BodyStructure
	Store *lib.MessageStore
}

type PartSwitcher

type PartSwitcher struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func (*PartSwitcher) Draw

func (ps *PartSwitcher) Draw(ctx *ui.Context)

func (*PartSwitcher) Event

func (ps *PartSwitcher) Event(event tcell.Event) bool

func (*PartSwitcher) Focus

func (ps *PartSwitcher) Focus(focus bool)

func (*PartSwitcher) Invalidate

func (ps *PartSwitcher) Invalidate()

type PartViewer

type PartViewer struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func NewPartViewer

func NewPartViewer(conf *config.AercConfig,
	store *lib.MessageStore, msg *types.MessageInfo,
	part *imap.BodyStructure, index []int) (*PartViewer, error)

func (*PartViewer) Draw

func (pv *PartViewer) Draw(ctx *ui.Context)

func (*PartViewer) Invalidate

func (pv *PartViewer) Invalidate()

func (*PartViewer) SetSource

func (pv *PartViewer) SetSource(reader io.Reader)

type ProvidesMessage

type ProvidesMessage interface {
	ui.Drawable
	Store() *lib.MessageStore
	SelectedMessage() *types.MessageInfo
	SelectedAccount() *AccountView
}

type Spinner

type Spinner struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func NewSpinner

func NewSpinner() *Spinner

func (*Spinner) Draw

func (s *Spinner) Draw(ctx *ui.Context)

func (*Spinner) Invalidate

func (s *Spinner) Invalidate()

func (*Spinner) IsRunning

func (s *Spinner) IsRunning() bool

func (*Spinner) Start

func (s *Spinner) Start()

func (*Spinner) Stop

func (s *Spinner) Stop()

type StatusLine

type StatusLine struct {
	ui.Invalidatable
	// contains filtered or unexported fields
}

func NewStatusLine

func NewStatusLine() *StatusLine

func (*StatusLine) Draw

func (status *StatusLine) Draw(ctx *ui.Context)

func (*StatusLine) Expire

func (status *StatusLine) Expire()

func (*StatusLine) Invalidate

func (status *StatusLine) Invalidate()

func (*StatusLine) Push

func (status *StatusLine) Push(text string, expiry time.Duration) *StatusMessage

func (*StatusLine) Set

func (status *StatusLine) Set(text string) *StatusMessage

type StatusMessage

type StatusMessage struct {
	// contains filtered or unexported fields
}

func (*StatusMessage) Color

func (msg *StatusMessage) Color(bg tcell.Color, fg tcell.Color)

type TabHost

type TabHost interface {
	BeginExCommand()
	SetStatus(status string) *StatusMessage
	PushStatus(text string, expiry time.Duration) *StatusMessage
}

type Terminal

type Terminal struct {
	ui.Invalidatable

	OnClose func(err error)
	OnEvent func(event tcell.Event) bool
	OnStart func()
	OnTitle func(title string)
	// contains filtered or unexported fields
}

func NewTerminal

func NewTerminal(cmd *exec.Cmd) (*Terminal, error)

func (*Terminal) Close

func (term *Terminal) Close(err error)

func (*Terminal) Destroy

func (term *Terminal) Destroy()

func (*Terminal) Draw

func (term *Terminal) Draw(ctx *ui.Context)

func (*Terminal) Event

func (term *Terminal) Event(event tcell.Event) bool

func (*Terminal) Focus

func (term *Terminal) Focus(focus bool)

func (*Terminal) Invalidate

func (term *Terminal) Invalidate()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL