Some checks failed
Linting and tests / Linting (push) Failing after 6s
41 lines
1.6 KiB
Go
41 lines
1.6 KiB
Go
package core
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"bunker/client/internal/services/core/mainwindow/dto"
|
|
|
|
"fyne.io/fyne/v2"
|
|
)
|
|
|
|
// ServiceNameMainWindow is a name for main window service.
|
|
const ServiceNameMainWindow = "core/mainwindow"
|
|
|
|
var (
|
|
// ErrMainWindow indicates that error appeared somewhere in main window service.
|
|
ErrMainWindow = errors.New("main window service")
|
|
// ErrMainWindowIsInvalid indicates that main window service implementation is invalid.
|
|
ErrMainWindowIsInvalid = errors.New("main window service implementation is invalid")
|
|
)
|
|
|
|
// MainWindow is an interface for main window service.
|
|
type MainWindow interface {
|
|
// AddTab adds tab in main window.
|
|
AddTab(tab *dto.Tab)
|
|
// MainWindow returns main window instance (e.g. for using as parent with dialogs).
|
|
MainWindow() fyne.Window
|
|
// RegisterAboutWindowSysInfoHandler registers handler for System Info tab in About dialog.
|
|
RegisterAboutWindowSysInfoHandler(name string, hndl SysInfoHandler) error
|
|
// SetStatusProgressBarCurrentValue sets current value for progressbar in status bar.
|
|
SetStatusProgressBarCurrentValue(current float64)
|
|
// SetStatusProgressBarMaxValue sets maximum value for progressbar in status bar.
|
|
SetStatusProgressBarMaxValue(current float64)
|
|
// SetStatus sets text in status bar. If non-empty text is passed - then progress bar is also shown, and hidden
|
|
// if passed text is empty.
|
|
SetStatus(status string)
|
|
}
|
|
|
|
// SysInfoHandler is a function signature for registering with additional system information handler for About dialog.
|
|
// It should return valid markdown and should end with "\n".
|
|
type SysInfoHandler func() string
|