translation

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: CC0-1.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionITranslationDirectManagerOnTranslationRequest       = binder.FirstCallTransaction + 0
	TransactionITranslationDirectManagerOnFinishTranslationSession = binder.FirstCallTransaction + 1
)
View Source
const (
	MethodITranslationDirectManagerOnTranslationRequest       = "onTranslationRequest"
	MethodITranslationDirectManagerOnFinishTranslationSession = "onFinishTranslationSession"
)
View Source
const (
	TransactionITranslationManagerOnTranslationCapabilitiesRequest        = binder.FirstCallTransaction + 0
	TransactionITranslationManagerRegisterTranslationCapabilityCallback   = binder.FirstCallTransaction + 1
	TransactionITranslationManagerUnregisterTranslationCapabilityCallback = binder.FirstCallTransaction + 2
	TransactionITranslationManagerOnSessionCreated                        = binder.FirstCallTransaction + 3
	TransactionITranslationManagerUpdateUiTranslationState                = binder.FirstCallTransaction + 4
	TransactionITranslationManagerRegisterUiTranslationStateCallback      = binder.FirstCallTransaction + 5
	TransactionITranslationManagerUnregisterUiTranslationStateCallback    = binder.FirstCallTransaction + 6
	TransactionITranslationManagerGetServiceSettingsActivity              = binder.FirstCallTransaction + 7
	TransactionITranslationManagerOnTranslationFinished                   = binder.FirstCallTransaction + 8
)
View Source
const (
	MethodITranslationManagerOnTranslationCapabilitiesRequest        = "onTranslationCapabilitiesRequest"
	MethodITranslationManagerRegisterTranslationCapabilityCallback   = "registerTranslationCapabilityCallback"
	MethodITranslationManagerUnregisterTranslationCapabilityCallback = "unregisterTranslationCapabilityCallback"
	MethodITranslationManagerOnSessionCreated                        = "onSessionCreated"
	MethodITranslationManagerUpdateUiTranslationState                = "updateUiTranslationState"
	MethodITranslationManagerRegisterUiTranslationStateCallback      = "registerUiTranslationStateCallback"
	MethodITranslationManagerUnregisterUiTranslationStateCallback    = "unregisterUiTranslationStateCallback"
	MethodITranslationManagerGetServiceSettingsActivity              = "getServiceSettingsActivity"
	MethodITranslationManagerOnTranslationFinished                   = "onTranslationFinished"
)
View Source
const DescriptorITranslationDirectManager = "android.view.translation.ITranslationDirectManager"
View Source
const DescriptorITranslationManager = "android.view.translation.ITranslationManager"
View Source
const DescriptorITranslationServiceCallback = "android.view.translation.ITranslationServiceCallback"
View Source
const (
	MethodITranslationServiceCallbackUpdateTranslationCapability = "updateTranslationCapability"
)
View Source
const (
	TransactionITranslationServiceCallbackUpdateTranslationCapability = binder.FirstCallTransaction + 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ITranslationDirectManager

type ITranslationDirectManager interface {
	AsBinder() binder.IBinder
	OnTranslationRequest(ctx context.Context, request TranslationRequest, sessionId int32, transport os.ICancellationSignal, callback serviceTranslation.ITranslationCallback) error
	OnFinishTranslationSession(ctx context.Context, sessionId int32) error
}

func NewTranslationDirectManagerStub

func NewTranslationDirectManagerStub(
	impl ITranslationDirectManagerServer,
) ITranslationDirectManager

NewTranslationDirectManagerStub creates a server-side ITranslationDirectManager wrapping the given server implementation. The returned value satisfies ITranslationDirectManager 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 ITranslationDirectManagerServer

type ITranslationDirectManagerServer interface {
	OnTranslationRequest(ctx context.Context, request TranslationRequest, sessionId int32, transport os.ICancellationSignal, callback serviceTranslation.ITranslationCallback) error
	OnFinishTranslationSession(ctx context.Context, sessionId int32) error
}

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

type ITranslationManager

type ITranslationManager interface {
	AsBinder() binder.IBinder
	OnTranslationCapabilitiesRequest(ctx context.Context, sourceFormat int32, destFormat int32, receiver os.ResultReceiver) error
	RegisterTranslationCapabilityCallback(ctx context.Context, callback os.IRemoteCallback) error
	UnregisterTranslationCapabilityCallback(ctx context.Context, callback os.IRemoteCallback) error
	OnSessionCreated(ctx context.Context, translationContext TranslationContext, sessionId int32, receiver internalOs.IResultReceiver) error
	UpdateUiTranslationState(ctx context.Context, state int32, sourceSpec TranslationSpec, targetSpec TranslationSpec, viewIds []autofill.AutofillId, token binder.IBinder, taskId int32, uiTranslationSpec UiTranslationSpec) error
	RegisterUiTranslationStateCallback(ctx context.Context, callback os.IRemoteCallback) error
	UnregisterUiTranslationStateCallback(ctx context.Context, callback os.IRemoteCallback) error
	GetServiceSettingsActivity(ctx context.Context, result internalOs.IResultReceiver) error
	OnTranslationFinished(ctx context.Context, activityDestroyed bool, token binder.IBinder, componentName content.ComponentName) error
}

func NewTranslationManagerStub

func NewTranslationManagerStub(
	impl ITranslationManagerServer,
) ITranslationManager

NewTranslationManagerStub creates a server-side ITranslationManager wrapping the given server implementation. The returned value satisfies ITranslationManager 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 ITranslationManagerServer

type ITranslationManagerServer interface {
	OnTranslationCapabilitiesRequest(ctx context.Context, sourceFormat int32, destFormat int32, receiver os.ResultReceiver) error
	RegisterTranslationCapabilityCallback(ctx context.Context, callback os.IRemoteCallback) error
	UnregisterTranslationCapabilityCallback(ctx context.Context, callback os.IRemoteCallback) error
	OnSessionCreated(ctx context.Context, translationContext TranslationContext, sessionId int32, receiver internalOs.IResultReceiver) error
	UpdateUiTranslationState(ctx context.Context, state int32, sourceSpec TranslationSpec, targetSpec TranslationSpec, viewIds []autofill.AutofillId, token binder.IBinder, taskId int32, uiTranslationSpec UiTranslationSpec) error
	RegisterUiTranslationStateCallback(ctx context.Context, callback os.IRemoteCallback) error
	UnregisterUiTranslationStateCallback(ctx context.Context, callback os.IRemoteCallback) error
	GetServiceSettingsActivity(ctx context.Context, result internalOs.IResultReceiver) error
	OnTranslationFinished(ctx context.Context, activityDestroyed bool, token binder.IBinder, componentName content.ComponentName) error
}

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

type ITranslationServiceCallback

type ITranslationServiceCallback interface {
	AsBinder() binder.IBinder
	UpdateTranslationCapability(ctx context.Context, capability TranslationCapability) error
}

func NewTranslationServiceCallbackStub

func NewTranslationServiceCallbackStub(
	impl ITranslationServiceCallbackServer,
) ITranslationServiceCallback

NewTranslationServiceCallbackStub creates a server-side ITranslationServiceCallback wrapping the given server implementation. The returned value satisfies ITranslationServiceCallback 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 ITranslationServiceCallbackServer

type ITranslationServiceCallbackServer interface {
	UpdateTranslationCapability(ctx context.Context, capability TranslationCapability) error
}

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

type TranslationCapability

type TranslationCapability struct {
	Flg                       int32
	State                     int32
	SupportedTranslationFlags int32
}

func (*TranslationCapability) MarshalParcel

func (s *TranslationCapability) MarshalParcel(
	p *parcel.Parcel,
) error

func (*TranslationCapability) UnmarshalParcel

func (s *TranslationCapability) UnmarshalParcel(
	p *parcel.Parcel,
) error

type TranslationContext

type TranslationContext struct {
	Flg              int32
	TranslationFlags int32
}

func (*TranslationContext) MarshalParcel

func (s *TranslationContext) MarshalParcel(
	p *parcel.Parcel,
) error

func (*TranslationContext) UnmarshalParcel

func (s *TranslationContext) UnmarshalParcel(
	p *parcel.Parcel,
) error

type TranslationDirectManagerProxy

type TranslationDirectManagerProxy struct {
	Remote binder.IBinder
}

func NewTranslationDirectManagerProxy

func NewTranslationDirectManagerProxy(
	remote binder.IBinder,
) *TranslationDirectManagerProxy

func (*TranslationDirectManagerProxy) AsBinder

func (*TranslationDirectManagerProxy) OnFinishTranslationSession

func (p *TranslationDirectManagerProxy) OnFinishTranslationSession(
	ctx context.Context,
	sessionId int32,
) error

func (*TranslationDirectManagerProxy) OnTranslationRequest

func (p *TranslationDirectManagerProxy) OnTranslationRequest(
	ctx context.Context,
	request TranslationRequest,
	sessionId int32,
	transport os.ICancellationSignal,
	callback serviceTranslation.ITranslationCallback,
) error

type TranslationDirectManagerStub

type TranslationDirectManagerStub struct {
	Impl      ITranslationDirectManager
	Transport binder.VersionAwareTransport
}

TranslationDirectManagerStub dispatches incoming binder transactions to a typed ITranslationDirectManager implementation.

func (*TranslationDirectManagerStub) Descriptor

func (s *TranslationDirectManagerStub) Descriptor() string

func (*TranslationDirectManagerStub) OnTransaction

type TranslationManagerProxy

type TranslationManagerProxy struct {
	Remote binder.IBinder
}

func GetTranslationManager

func GetTranslationManager(
	ctx context.Context,
	sm *servicemanager.ServiceManager,
) (*TranslationManagerProxy, error)

GetTranslationManager retrieves the TranslationManagerService service and returns a typed proxy.

func GetUiTranslationService

func GetUiTranslationService(
	ctx context.Context,
	sm *servicemanager.ServiceManager,
) (*TranslationManagerProxy, error)

GetUiTranslationService retrieves the UiTranslationService service and returns a typed proxy.

func NewTranslationManagerProxy

func NewTranslationManagerProxy(
	remote binder.IBinder,
) *TranslationManagerProxy

func (*TranslationManagerProxy) AsBinder

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

func (*TranslationManagerProxy) GetServiceSettingsActivity

func (p *TranslationManagerProxy) GetServiceSettingsActivity(
	ctx context.Context,
	result internalOs.IResultReceiver,
) error

func (*TranslationManagerProxy) OnSessionCreated

func (p *TranslationManagerProxy) OnSessionCreated(
	ctx context.Context,
	translationContext TranslationContext,
	sessionId int32,
	receiver internalOs.IResultReceiver,
) error

func (*TranslationManagerProxy) OnTranslationCapabilitiesRequest

func (p *TranslationManagerProxy) OnTranslationCapabilitiesRequest(
	ctx context.Context,
	sourceFormat int32,
	destFormat int32,
	receiver os.ResultReceiver,
) error

func (*TranslationManagerProxy) OnTranslationFinished

func (p *TranslationManagerProxy) OnTranslationFinished(
	ctx context.Context,
	activityDestroyed bool,
	token binder.IBinder,
	componentName content.ComponentName,
) error

func (*TranslationManagerProxy) RegisterTranslationCapabilityCallback

func (p *TranslationManagerProxy) RegisterTranslationCapabilityCallback(
	ctx context.Context,
	callback os.IRemoteCallback,
) error

func (*TranslationManagerProxy) RegisterUiTranslationStateCallback

func (p *TranslationManagerProxy) RegisterUiTranslationStateCallback(
	ctx context.Context,
	callback os.IRemoteCallback,
) error

func (*TranslationManagerProxy) UnregisterTranslationCapabilityCallback

func (p *TranslationManagerProxy) UnregisterTranslationCapabilityCallback(
	ctx context.Context,
	callback os.IRemoteCallback,
) error

func (*TranslationManagerProxy) UnregisterUiTranslationStateCallback

func (p *TranslationManagerProxy) UnregisterUiTranslationStateCallback(
	ctx context.Context,
	callback os.IRemoteCallback,
) error

func (*TranslationManagerProxy) UpdateUiTranslationState

func (p *TranslationManagerProxy) UpdateUiTranslationState(
	ctx context.Context,
	state int32,
	sourceSpec TranslationSpec,
	targetSpec TranslationSpec,
	viewIds []autofill.AutofillId,
	token binder.IBinder,
	taskId int32,
	uiTranslationSpec UiTranslationSpec,
) error

type TranslationManagerStub

type TranslationManagerStub struct {
	Impl      ITranslationManager
	Transport binder.VersionAwareTransport
}

TranslationManagerStub dispatches incoming binder transactions to a typed ITranslationManager implementation.

func (*TranslationManagerStub) Descriptor

func (s *TranslationManagerStub) Descriptor() string

func (*TranslationManagerStub) OnTransaction

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

type TranslationRequest

type TranslationRequest struct {
	Flags int32
}

func (*TranslationRequest) MarshalParcel

func (s *TranslationRequest) MarshalParcel(
	p *parcel.Parcel,
) error

func (*TranslationRequest) UnmarshalParcel

func (s *TranslationRequest) UnmarshalParcel(
	p *parcel.Parcel,
) error

type TranslationRequestValue

type TranslationRequestValue struct {
	Flg int32
}

func (*TranslationRequestValue) MarshalParcel

func (s *TranslationRequestValue) MarshalParcel(
	p *parcel.Parcel,
) error

func (*TranslationRequestValue) UnmarshalParcel

func (s *TranslationRequestValue) UnmarshalParcel(
	p *parcel.Parcel,
) error

type TranslationResponse

type TranslationResponse struct {
	Flg               int32
	TranslationStatus int32
}

func (*TranslationResponse) MarshalParcel

func (s *TranslationResponse) MarshalParcel(
	p *parcel.Parcel,
) error

func (*TranslationResponse) UnmarshalParcel

func (s *TranslationResponse) UnmarshalParcel(
	p *parcel.Parcel,
) error

type TranslationResponseValue

type TranslationResponseValue struct {
	Flg        int32
	StatusCode int32
}

func (*TranslationResponseValue) MarshalParcel

func (s *TranslationResponseValue) MarshalParcel(
	p *parcel.Parcel,
) error

func (*TranslationResponseValue) UnmarshalParcel

func (s *TranslationResponseValue) UnmarshalParcel(
	p *parcel.Parcel,
) error

type TranslationServiceCallbackProxy

type TranslationServiceCallbackProxy struct {
	Remote binder.IBinder
}

func NewTranslationServiceCallbackProxy

func NewTranslationServiceCallbackProxy(
	remote binder.IBinder,
) *TranslationServiceCallbackProxy

func (*TranslationServiceCallbackProxy) AsBinder

func (*TranslationServiceCallbackProxy) UpdateTranslationCapability

func (p *TranslationServiceCallbackProxy) UpdateTranslationCapability(
	ctx context.Context,
	capability TranslationCapability,
) error

type TranslationServiceCallbackStub

type TranslationServiceCallbackStub struct {
	Impl      ITranslationServiceCallback
	Transport binder.VersionAwareTransport
}

TranslationServiceCallbackStub dispatches incoming binder transactions to a typed ITranslationServiceCallback implementation.

func (*TranslationServiceCallbackStub) Descriptor

func (s *TranslationServiceCallbackStub) Descriptor() string

func (*TranslationServiceCallbackStub) OnTransaction

type TranslationSpec

type TranslationSpec struct {
	Language   string
	DataFormat int32
}

func (*TranslationSpec) MarshalParcel

func (s *TranslationSpec) MarshalParcel(
	p *parcel.Parcel,
) error

func (*TranslationSpec) UnmarshalParcel

func (s *TranslationSpec) UnmarshalParcel(
	p *parcel.Parcel,
) error

type UiTranslationSpec

type UiTranslationSpec struct {
	Flg int32
}

func (*UiTranslationSpec) MarshalParcel

func (s *UiTranslationSpec) MarshalParcel(
	p *parcel.Parcel,
) error

func (*UiTranslationSpec) UnmarshalParcel

func (s *UiTranslationSpec) UnmarshalParcel(
	p *parcel.Parcel,
) error

type ViewTranslationRequest

type ViewTranslationRequest struct {
	AutofillId *types.AutofillId
}

func (*ViewTranslationRequest) MarshalParcel

func (s *ViewTranslationRequest) MarshalParcel(
	p *parcel.Parcel,
) error

func (*ViewTranslationRequest) UnmarshalParcel

func (s *ViewTranslationRequest) UnmarshalParcel(
	p *parcel.Parcel,
) error

type ViewTranslationResponse

type ViewTranslationResponse struct {
	AutofillId *types.AutofillId
}

func (*ViewTranslationResponse) MarshalParcel

func (s *ViewTranslationResponse) MarshalParcel(
	p *parcel.Parcel,
) error

func (*ViewTranslationResponse) UnmarshalParcel

func (s *ViewTranslationResponse) UnmarshalParcel(
	p *parcel.Parcel,
) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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