Camel.Operation

g Camel.Operation Camel.Operation GObject.Object GObject.Object Gio.Cancellable Gio.Cancellable GObject.Object->Gio.Cancellable Gio.Cancellable->Camel.Operation

Subclasses:

None

Methods

Inherited:

Gio.Cancellable (14), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

cancel_all ()

class

dup_message (cancellable)

class

new ()

class

new_proxy (cancellable)

class

pop_message (cancellable)

class

progress (cancellable, percent)

Virtual Methods

Inherited:

Gio.Cancellable (1), GObject.Object (7)

do_status (what, pc)

Properties

None

Signals

Inherited:

Gio.Cancellable (1), GObject.Object (1)

Name

Short Description

pop-message

progress

push-message

status

Fields

Inherited:

Gio.Cancellable (1), GObject.Object (1)

Name

Type

Access

Description

parent

Gio.Cancellable

r

Class Details

class Camel.Operation(**kwargs)
Bases:

Gio.Cancellable

Abstract:

No

Structure:

Camel.OperationClass

classmethod cancel_all()

Cancel all outstanding operations.

classmethod dup_message(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Returns:

a copy of the last text set by camel_operation_push_message(), or None, when none is set.

Return type:

str or None

Duplicates current operation message, or returns None, if no such is available. The message as the last text set by camel_operation_push_message().

Free the returned text with GLib.free(), when no longer needed.

This function only works if cancellable is a Camel.Operation cast as a Gio.Cancellable. If cancellable is a plain Gio.Cancellable or None, the function does nothing and returns silently.

New in version 3.52.

classmethod new()
Returns:

A new operation handle.

Return type:

Gio.Cancellable

Create a new camel operation handle. Camel operation handles can be used in a multithreaded application (or a single operation handle can be used in a non threaded appliation) to cancel running operations and to obtain notification messages of the internal status of messages.

classmethod new_proxy(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable to proxy

Returns:

A new operation handle, proxying cancellable.

Return type:

Gio.Cancellable

Proxies the cancellable in a way that if it is cancelled, then the returned cancellable is also cancelled, but when the returned cancellable is cancelled, then it doesn’t influence the original cancellable. Other Camel.Operation actions being done on the returned cancellable are also propagated to the cancellable.

The passed-in cancellable can be None, in which case a plain Camel.Operation is returned.

This is useful when some operation can be cancelled from elsewhere (like by a user), but also by the code on its own, when it doesn’t make sense to cancel also any larger operation to which the passed-in cancellable belongs.

New in version 3.24.

classmethod pop_message(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable

Pops the most recently pushed message.

This function only works if cancellable is a Camel.Operation cast as a Gio.Cancellable. If cancellable is a plain Gio.Cancellable or None, the function does nothing and returns silently.

classmethod progress(cancellable, percent)
Parameters:

Report progress on the current operation. percent reports the current percentage of completion, which should be in the range of 0 to 100.

This function only works if cancellable is a Camel.Operation cast as a Gio.Cancellable. If cancellable is a plain Gio.Cancellable or None, the function does nothing and returns silently.

do_status(what, pc) virtual
Parameters:

Signal Details

Camel.Operation.signals.pop_message(operation)
Signal Name:

pop-message

Flags:

RUN_LAST

Parameters:

operation (Camel.Operation) – The object which received the signal

Camel.Operation.signals.progress(operation, object)
Signal Name:

progress

Flags:

RUN_LAST

Parameters:
Camel.Operation.signals.push_message(operation, object)
Signal Name:

push-message

Flags:

RUN_LAST

Parameters:
Camel.Operation.signals.status(operation, object, p0)
Signal Name:

status

Flags:

RUN_LAST

Parameters: