app

package
v0.0.0-...-0798a42 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIGURE_BASICS   = iota
	CONFIGURE_SOURCE   = iota
	CONFIGURE_OUTGOING = iota
	CONFIGURE_COMPLETE = iota
)
View Source
const (
	// protocols
	IMAP      = "IMAP"
	JMAP      = "JMAP"
	MAILDIR   = "Maildir"
	MAILDIRPP = "Maildir++"
	NOTMUCH   = "notmuch"
	SMTP      = "SMTP"
	SENDMAIL  = "sendmail"
	// transports
	SSL_TLS  = "SSL/TLS"
	OAUTH    = "SSL/TLS+OAUTHBEARER"
	XOAUTH   = "SSL/TLS+XOAUTH2"
	STARTTLS = "STARTTLS"
	INSECURE = "Insecure"
)

Variables

View Source
var ErrNoOptionSelected = fmt.Errorf("no option selected")

Functions

func AccountNames

func AccountNames() []string

func AddDialog

func AddDialog(d ui.DrawableInteractive)

func CloseBackends

func CloseBackends() error

func CloseDialog

func CloseDialog()

func CmdFallbackSearch

func CmdFallbackSearch(cmds []string, silent bool) (string, error)

CmdFallbackSearch checks cmds for the first executable availabe in PATH. An error is returned if none are found

func Command

func Command(args []string) error

func CryptoProvider

func CryptoProvider() crypto.Provider

func DecryptKeys

func DecryptKeys(keys []openpgp.Key, symmetric bool) (b []byte, err error)

func Drawable

func Drawable() ui.DrawableInteractive

func HandleMessage

func HandleMessage(msg types.WorkerMessage)

func HumanReadableBindings

func HumanReadableBindings() []string

func IPCHandler

func IPCHandler() ipc.Handler

func Init

func Init(
	crypto crypto.Provider,
	cmd func(string, *config.AccountConfig, *models.MessageInfo) error,
	complete func(cmd string) ([]string, string), history lib.History,
	deferLoop chan struct{},
)

func MoveTab

func MoveTab(i int, relative bool)

func NewConfigStep

func NewConfigStep(intro string, interactive *[]ui.Interactive) configStep

func NewTab

func NewTab(clickable ui.Drawable, name string) *ui.Tab

func NextTab

func NextTab()

func PinTab

func PinTab()

func PrevTab

func PrevTab()

func PushPrompt

func PushPrompt(prompt *ExLine)

func RegisterChoices

func RegisterChoices(choices []Choice)

func RegisterPrompt

func RegisterPrompt(prompt string, cmd string)

func RemoveTab

func RemoveTab(tab ui.Drawable, closeContent bool)

func ReplaceTab

func ReplaceTab(tabSrc ui.Drawable, tabTarget ui.Drawable, name string, closeSrc bool)

func SelectPreviousTab

func SelectPreviousTab() bool

func SelectTab

func SelectTab(name string) bool

func SelectTabAtOffset

func SelectTabAtOffset(offset int)

func SelectTabIndex

func SelectTabIndex(index int) bool

func SelectedAccountUiConfig

func SelectedAccountUiConfig() *config.UIConfig

func SelectedTab

func SelectedTab() *ui.Tab

func SelectedTabContent

func SelectedTabContent() ui.Drawable

func SetError

func SetError(text string)

func TabNames

func TabNames() []string

func UnpinTab

func UnpinTab()

func UpdateStatus

func UpdateStatus()

Types

type AccountView

type AccountView struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func Account

func Account(name string) (*AccountView, error)

func NewAccountView

func NewAccountView(
	acct *config.AccountConfig, deferLoop chan struct{},
) (*AccountView, error)

func NextAccount

func NextAccount() (*AccountView, error)

func PrevAccount

func PrevAccount() (*AccountView, error)

func SelectedAccount

func SelectedAccount() *AccountView

func (*AccountView) AccountConfig

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

func (*AccountView) CheckMail

func (acct *AccountView) CheckMail()

func (*AccountView) CheckMailReset

func (acct *AccountView) CheckMailReset()

CheckMailReset resets the check-mail timer

func (*AccountView) CheckMailTimer

func (acct *AccountView) CheckMailTimer(d time.Duration)

func (*AccountView) Directories

func (acct *AccountView) Directories() DirectoryLister

func (*AccountView) Draw

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

func (*AccountView) Focus

func (acct *AccountView) Focus(focus bool)

func (*AccountView) GetSortCriteria

func (acct *AccountView) GetSortCriteria() []*types.SortCriterion

func (*AccountView) Invalidate

func (acct *AccountView) Invalidate()

func (*AccountView) Labels

func (acct *AccountView) Labels() []string

func (*AccountView) MarkedMessages

func (acct *AccountView) MarkedMessages() ([]uint32, error)

func (*AccountView) Messages

func (acct *AccountView) Messages() *MessageList

func (*AccountView) MouseEvent

func (acct *AccountView) MouseEvent(localX int, localY int, event vaxis.Event)

func (*AccountView) Name

func (acct *AccountView) Name() string

func (*AccountView) PushError

func (acct *AccountView) PushError(err error)

func (*AccountView) PushStatus

func (acct *AccountView) PushStatus(status string, expiry time.Duration)

func (*AccountView) PushWarning

func (acct *AccountView) PushWarning(warning string)

func (*AccountView) Select

func (acct *AccountView) Select()

func (*AccountView) SelectedAccount

func (acct *AccountView) SelectedAccount() *AccountView

func (*AccountView) SelectedDirectory

func (acct *AccountView) SelectedDirectory() string

func (*AccountView) SelectedMessage

func (acct *AccountView) SelectedMessage() (*models.MessageInfo, error)

func (*AccountView) SelectedMessagePart

func (acct *AccountView) SelectedMessagePart() *PartInfo

func (*AccountView) SetSplitSize

func (acct *AccountView) SetSplitSize(n int)

func (*AccountView) SetStatus

func (acct *AccountView) SetStatus(setters ...state.SetStateFunc)

func (*AccountView) Split

func (acct *AccountView) Split(n int)

Split splits the message list view horizontally. The message list will be n rows high. If n is 0, any existing split is removed

func (*AccountView) SplitSize

func (acct *AccountView) SplitSize() int

func (*AccountView) Store

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

func (*AccountView) Terminal

func (acct *AccountView) Terminal() *Terminal

func (*AccountView) UiConfig

func (acct *AccountView) UiConfig() *config.UIConfig

func (*AccountView) UpdateStatus

func (acct *AccountView) UpdateStatus()

func (*AccountView) Vsplit

func (acct *AccountView) Vsplit(n int)

Vsplit splits the message list view vertically. The message list will be n rows wide. If n is 0, any existing split is removed

func (*AccountView) Worker

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

type AccountWizard

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

func NewAccountWizard

func NewAccountWizard() *AccountWizard

func (*AccountWizard) ConfigureTemporaryAccount

func (wizard *AccountWizard) ConfigureTemporaryAccount(temporary bool)

func (*AccountWizard) Draw

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

func (*AccountWizard) Event

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

func (*AccountWizard) Focus

func (wizard *AccountWizard) Focus(focus bool)

func (*AccountWizard) Invalidate

func (wizard *AccountWizard) Invalidate()

type Aerc

type Aerc struct {
	Crypto crypto.Provider
	// contains filtered or unexported fields
}

func (*Aerc) Account

func (aerc *Aerc) Account(name string) (*AccountView, error)

func (*Aerc) AccountNames

func (aerc *Aerc) AccountNames() []string

func (*Aerc) AddDialog

func (aerc *Aerc) AddDialog(d ui.DrawableInteractive)

func (*Aerc) Beep

func (aerc *Aerc) Beep()

func (*Aerc) BeginExCommand

func (aerc *Aerc) BeginExCommand(cmd string)

func (*Aerc) CloseBackends

func (aerc *Aerc) CloseBackends() error

func (*Aerc) CloseDialog

func (aerc *Aerc) CloseDialog()

func (*Aerc) Command

func (aerc *Aerc) Command(args []string) error

func (*Aerc) DecryptKeys

func (aerc *Aerc) DecryptKeys(keys []openpgp.Key, symmetric bool) (b []byte, err error)

func (*Aerc) Draw

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

func (*Aerc) Event

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

func (*Aerc) Focus

func (aerc *Aerc) Focus(focus bool)

func (*Aerc) GetPassword

func (aerc *Aerc) GetPassword(title string, prompt string) (chText chan string, chErr chan error)

func (*Aerc) HandleMessage

func (aerc *Aerc) HandleMessage(msg types.WorkerMessage)

func (*Aerc) HumanReadableBindings

func (aerc *Aerc) HumanReadableBindings() []string

func (*Aerc) Init

func (aerc *Aerc) Init(
	crypto crypto.Provider,
	cmd func(string, *config.AccountConfig, *models.MessageInfo) error,
	complete func(cmd string) ([]string, string), cmdHistory lib.History,
	deferLoop chan struct{},
)

func (*Aerc) Invalidate

func (aerc *Aerc) Invalidate()

func (*Aerc) MoveTab

func (aerc *Aerc) MoveTab(i int, relative bool)

func (*Aerc) NewTab

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

func (*Aerc) NextAccount

func (aerc *Aerc) NextAccount() (*AccountView, error)

func (*Aerc) NextTab

func (aerc *Aerc) NextTab()

func (*Aerc) OnBeep

func (aerc *Aerc) OnBeep(f func() error)

func (*Aerc) PinTab

func (aerc *Aerc) PinTab()

func (*Aerc) PrevAccount

func (aerc *Aerc) PrevAccount() (*AccountView, error)

func (*Aerc) PrevTab

func (aerc *Aerc) PrevTab()

func (*Aerc) PushError

func (aerc *Aerc) PushError(text string) *StatusMessage

func (*Aerc) PushPrompt

func (aerc *Aerc) PushPrompt(prompt *ExLine)

func (*Aerc) PushStatus

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

func (*Aerc) PushSuccess

func (aerc *Aerc) PushSuccess(text string) *StatusMessage

func (*Aerc) PushWarning

func (aerc *Aerc) PushWarning(text string) *StatusMessage

func (*Aerc) RegisterChoices

func (aerc *Aerc) RegisterChoices(choices []Choice)

func (*Aerc) RegisterPrompt

func (aerc *Aerc) RegisterPrompt(prompt string, cmd string)

func (*Aerc) RemoveTab

func (aerc *Aerc) RemoveTab(tab ui.Drawable, closeContent bool)

func (*Aerc) ReplaceTab

func (aerc *Aerc) ReplaceTab(tabSrc ui.Drawable, tabTarget ui.Drawable, name string, closeSrc bool)

func (*Aerc) SelectPreviousTab

func (aerc *Aerc) SelectPreviousTab() bool

func (*Aerc) SelectTab

func (aerc *Aerc) SelectTab(name string) bool

func (*Aerc) SelectTabAtOffset

func (aerc *Aerc) SelectTabAtOffset(offset int)

func (*Aerc) SelectTabIndex

func (aerc *Aerc) SelectTabIndex(index int) bool

func (*Aerc) SelectedAccount

func (aerc *Aerc) SelectedAccount() *AccountView

func (*Aerc) SelectedAccountUiConfig

func (aerc *Aerc) SelectedAccountUiConfig() *config.UIConfig

func (*Aerc) SelectedTab

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

func (*Aerc) SelectedTabContent

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

func (*Aerc) SetError

func (aerc *Aerc) SetError(err string)

func (*Aerc) TabNames

func (aerc *Aerc) TabNames() []string

func (*Aerc) UnpinTab

func (aerc *Aerc) UnpinTab()

func (*Aerc) UpdateStatus

func (aerc *Aerc) UpdateStatus()

type AlignPosition

type AlignPosition uint
const (
	AlignTop AlignPosition = iota
	AlignCenter
	AlignBottom
)

type AuthInfo

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

func NewAuthInfo

func NewAuthInfo(auth *auth.Details, showInfo bool, uiConfig *config.UIConfig) *AuthInfo

func (*AuthInfo) Draw

func (a *AuthInfo) Draw(ctx *ui.Context)

func (*AuthInfo) Invalidate

func (a *AuthInfo) Invalidate()

type Choice

type Choice struct {
	Key     string
	Text    string
	Command string
}

type Composer

type Composer struct {
	sync.Mutex

	Tab *ui.Tab
	// contains filtered or unexported fields
}

func NewComposer

func NewComposer(
	acct *AccountView, acctConfig *config.AccountConfig,
	worker *types.Worker, editHeaders bool, template string,
	h *mail.Header, orig *models.OriginalMail, body io.Reader,
) (*Composer, error)

func (*Composer) Account

func (c *Composer) Account() *AccountView

func (*Composer) AddAttachment

func (c *Composer) AddAttachment(path string)

func (*Composer) AddEditor

func (c *Composer) AddEditor(header string, value string, appendHeader bool) error

AddEditor appends a new header editor to the compose window.

