sessionmsg

package
v0.0.0-...-61f35a2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentPath         = "/com/deepin/daemon/ServiceTrigger/Agent"
	AgentIfc          = "com.deepin.daemon.ServiceTrigger.Agent"
	MethodSendMessage = "SendMessage"
)

这个 agent 实际在 dde-session-daemon 中的 service_trigger 模块中实现的

Variables

This section is empty.

Functions

func SendMessage

func SendMessage(msg *Message) error

func SetAgentInfoPublisher

func SetAgentInfoPublisher(v AgentInfoPublisher)

Types

type AgentInfoPublisher

type AgentInfoPublisher interface {
	GetActiveAgentName() string
	GetAllAgentNames() []string
}

AgentInfoPublisher 用于从 system/bluetooth 模块获取来自 session 的 agent 注册的服务名 只要知道 agent 的服务名,就可以调用 service_trigger 模块在 system bus 上导出的 agent 对象, 没有增加新的 DBus 接口用于注册 agent。

type Body

type Body interface {
	MessageType() MessageType
}

type BodyNotify

type BodyNotify struct {
	Icon          string
	Summary       *LocalizeStr
	Body          *LocalizeStr
	AppName       string // 如果为空,则为 dde-control-center
	ExpireTimeout int    // -1 使用默认值,0 永不过期,> 0 的是具体秒数
	Actions       []string
	Hints         map[string]dbus.Variant
}

func (*BodyNotify) MessageType

func (*BodyNotify) MessageType() MessageType

type LocalizeStr

type LocalizeStr struct {
	Format string
	Args   []string
}

func (*LocalizeStr) String

func (str *LocalizeStr) String() string

type Message

type Message struct {
	Body Body
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(onlyActive bool, body Body) *Message

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(bytes []byte) error

type MessageType

type MessageType uint
const (
	MessageTypeNotify MessageType = iota + 1
)

Jump to

Keyboard shortcuts

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