Help us shape the future of Go! Take the 2026 Go Developer Survey

translation

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionITranslationServiceOnConnected                      = binder.FirstCallTransaction + 0
	TransactionITranslationServiceOnDisconnected                   = binder.FirstCallTransaction + 1
	TransactionITranslationServiceOnCreateTranslationSession       = binder.FirstCallTransaction + 2
	TransactionITranslationServiceOnTranslationCapabilitiesRequest = binder.FirstCallTransaction + 3
)
View Source
const (
	MethodITranslationServiceOnConnected                      = "onConnected"
	MethodITranslationServiceOnDisconnected                   = "onDisconnected"
	MethodITranslationServiceOnCreateTranslationSession       = "onCreateTranslationSession"
	MethodITranslationServiceOnTranslationCapabilitiesRequest = "onTranslationCapabilitiesRequest"
)
View Source
const DescriptorITranslationCallback = "android.service.translation.ITranslationCallback"
View Source
const DescriptorITranslationService = "android.service.translation.ITranslationService"
View Source
const (
	MethodITranslationCallbackOnTranslationResponse = "onTranslationResponse"
)
View Source
const (
	TransactionITranslationCallbackOnTranslationResponse = binder.FirstCallTransaction + 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ITranslationCallback

type ITranslationCallback interface {
	AsBinder() binder.IBinder
	OnTranslationResponse(ctx context.Context, translationResponse types.TranslationResponse) error
}

func NewTranslationCallbackStub

func NewTranslationCallbackStub(
	impl ITranslationCallbackServer,
) ITranslationCallback

NewTranslationCallbackStub creates a server-side ITranslationCallback wrapping the given server implementation. The returned value satisfies ITranslationCallback and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ITranslationCallbackServer

type ITranslationCallbackServer interface {
	OnTranslationResponse(ctx context.Context, translationResponse types.TranslationResponse) error
}

ITranslationCallbackServer is the server-side interface that user implementations provide to NewTranslationCallbackStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type ITranslationService

type ITranslationService interface {
	AsBinder() binder.IBinder
	OnConnected(ctx context.Context, callback binder.IBinder) error
	OnDisconnected(ctx context.Context) error
	OnCreateTranslationSession(ctx context.Context, translationContext types.TranslationContext, sessionId int32, receiver os.IResultReceiver) error
	OnTranslationCapabilitiesRequest(ctx context.Context, sourceFormat int32, targetFormat int32, receiver androidOs.ResultReceiver) error
}

func NewTranslationServiceStub

func NewTranslationServiceStub(
	impl ITranslationServiceServer,
) ITranslationService

NewTranslationServiceStub creates a server-side ITranslationService wrapping the given server implementation. The returned value satisfies ITranslationService and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ITranslationServiceServer

type ITranslationServiceServer interface {
	OnConnected(ctx context.Context, callback binder.IBinder) error
	OnDisconnected(ctx context.Context) error
	OnCreateTranslationSession(ctx context.Context, translationContext types.TranslationContext, sessionId int32, receiver os.IResultReceiver) error
	OnTranslationCapabilitiesRequest(ctx context.Context, sourceFormat int32, targetFormat int32, receiver androidOs.ResultReceiver) error
}

ITranslationServiceServer is the server-side interface that user implementations provide to NewTranslationServiceStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type TranslationCallbackProxy

type TranslationCallbackProxy struct {
	Remote binder.IBinder
}

func NewTranslationCallbackProxy

func NewTranslationCallbackProxy(
	remote binder.IBinder,
) *TranslationCallbackProxy

func (*TranslationCallbackProxy) AsBinder

func (p *TranslationCallbackProxy) AsBinder() binder.IBinder

func (*TranslationCallbackProxy) OnTranslationResponse

func (p *TranslationCallbackProxy) OnTranslationResponse(
	ctx context.Context,
	translationResponse types.TranslationResponse,
) error

type TranslationCallbackStub

type TranslationCallbackStub struct {
	Impl      ITranslationCallback
	Transport binder.VersionAwareTransport
}

TranslationCallbackStub dispatches incoming binder transactions to a typed ITranslationCallback implementation.

func (*TranslationCallbackStub) Descriptor

func (s *TranslationCallbackStub) Descriptor() string

func (*TranslationCallbackStub) OnTransaction

func (s *TranslationCallbackStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

type TranslationServiceProxy

type TranslationServiceProxy struct {
	Remote binder.IBinder
}

func NewTranslationServiceProxy

func NewTranslationServiceProxy(
	remote binder.IBinder,
) *TranslationServiceProxy

func (*TranslationServiceProxy) AsBinder

func (p *TranslationServiceProxy) AsBinder() binder.IBinder

func (*TranslationServiceProxy) OnConnected

func (p *TranslationServiceProxy) OnConnected(
	ctx context.Context,
	callback binder.IBinder,
) error

func (*TranslationServiceProxy) OnCreateTranslationSession

func (p *TranslationServiceProxy) OnCreateTranslationSession(
	ctx context.Context,
	translationContext types.TranslationContext,
	sessionId int32,
	receiver os.IResultReceiver,
) error

func (*TranslationServiceProxy) OnDisconnected

func (p *TranslationServiceProxy) OnDisconnected(
	ctx context.Context,
) error

func (*TranslationServiceProxy) OnTranslationCapabilitiesRequest

func (p *TranslationServiceProxy) OnTranslationCapabilitiesRequest(
	ctx context.Context,
	sourceFormat int32,
	targetFormat int32,
	receiver androidOs.ResultReceiver,
) error

type TranslationServiceStub

type TranslationServiceStub struct {
	Impl      ITranslationService
	Transport binder.VersionAwareTransport
}

TranslationServiceStub dispatches incoming binder transactions to a typed ITranslationService implementation.

func (*TranslationServiceStub) Descriptor

func (s *TranslationServiceStub) Descriptor() string

func (*TranslationServiceStub) OnTransaction

func (s *TranslationServiceStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

Jump to

Keyboard shortcuts

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