Gjsify LogoGjsify Logo

Data structure representing a #TpFileTransferChannel.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

bus_name: string

The D-Bus bus name for this object. Read-only except during construction.

channel_ready: boolean

Initially %FALSE; changes to %TRUE when tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE, and if the channel is a group, %TP_CHANNEL_FEATURE_GROUP.

This is a less general form of tp_proxy_is_prepared(), which should be used in new code.

One important difference is that after #TpProxy::invalidated is signalled, #TpChannel:channel-ready keeps its current value - which might be %TRUE, if the channel was successfully prepared before it became invalidated - but tp_proxy_is_prepared() returns %FALSE for all features.

Change notification is via notify::channel-ready.

The #TpConnection to which this #TpChannel belongs. Used for e.g. handle manipulation.

A #GDateTime representing the last modification time of the file to be transferred.

Since 0.15.5

dbus_daemon: DBusDaemon

The D-Bus daemon for this object (this object itself, if it is a TpDBusDaemon). Read-only except during construction.

description: string

The description of the file transfer, defined by the sender when sending the file transfer offer.

Since 0.15.5

The #TpSimpleClientFactory used to create this proxy, or %NULL if this proxy was not created through a factory.

file: Gio.File

For incoming file transfers, this property will be set to a #GFile for the location where the file will be saved (given by tp_file_transfer_channel_accept_file_async()) when the transfer starts. The feature %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE must already be prepared for this property to have a meaningful value, and to receive change notification. Once the initial value is set, this property will not be changed.

For outgoing file transfers, this property is a #GFile for the location of the file being sent (given by tp_file_transfer_channel_provide_file_async()). The feature %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE does not have to be prepared and there is no change notification.

filename: string

The name of the file on the sender's side. This is therefore given as a suggested filename for the receiver.

Since 0.15.5

g_type_instance: TypeInstance
group_flags: number

If the %TP_CHANNEL_FEATURE_GROUP feature has been prepared successfully, #TpChannelGroupFlags indicating the capabilities and behaviour of that group.

Otherwise, this may be 0.

Change notification is via notify::group-flags or TpChannel::group-flags-changed.

group_self_contact: TelepathyGLib.Contact

If this channel is a group and %TP_CHANNEL_FEATURE_CONTACTS has been prepared, and the user is a member of the group, the #TpContact representing them in this group.

Otherwise, the result may be either a contact representing the user, or %NULL.

Change notification is via notify::group-self-contact.

group_self_handle: number

If this channel is a group and %TP_CHANNEL_FEATURE_GROUP has been prepared, and the user is a member of the group, the #TpHandle representing them in this group.

Otherwise, the result may be either a handle representing the user, or 0.

Change notification is via notify::group-self-handle.

identifier: string

This channel's associated identifier, or the empty string if it has handle type %TP_HANDLE_TYPE_NONE.

For channels where #TpChannelIface:handle is non-zero, this is the result of inspecting #TpChannelIface:handle.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be the empty string.

Changed in 0.11.4: this property is never %NULL. Previously, it was %NULL before an identifier was known, or when a channel with no TargetID D-Bus property had TargetHandleType %TP_HANDLE_TYPE_NONE.

initial_offset: number

The offset in bytes from where the file should be sent.

The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.

initiator_contact: TelepathyGLib.Contact

The #TpContact of the initiator of this channel, or %NULL if there is no particular initiator.

If the channel was initiated by a remote contact, this represents that contact, and #TpChannel:requested will be %FALSE. For instance, for an incoming call this property indicates the caller, and for a chatroom invitation this property indicates who sent the invitation.

If the channel was requested by the local user, #TpChannel:requested will be %TRUE, and this property may be the #TpChannel:group-self-contact or #TpConnection:self-contact.

If the channel appeared for some other reason (for instance as a side-effect of connecting to the server), this property may be %NULL.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CONTACTS; until then, it may be %NULL.

initiator_handle: number

The %TP_HANDLE_TYPE_CONTACT #TpHandle of the initiator of this channel, or 0 if there is no particular initiator.