func (*Composer) AddPartAttachment

func (c *Composer) AddPartAttachment(name string, mimetype string,
	params map[string]string, body io.Reader,
) error

func (*Composer) AppendPart

func (c *Composer) AppendPart(mimetype string, params map[string]string, body io.Reader) error

func (*Composer) Archive

func (c *Composer) Archive() string

func (*Composer) AttachKey

func (c *Composer) AttachKey() bool

func (*Composer) Bindings

func (c *Composer) Bindings() string

func (*Composer) CheckForMultipartErrors

func (c *Composer) CheckForMultipartErrors() error

func (*Composer) Close

func (c *Composer) Close()

func (*Composer) Config

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

func (*Composer) DelEditor

func (c *Composer) DelEditor(header string) error

DelEditor removes a header editor from the compose window.

func (*Composer) DeleteAttachment

func (c *Composer) DeleteAttachment(name string) error

func (*Composer) Draw

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

func (*Composer) Encrypt

func (c *Composer) Encrypt() bool

func (*Composer) Event

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

func (*Composer) Focus

func (c *Composer) Focus(focus bool)

func (*Composer) FocusEditor

func (c *Composer) FocusEditor(editor string)

func (*Composer) FocusTerminal

func (c *Composer) FocusTerminal() *Composer

func (*Composer) GetAttachments

func (c *Composer) GetAttachments() []string

func (*Composer) GetBody

func (c *Composer) GetBody() (*bytes.Buffer, error)

func (*Composer) Invalidate

func (c *Composer) Invalidate()

func (*Composer) MouseEvent

func (c *Composer) MouseEvent(localX int, localY int, event vaxis.Event)

func (*Composer) NextField

func (c *Composer) NextField()

func (*Composer) OnClose

func (c *Composer) OnClose(fn func(composer *Composer))

func (*Composer) OnFocusLost

func (c *Composer) OnFocusLost(header string, fn func(input string) bool)

OnFocusLost registers an OnFocusLost callback for the specified header.

func (*Composer) OnHeaderChange

func (c *Composer) OnHeaderChange(header string, fn func(subject string))

OnHeaderChange registers an OnChange callback for the specified header.

func (*Composer) Postponed

func (c *Composer) Postponed() bool

func (*Composer) PrepareHeader

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

PrepareHeader finalizes the header, adding the value from the editors

func (*Composer) PrevField

func (c *Composer) PrevField()

func (*Composer) RecalledFrom

func (c *Composer) RecalledFrom() string

func (*Composer) RemovePart

func (c *Composer) RemovePart(mimetype string) error

func (*Composer) SelectedDirectory

func (c *Composer) SelectedDirectory() string

func (*Composer) Sent

func (c *Composer) Sent() bool

func (*Composer) SetAttachKey

func (c *Composer) SetAttachKey(attach bool) error

func (*Composer) SetEncrypt

func (c *Composer) SetEncrypt(encrypt bool) *Composer

func (*Composer) SetPostponed

func (c *Composer) SetPostponed()

func (*Composer) SetRecalledFrom

func (c *Composer) SetRecalledFrom(folder string)

func (*Composer) SetSent

func (c *Composer) SetSent(archive string)

func (*Composer) SetSign

func (c *Composer) SetSign(sign bool) error

func (*Composer) ShouldWarnAttachment

func (c *Composer) ShouldWarnAttachment() bool

func (*Composer) ShouldWarnSubject

func (c *Composer) ShouldWarnSubject() bool

func (*Composer) Show

func (c *Composer) Show(visible bool)

func (*Composer) ShowTerminal

func (c *Composer) ShowTerminal(editHeaders bool) error

func (*Composer) Sign

func (c *Composer) Sign() bool

func (*Composer) Signer

func (c *Composer) Signer() (string, error)

func (*Composer) SwitchAccount

func (c *Composer) SwitchAccount(newAcct *AccountView) error

func (*Composer) Terminal

func (c *Composer) Terminal() *Terminal

func (*Composer) Worker

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

func (*Composer) WriteMessage

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

type Dialog

type Dialog interface {
	ui.DrawableInteractive
	ContextWidth() (func(int) int, func(int) int)
	ContextHeight() (func(int) int, func(int) int)
}

func DefaultDialog

func DefaultDialog(d ui.DrawableInteractive) Dialog

DefaultDialog creates a dialog window spanning half of the screen

func NewDialog

