mime

package
v0.0.0-...-520a03a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppMimeTerminal = "application/x-terminal"
)

Variables

This section is empty.

Functions

func SetAppInfo

func SetAppInfo(ty, id string) error

Types

type AppInfo

type AppInfo struct {
	// Desktop id
	Id string
	// App name
	Name string
	// Display name
	DisplayName string
	// Comment
	Description string
	// Icon
	Icon string
	// Commandline
	Exec      string
	CanDelete bool
	// contains filtered or unexported fields
}

func GetDefaultAppInfo

func GetDefaultAppInfo(mimeType string) (*AppInfo, error)

type AppInfos

type AppInfos []*AppInfo

func GetAppInfos

func GetAppInfos(mimeType string) AppInfos

func (AppInfos) Add

func (infos AppInfos) Add(id string) (AppInfos, error)

func (AppInfos) Delete

func (infos AppInfos) Delete(id string) AppInfos

type Daemon

type Daemon struct {
	*loader.ModuleBase
	// contains filtered or unexported fields
}

func NewDaemon

func NewDaemon(logger *log.Logger) *Daemon

func (*Daemon) GetDependencies

func (d *Daemon) GetDependencies() []string

func (*Daemon) Start

func (d *Daemon) Start() error

func (*Daemon) Stop

func (d *Daemon) Stop() error

func (*Daemon) WaitEnable

func (d *Daemon) WaitEnable()

type Manager

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

func NewManager

func NewManager(service *dbusutil.Service) *Manager

func (*Manager) AddUserApp

func (m *Manager) AddUserApp(mimeTypes []string, desktopId string) *dbus.Error

func (*Manager) DeleteApp

func (m *Manager) DeleteApp(mimeTypes []string, desktopId string) *dbus.Error

func (*Manager) DeleteUserApp

func (m *Manager) DeleteUserApp(desktopId string) *dbus.Error

func (*Manager) GetDefaultApp

func (m *Manager) GetDefaultApp(mimeType string) (defaultApp string, busErr *dbus.Error)

GetDefaultApp get the default app id for the special mime ty: the special mime ret0: the default app info ret1: error message

func (*Manager) GetExportedMethods

func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods

func (*Manager) GetInterfaceName

func (*Manager) GetInterfaceName() string

func (*Manager) ListApps

func (m *Manager) ListApps(mimeType string) (apps string, busErr *dbus.Error)

ListApps list the apps that supported the special mime ty: the special mime ret0: the app infos

func (*Manager) ListUserApps

func (m *Manager) ListUserApps(mimeType string) (userApps string, busErr *dbus.Error)

func (*Manager) Reset

func (m *Manager) Reset()

Reset reset mimes default app

func (*Manager) SetDefaultApp

func (m *Manager) SetDefaultApp(mimes []string, desktopId string) *dbus.Error

SetDefaultApp set the default app for the special mime list ty: the special mime deskId: the default app desktop id ret0: error message

Jump to

Keyboard shortcuts

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