If the channel was initiated by a remote contact, this handle represents that contact, and #TpChannel:requested will be %FALSE. For instance, for an incoming call this property indicates the caller, and for a chatroom invitation this property indicates who sent the invitation.

If the channel was requested by the local user, #TpChannel:requested will be %TRUE, and this property may be the #TpChannel:group-self-handle or #TpConnection:self-handle.

If the channel appeared for some other reason (for instance as a side-effect of connecting to the server), this property may be 0.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be 0.

initiator_identifier: string

If #TpChannel:initiator-handle is 0, this will always be "". Otherwise, this will be the #TpContact:identifier of the contact with that handle.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be the empty string.

interfaces: string[]

Known D-Bus interface names for this object.

mime_type: string

The MIME type of the file to be transferred.

object_path: string

The D-Bus object path for this object. Read-only except during construction.

password_needed: boolean

If %TRUE, tp_channel_provide_password_async() has to be called to be able to join the channel.

This is not guaranteed to be meaningful until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_PASSWORD; until then, it may return %FALSE even if the channel is actually protected by a password. Preparing %TP_CHANNEL_FEATURE_PASSWORD also ensures that the notify::password-needed signal will be fired when this property changes.

requested: boolean

%TRUE if this channel was created in response to a local request, such as a call to tp_account_channel_request_create_channel_async(). %FALSE if this channel was initiated by a remote contact (the #TpChannel:initiator-handle), or if it appeared as a side-effect of some other action.

For instance, this is %FALSE on incoming calls and file transfers, remotely-initiated 1-1 text conversations, and invitations to chatrooms, and %TRUE on outgoing calls and file transfers, locally-initiated 1-1 text conversations, and chatrooms joined by local user action.

This is not guaranteed to be meaningful until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may return %FALSE even if the channel was actually requested.

service_name: string

A string representing the name of the service suggested to handle this file transfer channel, or %NULL if the initiator did not provide one.

This is a useful way of requesting file transfer channels with a hint of what handler they should be handled by on the remote side. If a channel request is made with this property set (to a contact who also supports the metadata extension; see the requestable channel classes for said contact), this property will be set to the same value on the remote incoming channel and handlers can match on this in their handler filter. For example, a remote handler could call the following:

|[ tp_base_client_take_handler_filter (handler, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME, G_TYPE_STRING, "service.name", NULL));



The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be
prepared for this property to be meaningful.
size: number

The size of the file to be transferred, or %G_MAXUINT64 if not known.

Since 0.15.5

state: number

A TpFileTransferState holding the state of the file transfer.

The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.

Since 0.17.1

target_contact: TelepathyGLib.Contact

If this channel is for communication with a single contact (that is, #TpChannelIface:handle-type is %TP_HANDLE_TYPE_CONTACT), then a #TpContact representing the remote contact. For chat rooms, contact search channels and other channels without a single remote contact, %NULL.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CONTACTS; until then, it may be %NULL.

transferred_bytes: number

The number of bytes transferred so far in this file transfer.

The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.

name: string

Methods

  • Accept an incoming file transfer in the %TP_FILE_TRANSFER_STATE_PENDING state. Once the accept has been processed, callback will be called. You can then call tp_file_transfer_channel_accept_file_finish() to get the result of the operation.

    Parameters

    • file: Gio.File

      a #GFile where the file should be saved

    • offset: number

      Offset from the start of file where transfer begins

    • callback: AsyncReadyCallback

      a callback to call when the transfer has been accepted

    Returns void

  • Creates a binding between source_property on source and target_property on target.

    Whenever the source_property is changed the target_property is updated using the same value. For instance:

      g_object_bind_property (action, "active", widget, "sensitive", 0);
    

    Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.

    If flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if target_property on target changes then the source_property on source will be updated as well.

    The binding will automatically be removed when either the source or the target instances are finalized. To remove the binding without affecting the source and the target you can just call g_object_unref() on the returned #GBinding instance.

    Removing the binding by calling g_object_unref() on it must only be done if the binding, source and target are only used from a single thread and it is clear that both source and target outlive the binding. Especially it is not safe to rely on this if the binding, source or target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side.

    A #GObject can have multiple bindings.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    Returns Binding

  • Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

    This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transform_to: TClosure<any, any>

      a #GClosure wrapping the transformation function from the source to the target, or %NULL to use the default

    • transform_from: TClosure<any, any>

      a #GClosure wrapping the transformation function from the target to the source, or %NULL to use the default

    Returns Binding

  • borrow_immutable_properties(): HashTable<string | number | symbol, string | number | boolean>
  • Returns the immutable D-Bus properties of this channel, the same as #TpChannel:channel-properties.

    The returned hash table should not be altered, and is not necessarily valid after the main loop is next re-entered. Copy it with g_boxed_copy() (its type is %TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP) if a copy that remains valid must be kept.

    If the #TpChannel:channel-properties property was not set during construction (e.g. by calling tp_channel_new_from_properties()), a reasonable but possibly incomplete version will be made up from the values of individual properties; reading this property repeatedly may yield progressively more complete values until the %TP_CHANNEL_FEATURE_CORE feature is prepared.

    Returns HashTable<string | number | symbol, string | number | boolean>

  • Close channel self. In most cases, it's generally cleaner to use tp_channel_leave_async() instead to properly leave and close the channel.

    When the channel has been closed, callback will be called. You can then call tp_channel_close_finish() to get the result of the operation.

    Parameters

    • callback: AsyncReadyCallback

      a callback to call when we closed the channel, or %NULL to ignore any reply

    Returns void

  • dbus_error_to_gerror(dbus_error: string, debug_message: string): void
  • Convert a D-Bus error name into a GError as if it was returned by a method on this proxy. This method is useful when D-Bus error names are emitted in signals, such as Connection.ConnectionError and Group.MembersChangedDetailed.

    Parameters

    • dbus_error: string

      a D-Bus error name, for instance from the callback for tp_cli_connection_connect_to_connection_error()

    • debug_message: string

      a debug message that accompanied the error name, or %NULL

    Returns void

  • Destroy channel self. If self doesn't implement #TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE or if for any reason we can't destroy the channel, we close it.

    When the channel has been destroyed or closed, callback will be called. You can then call tp_channel_destroy_finish() to get the result of the operation.

    Parameters

    Returns void

  • disconnect(id: number): void
  • Returns the immutable D-Bus properties of this channel, in a variant of type %G_VARIANT_TYPE_VARDICT where the keys are strings, D-Bus interface name + "." + property name. Use g_variant_lookup() or g_variant_lookup_value() for convenient access to the values.

    If the #TpChannel:channel-properties property was not set during construction (e.g. by calling tp_channel_new_from_properties()), a reasonable but possibly incomplete version will be made up from the values of individual properties; reading this property repeatedly may yield progressively more complete values until the %TP_CHANNEL_FEATURE_CORE feature is prepared.

    This function should be used only by #TpChannel subclasses, otherwise it is recommended to use individual property getters instead.

    Returns GLib.Variant

  • emit(sigName: "notify::date", ...args: any[]): void
  • emit(sigName: "notify::description", ...args: any[]): void
  • emit(sigName: "notify::file", ...args: any[]): void
  • emit(sigName: "notify::filename", ...args: any[]): void
  • emit(sigName: "notify::initial-offset", ...args: any[]): void
  • emit(sigName: "notify::mime-type", ...args: any[]): void
  • emit(sigName: "notify::service-name", ...args: any[]): void
  • emit(sigName: "notify::size", ...args: any[]): void
  • emit(sigName: "notify::state", ...args: any[]): void
  • emit(sigName: "notify::transferred-bytes", ...args: any[]): void
  • emit(sigName: "notify::channel-ready", ...args: any[]): void
  • emit(sigName: "notify::connection", ...args: any[]): void
  • emit(sigName: "notify::group-flags", ...args: any[]): void
  • emit(sigName: "notify::group-self-contact", ...args: any[]): void
  • emit(sigName: "notify::group-self-handle", ...args: any[]): void
  • emit(sigName: "notify::identifier", ...args: any[]): void
  • emit(sigName: "notify::initiator-contact", ...args: any[]): void
  • emit(sigName: "notify::initiator-handle", ...args: any[]): void
  • emit(sigName: "notify::initiator-identifier", ...args: any[]): void
  • emit(sigName: "notify::password-needed", ...args: any[]): void
  • emit(sigName: "notify::requested", ...args: any[]): void
  • emit(sigName: "notify::target-contact", ...args: any[]): void
  • emit(sigName: "notify::bus-name", ...args: any[]): void
  • emit(sigName: "notify::dbus-daemon", ...args: any[]): void
  • emit(sigName: "notify::factory", ...args: any[]): void
  • emit(sigName: "notify::interfaces", ...args: any[]): void
  • emit(sigName: "notify::object-path", ...args: any[]): void
  • emit(sigName: string, ...args: any[]): void
  • force_floating(): void
  • This function is intended for #GObject implementations to re-enforce a [floating][floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().

    Returns void

  • freeze_notify(): void
  • Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

    This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    Returns void

  • get_bus_name(): string
  • get_channel_type(): string
  • Get the D-Bus interface name representing this channel's type, if it has been discovered.

    This is the same as the #TpChannelIface:channel-type property; it isn't guaranteed to be non-%NULL until the %TP_CHANNEL_FEATURE_CORE feature has been prepared.

    Returns string

  • get_channel_type_id(): number
  • Get the D-Bus interface name representing this channel's type, as a GQuark, if it has been discovered.

    This is the same as the #TpChannelIface:channel-type property, except that it is a GQuark rather than a string. It isn't guaranteed to be nonzero until the %TP_CHANNEL_FEATURE_CORE property is ready.

    Returns number

  • get_data(key?: string): object
  • Gets a named field from the objects table of associations (see g_object_set_data()).

    Parameters

    • Optional key: string

      name of the key for that association

    Returns object

  • get_description(): string
  • get_filename(): string
  • Get the handle representing the contact, chatroom, etc. with which this channel communicates for its whole lifetime, or 0 if there is no such handle or it has not yet been discovered.

    This is the same as the #TpChannelIface:handle property. It isn't guaranteed to have its final value until the %TP_CHANNEL_FEATURE_CORE feature is ready.

    If handle_type is not %NULL, the type of handle is written into it. This will be %TP_UNKNOWN_HANDLE_TYPE if the handle has not yet been discovered, or %TP_HANDLE_TYPE_NONE if there is no handle with which this channel will always communicate. This is the same as the #TpChannelIface:handle-type property.

    Returns [number, HandleType]

  • get_identifier(): string
  • This channel's associated identifier, or the empty string if no identifier or unknown.

    This is the same as the #TpChannel:identifier property, and isn't guaranteed to be set until the %TP_CHANNEL_FEATURE_CORE property is ready.

    Changed in 0.11.4: as with #TpChannel:identifier, this could previously either be %NULL or the empty string if there was no suitable value. It is now non-%NULL in all cases.

    Returns string

  • get_metadata(): HashTable<string | number | symbol, string | number | boolean>
  • get_mime_type(): string
  • get_object_path(): string
  • get_property(property_name?: string, value?: any): void
  • Gets a property of an object.

    The value can be:

    • an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
    • a #GValue initialized with the expected type of the property
    • a #GValue initialized with a type to which the expected type of the property can be transformed

    In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().

    Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    Parameters

    • Optional property_name: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • get_qdata(quark: number): object
  • get_requested(): boolean
  • get_service_name(): string
  • get_size(): number
  • get_transferred_bytes(): number
  • getv(names: string[], values: any[]): void
  • Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    Parameters

    • names: string[]

      the names of each property to get

    • values: any[]

      the values of each property to get

    Returns void

  • Synopsis (see below for further explanation):

    • if self is not a group or contact is not a member of this channel, result is undefined;
    • if %TP_CHANNEL_FEATURE_CONTACTS has not yet been prepared, result is undefined;
    • if self does not have flags that include %TP_CHANNEL_GROUP_FLAG_PROPERTIES, result is undefined;
    • if contact is channel-specific and its globally valid "owner" is known, return that owner;
    • if contact is channel-specific and its globally valid "owner" is unknown, return %NULL;
    • if contact is globally valid, return contact itself

    Some channels (those with flags that include %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) have a concept of "channel-specific contacts". These are contacts that only have meaning within the context of the channel - for instance, in XMPP Multi-User Chat, participants in a chatroom are identified by an in-room JID consisting of the JID of the chatroom plus a local nickname.

    Depending on the protocol and configuration, it might be possible to find out what globally valid contact (i.e. a contact that you could add to your contact list) "owns" a channel-specific contact. For instance, in most XMPP MUC chatrooms, normal users cannot see what global JID corresponds to an in-room JID, but moderators can.

    This is further complicated by the fact that channels with channel-specific contacts can sometimes have members with globally valid contacts (for instance, if you invite someone to an XMPP MUC using their globally valid JID, you would expect to see the contact representing that JID in the Group's remote-pending set).

    Parameters

    Returns TelepathyGLib.Contact

  • group_get_handle_owner(handle: number): number
  • Synopsis (see below for further explanation):

    • if self is not a group or handle is not a member of this channel, result is undefined;
    • if %TP_CHANNEL_FEATURE_GROUP has not yet been prepared, result is undefined;
    • if self does not have flags that include %TP_CHANNEL_GROUP_FLAG_PROPERTIES, result is undefined;
    • if handle is channel-specific and its globally valid "owner" is known, return that owner;
    • if handle is channel-specific and its globally valid "owner" is unknown, return zero;
    • if handle is globally valid, return handle itself

    Some channels (those with flags that include %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) have a concept of "channel-specific handles". These are handles that only have meaning within the context of the channel - for instance, in XMPP Multi-User Chat, participants in a chatroom are identified by an in-room JID consisting of the JID of the chatroom plus a local nickname.

    Depending on the protocol and configuration, it might be possible to find out what globally valid handle (i.e. an identifier that you could add to your contact list) "owns" a channel-specific handle. For instance, in most XMPP MUC chatrooms, normal users cannot see what global JID corresponds to an in-room JID, but moderators can.

    This is further complicated by the fact that channels with channel-specific handles can sometimes have members with globally valid handles (for instance, if you invite someone to an XMPP MUC using their globally valid JID, you would expect to see the handle representing that JID in the Group's remote-pending set).

    This function's result is undefined unless the channel is ready and its flags include %TP_CHANNEL_GROUP_FLAG_PROPERTIES (an implementation without extra D-Bus round trips is not possible using the older API).

    Parameters

    • handle: number

      a handle which is a member of this channel

    Returns number

  • group_get_local_pending(): Intset
  • If self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a #TpIntset containing its local-pending members.

    If self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of local-pending members, or %NULL.

    If self is not a group, return %NULL.

    Returns Intset

  • If local_pending is actually a local-pending contact, write additional information into actor, reason and message and return %TRUE. The contact and message are not referenced or copied, and can only be assumed to remain valid until the main loop is re-entered.

    If local_pending is not the handle of a local-pending contact, write %NULL into actor, %TP_CHANNEL_GROUP_CHANGE_REASON_NONE into reason and "" into message, and return %FALSE.

    Parameters

    • local_pending: TelepathyGLib.Contact

      the #TpContact of a local-pending contact about whom more information is needed

    Returns [boolean, TelepathyGLib.Contact, ChannelGroupChangeReason, string]

  • If local_pending is actually the handle of a local-pending contact, write additional information into actor, reason and message and return %TRUE. The handle and message are not referenced or copied, and can only be assumed to remain valid until the main loop is re-entered.

    If local_pending is not the handle of a local-pending contact, write 0 into actor, %TP_CHANNEL_GROUP_CHANGE_REASON_NONE into reason and "" into message, and return %FALSE.

    Parameters

    • local_pending: number

      the handle of a local-pending contact about whom more information is needed

    Returns [boolean, number, ChannelGroupChangeReason, string]

  • If self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a #TpIntset containing its members.

    If self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of members, or %NULL.

    If self is not a group, return %NULL.

    Returns Intset

  • group_get_remote_pending(): Intset
  • If self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a #TpIntset containing its remote-pending members.

    If self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of remote-pending members, or %NULL.

    If self is not a group, return %NULL.

    Returns Intset

  • group_get_self_handle(): number
  • has_interface(iface: string): boolean
  • Return whether this proxy is known to have a particular interface. In versions older than 0.11.11, this was a macro wrapper around tp_proxy_has_interface_by_id().

    For objects that discover their interfaces at runtime, this method will indicate that interfaces are missing until they are known to be present. In subclasses that define features for use with tp_proxy_prepare_async(), successfully preparing the "core" feature for that subclass (such as %TP_CHANNEL_FEATURE_CORE or %TP_CONNECTION_FEATURE_CORE) implies that the interfaces are known.

    Parameters

    • iface: string

      the D-Bus interface required, as a string

    Returns boolean

  • has_interface_by_id(iface: number): boolean
  • Return whether this proxy is known to have a particular interface, by its quark ID. This is equivalent to using g_quark_to_string() followed by tp_proxy_has_interface(), but more efficient.

    Parameters

    • iface: number

      quark representing the D-Bus interface required

    Returns boolean

  • is_floating(): boolean
  • is_prepared(feature: number): boolean
  • Return %TRUE if feature has been prepared successfully, or %FALSE if feature has not been requested, has not been prepared yet, or is not available on this object at all.

    (For instance, if feature is %TP_CHANNEL_FEATURE_CHAT_STATES and self is a #TpChannel in a protocol that doesn't actually implement chat states, or is not a #TpChannel at all, then this method will return %FALSE.)

    To prepare features, call tp_proxy_prepare_async().

    Parameters

    • feature: number

      a feature that is supported by self's class

    Returns boolean

  • Join channel self with message as join message.

    When we joined the channel, callback will be called. You can then call tp_channel_join_finish() to get the result of the operation.

    Note that unlike tp_channel_leave_async(), %TP_CHANNEL_FEATURE_GROUP feature must be prepared before calling this function.

    Parameters

    • message: string

      the join message

    • callback: AsyncReadyCallback

      a callback to call when we joined the channel

    Returns void

  • Leave channel self with reason as reason and message as leave message. If self doesn't implement #TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP or if for any reason we can't properly leave the channel, we close it.

    When we left the channel, callback will be called. You can then call tp_channel_leave_finish() to get the result of the operation.

    Note that unlike tp_channel_join_async(), %TP_CHANNEL_FEATURE_GROUP feature does not have to be prepared and will be prepared for you. But this is a deprecated behaviour.

    Parameters

    Returns void

  • notify(property_name: string): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    Parameters

    • property_name: string

      the name of a property installed on the class of object.

    Returns void

  • Emits a "notify" signal for the property specified by pspec on object.

    This function omits the property name lookup, hence it is faster than g_object_notify().

    One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:

      enum
    {
    PROP_0,
    PROP_FOO,
    PROP_LAST
    };

    static GParamSpec *properties[PROP_LAST];

    static void
    my_object_class_init (MyObjectClass *klass)
    {
    properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    0, 100,
    50,
    G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class,
    PROP_FOO,
    properties[PROP_FOO]);
    }

    and then notify a change on the "foo" property with:

      g_object_notify_by_pspec (self, properties[PROP_FOO]);
    

    Parameters

    • pspec: ParamSpec

      the #GParamSpec of a property installed on the class of object.

    Returns void

  • #TpProxy itself does not support any features, but subclasses like #TpChannel can support features, which can either be core functionality like %TP_CHANNEL_FEATURE_CORE, or extended functionality like %TP_CHANNEL_FEATURE_CHAT_STATES.

    Proxy instances start with no features prepared. When features are requested via tp_proxy_prepare_async(), the proxy starts to do the necessary setup to use those features.

    tp_proxy_prepare_async() always waits for core functionality of the proxy's class to be prepared, even if it is not specifically requested: for instance, because %TP_CHANNEL_FEATURE_CORE is core functionality of a #TpChannel,

    |[ TpChannel *channel = ...;

    tp_proxy_prepare_async (channel, NULL, callback, user_data);



    is equivalent to

    |[
    TpChannel *channel = ...;
    GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 };

    tp_proxy_prepare_async (channel, features, callback, user_data);

    If a feature represents core functionality (like %TP_CHANNEL_FEATURE_CORE), failure to prepare it will result in tp_proxy_prepare_async() finishing unsuccessfully: if failure to prepare the feature indicates that the proxy is no longer useful, it will also emit #TpProxy::invalidated.

    If a feature represents non-essential functionality (like %TP_CHANNEL_FEATURE_CHAT_STATES), or is not supported by the object at all, then failure to prepare it is not fatal: tp_proxy_prepare_async() will complete successfully, but tp_proxy_is_prepared() will still return %FALSE for the feature, and accessor methods for the feature will typically return a dummy value.

    Some #TpProxy subclasses automatically start to prepare their core features when instantiated, and features will sometimes become prepared as a side-effect of other actions, but to ensure that a feature is present you must generally call tp_proxy_prepare_async() and wait for the result.

    Parameters

    • features: number[]

      an array of desired features, ending with 0; %NULL is equivalent to an array containing only 0

    • callback: AsyncReadyCallback

      if not %NULL, called exactly once, when the features have all been prepared or failed to prepare, or after the proxy is invalidated

    Returns void

  • Check for error in a call to tp_proxy_prepare_async(). An error here generally indicates that either the asynchronous call was cancelled, or self has emitted #TpProxy::invalidated.

    Parameters

    • result: AsyncResult

      the result passed to the callback of tp_proxy_prepare_async()

    Returns boolean

  • Provide a file transfer. This should be called when the file transfer state changes (tp_file_transfer_channel_get_state() and the "notify::state" signal) to %TP_FILE_TRANSFER_STATE_ACCEPTED or %TP_FILE_TRANSFER_STATE_PENDING. Once the file has been provided, the channel #TpFileTransferChannel:state will change to %TP_FILE_TRANSFER_STATE_OPEN.

    Once the file has been provided, callback will be called. You should then call tp_file_transfer_channel_provide_file_finish() to get the result of the operation.

    Parameters

    • file: Gio.File

      a #GFile to send to the remote contact

    • callback: AsyncReadyCallback

      a callback to call when the transfer has been accepted

    Returns void

  • Finishes a call to tp_file_transfer_channel_provide_file_async().

    Successful return from this function does not mean that the file transfer has completed or has even started at all. The state of the file transfer should be monitored with the "notify::state" signal.

    Parameters

    Returns boolean

  • Provide password so that self can be joined. This function must be called with the correct password in order for channel joining to proceed if the TpChannel:password-needed property is set.

    Once the password has been provided, callback will be called. You can then call tp_channel_provide_password_finish() to get the result of the operation.

    Parameters

    • password: string

      the password

    • callback: AsyncReadyCallback

      a callback to call when password has been provided

    Returns void

  • Increases the reference count of object.

    Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    Returns GObject.Object

  • Increase the reference count of object, and possibly remove the [floating][floating-ref] reference, if object has a floating reference.

    In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

    Since GLib 2.56, the type of object will be propagated to the return type under the same conditions as for g_object_ref().

    Returns GObject.Object

  • run_dispose(): void
  • set_data(key: string, data?: object): void
  • Each object carries around a table of associations from strings to pointers. This function lets you set an association.

    If the object already had an association with that name, the old association will be destroyed.

    Internally, the key is converted to a #GQuark using g_quark_from_string(). This means a copy of key is kept permanently (even after object has been finalized) — so it is recommended to only use a small, bounded set of values for key in your program, to avoid the #GQuark storage growing unbounded.

    Parameters

    • key: string

      name of the key

    • Optional data: object

      data to associate with that key

    Returns void

  • set_property(property_name: string, value?: any): void
  • steal_data(key?: string): object
  • Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

    Parameters

    • Optional key: string

      name of the key

    Returns object

  • steal_qdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata() and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

    void
    object_add_to_user_list (GObject *object,
    const gchar *new_string)
    {
    // the quark, naming the object data
    GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
    // retrieve the old string list
    GList *list = g_object_steal_qdata (object, quark_string_list);

    // prepend new string
    list = g_list_prepend (list, g_strdup (new_string));
    // this changed 'list', so we need to set it again
    g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
    }
    static void
    free_string_list (gpointer data)
    {
    GList *node, *list = data;

    for (node = list; node; node = node->next)
    g_free (node->data);
    g_list_free (list);
    }

    Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • thaw_notify(): void
  • Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

    Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.

    It is an error to call this function when the freeze count is zero.

    Returns void

  • unref(): void
  • Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

    If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    Returns void

  • vfunc_constructed(): void
  • vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: ParamSpec): void
  • vfunc_dispose(): void
  • vfunc_finalize(): void
  • vfunc_get_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    virtual

    Parameters

    Returns void

  • vfunc_set_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • watch_closure(closure: TClosure<any, any>): void
  • This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

    Parameters

    • closure: TClosure<any, any>

      #GClosure to watch

    Returns void

  • compat_control(what: number, data: object): number
  • get_feature_quark_chat_states(): number
  • get_feature_quark_contacts(): number
  • get_feature_quark_core(): number
  • get_feature_quark_group(): number
  • get_feature_quark_password(): number
  • init_known_interfaces(): void
  • Ensure that the known interfaces for TpChannel have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CHANNEL.

    Returns void

  • Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    • property_name: string

      name of a property to look up.

    Returns ParamSpec

  • Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.

    This function is meant to be called from the interface's default vtable initialization function (the class_init member of #GTypeInfo.) It must not be called after after class_init has been called for any object types implementing this interface.

    If pspec is a floating reference, it will be consumed.

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface.

    • pspec: ParamSpec

      the #GParamSpec for the new property

    Returns void

  • Lists the properties of an interface.Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    Returns ParamSpec[]

  • Convenient function to create a new #TpFileTransferChannel

    Parameters

    • conn: TelepathyGLib.Connection

      a #TpConnection; may not be %NULL

    • object_path: string

      the object path of the channel; may not be %NULL

    • immutable_properties: HashTable<string | number | symbol, string | number | boolean>

      the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to #GValue instances

    Returns FileTransferChannel

  • Parameters

    • conn: TelepathyGLib.Connection

      a connection; may not be %NULL

    • object_path: string

      the object path of the channel; may not be %NULL

    • optional_channel_type: string

      the channel type if already known, or %NULL if not

    • optional_handle_type: HandleType

      the handle type if already known, or %TP_UNKNOWN_HANDLE_TYPE if not

    • optional_handle: number

      the handle if already known, or 0 if not (if optional_handle_type is %TP_UNKNOWN_HANDLE_TYPE or %TP_HANDLE_TYPE_NONE, this must be 0)

    Returns TelepathyGLib.Channel

  • Parameters

    • conn: TelepathyGLib.Connection

      a connection; may not be %NULL

    • object_path: string

      the object path of the channel; may not be %NULL

    • immutable_properties: HashTable<string | number | symbol, string | number | boolean>

      the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to #GValue instances

    Returns TelepathyGLib.Channel

  • Creates a new instance of a #GObject subtype and sets its properties.

    Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    Parameters

    • object_type: GType<unknown>

      the type id of the #GObject subtype to instantiate

    • parameters: GObject.Parameter[]

      an array of #GParameter

    Returns GObject.Object

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method