func NewDialog(
	d ui.DrawableInteractive,
	x func(int) int, y func(int) int,
	w func(int) int, h func(int) int,
) Dialog

type DirectoryList

type DirectoryList struct {
	Scrollable
	// contains filtered or unexported fields
}

func (*DirectoryList) ClearList

func (dirlist *DirectoryList) ClearList()

func (*DirectoryList) Clicked

func (dirlist *DirectoryList) Clicked(x int, y int) (string, bool)

func (*DirectoryList) CollapseFolder

func (dirlist *DirectoryList) CollapseFolder()

func (*DirectoryList) Directory

func (dirlist *DirectoryList) Directory(name string) *models.Directory

func (*DirectoryList) Draw

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

func (*DirectoryList) ExpandFolder

func (dirlist *DirectoryList) ExpandFolder()

func (*DirectoryList) FilterDirs

func (dirlist *DirectoryList) FilterDirs(orig, filters []string, exclude bool) []string

FilterDirs filters directories by the supplied filter. If exclude is false, the filter will only include directories from orig which exist in filters. If exclude is true, the directories in filters are removed from orig

func (*DirectoryList) GetRUECount

func (dirlist *DirectoryList) GetRUECount(name string) (int, int, int)

Returns the Recent, Unread, and Exist counts for the named directory

func (*DirectoryList) Invalidate

func (dirlist *DirectoryList) Invalidate()

func (*DirectoryList) List

func (dirlist *DirectoryList) List() []string

func (*DirectoryList) MouseEvent

func (dirlist *DirectoryList) MouseEvent(localX int, localY int, event vaxis.Event)

func (*DirectoryList) MsgStore

func (dirlist *DirectoryList) MsgStore(name string) (*lib.MessageStore, bool)

func (*DirectoryList) NewContext

func (dirlist *DirectoryList) NewContext()

func (*DirectoryList) Next

func (dirlist *DirectoryList) Next()

func (*DirectoryList) NextPrev

func (dirlist *DirectoryList) NextPrev(delta int)

func (*DirectoryList) OnVirtualNode

func (dirlist *DirectoryList) OnVirtualNode(_ func())

func (*DirectoryList) Open

func (dirlist *DirectoryList) Open(name string, query string, delay time.Duration,
	cb func(types.WorkerMessage),
)

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) SelectedDirectory

func (dirlist *DirectoryList) SelectedDirectory() *models.Directory

func (*DirectoryList) SelectedMsgStore

func (dirlist *DirectoryList) SelectedMsgStore() (*lib.MessageStore, bool)

func (*DirectoryList) SetMsgStore

func (dirlist *DirectoryList) SetMsgStore(dir *models.Directory, msgStore *lib.MessageStore)

func (*DirectoryList) UiConfig

func (dirlist *DirectoryList) UiConfig(dir string) *config.UIConfig

func (*DirectoryList) Update

func (dirlist *DirectoryList) Update(msg types.WorkerMessage)

type DirectoryLister

type DirectoryLister interface {
	ui.Drawable

	Selected() string
	Select(string)
	Open(string, string, time.Duration, func(types.WorkerMessage))

	Update(types.WorkerMessage)
	List() []string
	ClearList()

	OnVirtualNode(func())

	NextPrev(int)

	CollapseFolder()
	ExpandFolder()

	SelectedMsgStore() (*lib.MessageStore, bool)
	MsgStore(string) (*lib.MessageStore, bool)
	SelectedDirectory() *models.Directory
	Directory(string) *models.Directory
	SetMsgStore(*models.Directory, *lib.MessageStore)

	FilterDirs([]string, []string, bool) []string
	GetRUECount(string) (int, int, int)

	UiConfig(string) *config.UIConfig
}

func NewDirectoryList

func NewDirectoryList(acctConf *config.AccountConfig,
	worker *types.Worker,
) DirectoryLister

func NewDirectoryTree

func NewDirectoryTree(dirlist *DirectoryList) DirectoryLister

type DirectoryTree

type DirectoryTree struct {
	*DirectoryList
	// contains filtered or unexported fields
}

func (*DirectoryTree) ClearList

func (dt *DirectoryTree) ClearList()

func (*DirectoryTree) Clicked

func (dt *DirectoryTree) Clicked(x int, y int) (string, bool)

func (*DirectoryTree) CollapseFolder

func (dt *DirectoryTree) CollapseFolder()

func (*DirectoryTree) Draw

func (dt *DirectoryTree) Draw(ctx *ui.Context)

