Completion

class Completion(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null) : ProxyInstance

GCompletion provides support for automatic completion of a string using any group of target strings. It is typically used for file name completion as is common in many UNIX shells.

A GCompletion is created using func@GLib.Completion.new. Target items are added and removed with method@GLib.Completion.add_items, method@GLib.Completion.remove_items and method@GLib.Completion.clear_items. A completion attempt is requested with method@GLib.Completion.complete or method@GLib.Completion.complete_utf8. When no longer needed, the GCompletion is freed with method@GLib.Completion.free.

Items in the completion can be simple strings (e.g. filenames), or pointers to arbitrary data structures. If data structures are used you must provide a type@GLib.CompletionFunc in func@GLib.Completion.new, which retrieves the item’s string from the data structure. You can change the way in which strings are compared by setting a different type@GLib.CompletionStrncmpFunc in method@GLib.Completion.set_compare.

GCompletion has been marked as deprecated, since this API is rarely used and not very actively maintained.

Skipped during bindings generation

  • parameter new_prefix: Unsupported string with cType gchar**

  • parameter new_prefix: Unsupported string with cType gchar**

  • parameter strncmp_func: CompletionStrncmpFunc

  • parameter func: CompletionFunc

  • field func: CompletionFunc

  • field strncmp_func: CompletionStrncmpFunc

Constructors

Link copied to clipboard
constructor()

Allocate a new Completion.

constructor(scope: <Error class: unknown class>)

Allocate a new Completion using the provided AutofreeScope.

constructor(items: List?, prefix: String?, cache: List?)

Allocate a new Completion.

constructor(items: List?, prefix: String?, cache: List?, scope: <Error class: unknown class>)

Allocate a new Completion using the provided AutofreeScope.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

Properties

Link copied to clipboard
var cache: List?

the list of items which begin with @prefix.

Link copied to clipboard
val glibCompletionPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val handle: <Error class: unknown class>?
Link copied to clipboard
var items: List?

list of target items (strings or data structures).

Link copied to clipboard

the last prefix passed to g_completion_complete() or g_completion_complete_utf8().

Functions

Link copied to clipboard
fun addItems(items: List)

Adds items to the #GCompletion.

Link copied to clipboard

Removes all items from the #GCompletion. The items are not freed, so if the memory was dynamically allocated, it should be freed after calling this function.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compare two proxy instances for equality. This will compare both the type of the instances, and their memory addresses.

Link copied to clipboard
fun free()

Frees all memory used by the #GCompletion. The items are not freed, so if the memory was dynamically allocated, it should be freed after calling this function.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun removeItems(items: List)

Removes items from a #GCompletion. The items are not freed, so if the memory was dynamically allocated, free @items with g_list_free_full() after calling this function.

Link copied to clipboard
open override fun toString(): String