func (*DirectoryTree) ExpandFolder

func (dt *DirectoryTree) ExpandFolder()

func (*DirectoryTree) MouseEvent

func (dt *DirectoryTree) MouseEvent(localX int, localY int, event vaxis.Event)

func (*DirectoryTree) NextPrev

func (dt *DirectoryTree) NextPrev(delta int)

func (*DirectoryTree) OnVirtualNode

func (dt *DirectoryTree) OnVirtualNode(cb func())

func (*DirectoryTree) Open

func (dt *DirectoryTree) Open(name string, query string, delay time.Duration, cb func(types.WorkerMessage))

func (*DirectoryTree) Select

func (dt *DirectoryTree) Select(name string)

func (*DirectoryTree) Selected

func (dt *DirectoryTree) Selected() string

func (*DirectoryTree) SelectedDirectory

func (dt *DirectoryTree) SelectedDirectory() *models.Directory

func (*DirectoryTree) SelectedMsgStore

func (dt *DirectoryTree) SelectedMsgStore() (*lib.MessageStore, bool)

func (*DirectoryTree) Update

func (dt *DirectoryTree) Update(msg types.WorkerMessage)

type ExLine

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

func NewExLine

func NewExLine(cmd string, commit func(cmd string), finish func(),
	tabcomplete func(cmd string) ([]string, string),
	cmdHistory lib.History,
) *ExLine

func NewPrompt

func NewPrompt(prompt string, commit func(text string),
	tabcomplete func(cmd string) ([]string, string),
) *ExLine

func (*ExLine) Draw

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

func (*ExLine) Event

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

func (*ExLine) Focus

func (ex *ExLine) Focus(focus bool)

func (*ExLine) Invalidate

func (ex *ExLine) Invalidate()

func (*ExLine) TabComplete

func (x *ExLine) TabComplete(tabComplete func(string) ([]string, string))

type GetPasswd

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

func NewGetPasswd

func NewGetPasswd(
	title string, prompt string, cb func(string, error),
) *GetPasswd

func (*GetPasswd) Draw

func (gp *GetPasswd) Draw(ctx *ui.Context)

func (*GetPasswd) Event

func (gp *GetPasswd) Event(event vaxis.Event) bool

func (*GetPasswd) Focus

func (gp *GetPasswd) Focus(f bool)

func (*GetPasswd) Invalidate

func (gp *GetPasswd) Invalidate()

type HasTerminal

type HasTerminal interface {
	Terminal() *Terminal
}

type HeaderLayout

type HeaderLayout [][]string

type HeaderLayoutFilter

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

type HeaderView

type HeaderView struct {
	Name       string
	Value      string
	ValueField ui.Drawable
	// contains filtered or unexported fields
}

func (*HeaderView) Draw

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

func (*HeaderView) Invalidate

func (hv *HeaderView) Invalidate()

type ListBox

type ListBox struct {
	Scrollable
	// contains filtered or unexported fields
}

func NewListBox

func NewListBox(title string, lines []string, uiConfig *config.UIConfig, cb func(string)) *ListBox

func (*ListBox) Draw

func (lb *ListBox) Draw(ctx *ui.Context)

func (*ListBox) Event

func (lb *ListBox) Event(event vaxis.Event) bool

func (*ListBox) Focus

func (lb *ListBox) Focus(f bool)

func (*ListBox) Invalidate

func (lb *ListBox) Invalidate()

func (*ListBox) SetTextFilter

func (lb *ListBox) SetTextFilter(fn func([]string, string) []string) *ListBox

type MessageList

type MessageList struct {
	Scrollable
	// contains filtered or unexported fields
}

func NewMessageList

func NewMessageList(account *AccountView) *MessageList

func (*MessageList) AlignMessage

func (ml *MessageList) AlignMessage(pos AlignPosition)

AlignMessage aligns the selected message to position pos.

func (*MessageList) Clicked

func (ml *MessageList) Clicked(x, y int) (int, bool)

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) MouseEvent

func (ml *MessageList) MouseEvent(localX int, localY int, event vaxis.Event)

func (*MessageList) Select

func (ml *MessageList) Select(index int)

func (*MessageList) Selected

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

func (*MessageList) SetInitDone

func (ml *MessageList) SetInitDone()

func (*MessageList) SetStore

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

func (*MessageList) Store

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

func (*MessageList) Width

func (ml *MessageList) Width() int

type MessageViewer

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

func NewMessageViewer

func NewMessageViewer(
	acct *AccountView, msg lib.MessageView,
) *MessageViewer

func (*MessageViewer) AttachmentParts

func (mv *MessageViewer) AttachmentParts(all bool) []*PartInfo

func (*MessageViewer) Bindings

func (mv *MessageViewer) Bindings() string

func (*MessageViewer) Close

func (mv *MessageViewer) Close()

func (*MessageViewer) Draw

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

func (*MessageViewer) Event

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

func (*MessageViewer) Focus

func (mv *MessageViewer) Focus(focus bool)

func (*MessageViewer) Invalidate

func (mv *MessageViewer) Invalidate()

func (*MessageViewer) MarkedMessages

func (mv *MessageViewer) MarkedMessages() ([]uint32, error)

func (*MessageViewer) MessageView

func (mv *MessageViewer) MessageView() lib.MessageView

func (*MessageViewer) MouseEvent

func (mv *MessageViewer) MouseEvent(localX int, localY int, event vaxis.Event)

func (*MessageViewer) NextPart

func (mv *MessageViewer) NextPart()

func (*MessageViewer) PreviousPart

func (mv *MessageViewer) PreviousPart()

func (*MessageViewer) SelectedAccount

func (mv *MessageViewer) SelectedAccount() *AccountView

func (*MessageViewer) SelectedMessage

func (mv *MessageViewer) SelectedMessage() (*models.MessageInfo, error)

func (*MessageViewer) SelectedMessagePart

func (mv *MessageViewer) SelectedMessagePart() *PartInfo

func (*MessageViewer) Show

func (mv *MessageViewer) Show(visible bool)

func (*MessageViewer) Store

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

func (*MessageViewer) Terminal

func (mv *MessageViewer) Terminal() *Terminal

func (*MessageViewer) ToggleHeaders

func (mv *MessageViewer) ToggleHeaders()

func (*MessageViewer) ToggleKeyPassthrough

func (mv *MessageViewer) ToggleKeyPassthrough() bool

type PGPInfo

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

func NewPGPInfo

func NewPGPInfo(details *models.MessageDetails, uiConfig *config.UIConfig) *PGPInfo

func (*PGPInfo) Draw

func (p *PGPInfo) Draw(ctx *ui.Context)

func (*PGPInfo) DrawEncryption

func (p *PGPInfo) DrawEncryption(ctx *ui.Context, y int)

func (*PGPInfo) DrawSignature

func (p *PGPInfo) DrawSignature(ctx *ui.Context)

func (*PGPInfo) Invalidate

func (p *PGPInfo) Invalidate()

type PartInfo

type PartInfo struct {
	Index []int
	Msg   *models.MessageInfo
	Part  *models.BodyStructure
	Links []string
}

type PartSwitcher

type PartSwitcher struct {
	Scrollable
	// contains filtered or unexported fields
}

func (*PartSwitcher) AttachmentParts

func (ps *PartSwitcher) AttachmentParts(all bool) []*PartInfo

func (*PartSwitcher) Cleanup

func (ps *PartSwitcher) Cleanup()

func (*PartSwitcher) Draw

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

func (*PartSwitcher) Event

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

func (*PartSwitcher) Focus

func (ps *PartSwitcher) Focus(focus bool)

func (*PartSwitcher) Invalidate

func (ps *PartSwitcher) Invalidate()

func (*PartSwitcher) MouseEvent

func (ps *PartSwitcher) MouseEvent(localX int, localY int, event vaxis.Event)

func (*PartSwitcher) NextPart

func (ps *PartSwitcher) NextPart()

func (*PartSwitcher) PreviousPart

func (ps *PartSwitcher) PreviousPart()

func (*PartSwitcher) SelectedPart

func (ps *PartSwitcher) SelectedPart() *PartViewer

func (*PartSwitcher) Show

func (ps *PartSwitcher) Show(visible bool)

type PartViewer

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

func NewPartViewer

func NewPartViewer(
	acct *AccountView, msg lib.MessageView, part *models.BodyStructure,
	curindex []int,
) (*PartViewer, error)

func (*PartViewer) Cleanup

func (pv *PartViewer) Cleanup()

func (*PartViewer) Draw

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

func (*PartViewer) Event

func (pv *PartViewer) Event(event vaxis.Event) bool

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
	SelectedAccount() *AccountView
	SelectedMessage() (*models.MessageInfo, error)
	SelectedMessagePart() *PartInfo
}

type ProvidesMessages

type ProvidesMessages interface {
	ui.Drawable
	Store() *lib.MessageStore
	SelectedAccount() *AccountView
	SelectedMessage() (*models.MessageInfo, error)
	MarkedMessages() ([]uint32, error)
}

type Scrollable

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

Scrollable implements vertical scrolling

func (*Scrollable) Align

func (s *Scrollable) Align(idx int, pos AlignPosition)

func (*Scrollable) EnsureScroll

func (s *Scrollable) EnsureScroll(idx int)

func (*Scrollable) NeedScrollbar

func (s *Scrollable) NeedScrollbar() bool

func (*Scrollable) PercentScrolled

func (s *Scrollable) PercentScrolled() float64

func (*Scrollable) PercentVisible

func (s *Scrollable) PercentVisible() float64

func (*Scrollable) Scroll

func (s *Scrollable) Scroll() int

func (*Scrollable) ScrollOffset

func (s *Scrollable) ScrollOffset() int

func (*Scrollable) SetOffset

func (s *Scrollable) SetOffset(offset int)

func (*Scrollable) UpdateScroller

func (s *Scrollable) UpdateScroller(height, elems int)

type Selector

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

func NewSelector

func NewSelector(options []string, focus int, uiConfig *config.UIConfig) *Selector

func (*Selector) Chooser

func (sel *Selector) Chooser(chooser bool) *Selector

func (*Selector) Draw

func (sel *Selector) Draw(ctx *ui.Context)

func (*Selector) Event

func (sel *Selector) Event(event vaxis.Event) bool

func (*Selector) Focus

func (sel *Selector) Focus(focus bool)

func (*Selector) Invalidate

func (sel *Selector) Invalidate()

func (*Selector) OnChoose

func (sel *Selector) OnChoose(fn func(option string)) *Selector

func (*Selector) OnSelect

func (sel *Selector) OnSelect(fn func(option string)) *Selector

func (*Selector) Select

func (sel *Selector) Select(option string)

func (*Selector) Selected

func (sel *Selector) Selected() string

type SelectorDialog

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

func NewSelectorDialog

func NewSelectorDialog(title string, prompt string, options []string, focus int,
	uiConfig *config.UIConfig, cb func(string, error),
) *SelectorDialog

func (*SelectorDialog) ContextHeight

func (gp *SelectorDialog) ContextHeight() (func(int) int, func(int) int)

func (*SelectorDialog) Draw

func (gp *SelectorDialog) Draw(ctx *ui.Context)

func (*SelectorDialog) Event

func (gp *SelectorDialog) Event(event vaxis.Event) bool

func (*SelectorDialog) Focus

func (gp *SelectorDialog) Focus(f bool)

func (*SelectorDialog) Invalidate

func (gp *SelectorDialog) Invalidate()

type Spinner

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

func NewSpinner

func NewSpinner(uiConf *config.UIConfig) *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 {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*StatusLine) Clear

func (status *StatusLine) Clear()

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) PushError

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

func (*StatusLine) PushSuccess

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

func (*StatusLine) PushWarning

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

func (*StatusLine) SetError

func (status *StatusLine) SetError(err string)

func (*StatusLine) Update

func (status *StatusLine) Update(acct *AccountView)

type StatusMessage

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

func PushError

func PushError(text string) *StatusMessage

func PushStatus

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

func PushSuccess

func PushSuccess(text string) *StatusMessage

func PushWarning

func PushWarning(text string) *StatusMessage

func (*StatusMessage) Color

func (msg *StatusMessage) Color(style vaxis.Style)

type Terminal

type Terminal struct {
	OnClose func(err error)
	OnEvent func(event vaxis.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()

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 vaxis.Event) bool

func (*Terminal) Focus

func (term *Terminal) Focus(focus bool)

func (*Terminal) HandleEvent

func (t *Terminal) HandleEvent(ev vaxis.Event)

HandleEvent is used to watch the underlying terminal events

func (*Terminal) Invalidate

func (term *Terminal) Invalidate()

func (*Terminal) MouseEvent

func (term *Terminal) MouseEvent(localX int, localY int, event vaxis.Event)

func (*Terminal) Show

func (term *Terminal) Show(visible bool)

func (*Terminal) Terminal

func (term *Terminal) Terminal() *Terminal

Jump to

Keyboard shortcuts

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