@react-gnome/gjs-esm-types
Version:
TypeScript module declarations for GJS ESM modules.
2,040 lines (1,982 loc) • 2.24 MB
TypeScript
/*
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/gjsify/ts-for-gjs
*/
import type GObject from "gi://GObject?version=2.0";
import type GLib from "gi://GLib?version=2.0";
declare module "gi://Gio?version=2.0" {
/**
* An enumeration for well-known message buses.
*/
enum BusType {
/**
* An alias for the message bus that activated the process, if any.
*/
STARTER,
/**
* Not a message bus.
*/
NONE,
/**
* The system-wide message bus.
*/
SYSTEM,
/**
* The login session message bus.
*/
SESSION,
}
/**
* Results returned from g_converter_convert().
*/
enum ConverterResult {
/**
* There was an error during conversion.
*/
ERROR,
/**
* Some data was consumed or produced
*/
CONVERTED,
/**
* The conversion is finished
*/
FINISHED,
/**
* Flushing is finished
*/
FLUSHED,
}
/**
* Enumeration describing different kinds of native credential types.
*/
enum CredentialsType {
/**
* Indicates an invalid native credential type.
*/
INVALID,
/**
* The native credentials type is a `struct ucred`.
*/
LINUX_UCRED,
/**
* The native credentials type is a `struct cmsgcred`.
*/
FREEBSD_CMSGCRED,
/**
* The native credentials type is a `struct sockpeercred`. Added in 2.30.
*/
OPENBSD_SOCKPEERCRED,
/**
* The native credentials type is a `ucred_t`. Added in 2.40.
*/
SOLARIS_UCRED,
/**
* The native credentials type is a `struct unpcbid`. Added in 2.42.
*/
NETBSD_UNPCBID,
/**
* The native credentials type is a `struct xucred`. Added in 2.66.
*/
APPLE_XUCRED,
/**
* The native credentials type is a PID `DWORD`. Added in 2.72.
*/
WIN32_PID,
}
/**
* Error codes for the %G_DBUS_ERROR error domain.
*/
enum DBusError {
/**
* A generic error; "something went wrong" - see the error message for
* more.
*/
FAILED,
/**
* There was not enough memory to complete an operation.
*/
NO_MEMORY,
/**
* The bus doesn't know how to launch a service to supply the bus name
* you wanted.
*/
SERVICE_UNKNOWN,
/**
* The bus name you referenced doesn't exist (i.e. no application owns
* it).
*/
NAME_HAS_NO_OWNER,
/**
* No reply to a message expecting one, usually means a timeout occurred.
*/
NO_REPLY,
/**
* Something went wrong reading or writing to a socket, for example.
*/
IO_ERROR,
/**
* A D-Bus bus address was malformed.
*/
BAD_ADDRESS,
/**
* Requested operation isn't supported (like ENOSYS on UNIX).
*/
NOT_SUPPORTED,
/**
* Some limited resource is exhausted.
*/
LIMITS_EXCEEDED,
/**
* Security restrictions don't allow doing what you're trying to do.
*/
ACCESS_DENIED,
/**
* Authentication didn't work.
*/
AUTH_FAILED,
/**
* Unable to connect to server (probably caused by ECONNREFUSED on a
* socket).
*/
NO_SERVER,
/**
* Certain timeout errors, possibly ETIMEDOUT on a socket. Note that
* %G_DBUS_ERROR_NO_REPLY is used for message reply timeouts. Warning:
* this is confusingly-named given that %G_DBUS_ERROR_TIMED_OUT also
* exists. We can't fix it for compatibility reasons so just be
* careful.
*/
TIMEOUT,
/**
* No network access (probably ENETUNREACH on a socket).
*/
NO_NETWORK,
/**
* Can't bind a socket since its address is in use (i.e. EADDRINUSE).
*/
ADDRESS_IN_USE,
/**
* The connection is disconnected and you're trying to use it.
*/
DISCONNECTED,
/**
* Invalid arguments passed to a method call.
*/
INVALID_ARGS,
/**
* Missing file.
*/
FILE_NOT_FOUND,
/**
* Existing file and the operation you're using does not silently overwrite.
*/
FILE_EXISTS,
/**
* Method name you invoked isn't known by the object you invoked it on.
*/
UNKNOWN_METHOD,
/**
* Certain timeout errors, e.g. while starting a service. Warning: this is
* confusingly-named given that %G_DBUS_ERROR_TIMEOUT also exists. We
* can't fix it for compatibility reasons so just be careful.
*/
TIMED_OUT,
/**
* Tried to remove or modify a match rule that didn't exist.
*/
MATCH_RULE_NOT_FOUND,
/**
* The match rule isn't syntactically valid.
*/
MATCH_RULE_INVALID,
/**
* While starting a new process, the exec() call failed.
*/
SPAWN_EXEC_FAILED,
/**
* While starting a new process, the fork() call failed.
*/
SPAWN_FORK_FAILED,
/**
* While starting a new process, the child exited with a status code.
*/
SPAWN_CHILD_EXITED,
/**
* While starting a new process, the child exited on a signal.
*/
SPAWN_CHILD_SIGNALED,
/**
* While starting a new process, something went wrong.
*/
SPAWN_FAILED,
/**
* We failed to setup the environment correctly.
*/
SPAWN_SETUP_FAILED,
/**
* We failed to setup the config parser correctly.
*/
SPAWN_CONFIG_INVALID,
/**
* Bus name was not valid.
*/
SPAWN_SERVICE_INVALID,
/**
* Service file not found in system-services directory.
*/
SPAWN_SERVICE_NOT_FOUND,
/**
* Permissions are incorrect on the setuid helper.
*/
SPAWN_PERMISSIONS_INVALID,
/**
* Service file invalid (Name, User or Exec missing).
*/
SPAWN_FILE_INVALID,
/**
* Tried to get a UNIX process ID and it wasn't available.
*/
SPAWN_NO_MEMORY,
/**
* Tried to get a UNIX process ID and it wasn't available.
*/
UNIX_PROCESS_ID_UNKNOWN,
/**
* A type signature is not valid.
*/
INVALID_SIGNATURE,
/**
* A file contains invalid syntax or is otherwise broken.
*/
INVALID_FILE_CONTENT,
/**
* Asked for SELinux security context and it wasn't available.
*/
SELINUX_SECURITY_CONTEXT_UNKNOWN,
/**
* Asked for ADT audit data and it wasn't available.
*/
ADT_AUDIT_DATA_UNKNOWN,
/**
* There's already an object with the requested object path.
*/
OBJECT_PATH_IN_USE,
/**
* Object you invoked a method on isn't known. Since 2.42
*/
UNKNOWN_OBJECT,
/**
* Interface you invoked a method on isn't known by the object. Since 2.42
*/
UNKNOWN_INTERFACE,
/**
* Property you tried to access isn't known by the object. Since 2.42
*/
UNKNOWN_PROPERTY,
/**
* Property you tried to set is read-only. Since 2.42
*/
PROPERTY_READ_ONLY,
}
/**
* Enumeration used to describe the byte order of a D-Bus message.
*/
enum DBusMessageByteOrder {
/**
* The byte order is big endian.
*/
BIG_ENDIAN,
/**
* The byte order is little endian.
*/
LITTLE_ENDIAN,
}
/**
* Header fields used in #GDBusMessage.
*/
enum DBusMessageHeaderField {
/**
* Not a valid header field.
*/
INVALID,
/**
* The object path.
*/
PATH,
/**
* The interface name.
*/
INTERFACE,
/**
* The method or signal name.
*/
MEMBER,
/**
* The name of the error that occurred.
*/
ERROR_NAME,
/**
* The serial number the message is a reply to.
*/
REPLY_SERIAL,
/**
* The name the message is intended for.
*/
DESTINATION,
/**
* Unique name of the sender of the message (filled in by the bus).
*/
SENDER,
/**
* The signature of the message body.
*/
SIGNATURE,
/**
* The number of UNIX file descriptors that accompany the message.
*/
NUM_UNIX_FDS,
}
/**
* Message types used in #GDBusMessage.
*/
enum DBusMessageType {
/**
* Message is of invalid type.
*/
INVALID,
/**
* Method call.
*/
METHOD_CALL,
/**
* Method reply.
*/
METHOD_RETURN,
/**
* Error reply.
*/
ERROR,
/**
* Signal emission.
*/
SIGNAL,
}
/**
* #GDataStreamByteOrder is used to ensure proper endianness of streaming data sources
* across various machine architectures.
*/
enum DataStreamByteOrder {
/**
* Selects Big Endian byte order.
*/
BIG_ENDIAN,
/**
* Selects Little Endian byte order.
*/
LITTLE_ENDIAN,
/**
* Selects endianness based on host machine's architecture.
*/
HOST_ENDIAN,
}
/**
* #GDataStreamNewlineType is used when checking for or setting the line endings for a given file.
*/
enum DataStreamNewlineType {
/**
* Selects "LF" line endings, common on most modern UNIX platforms.
*/
LF,
/**
* Selects "CR" line endings.
*/
CR,
/**
* Selects "CR, LF" line ending, common on Microsoft Windows.
*/
CR_LF,
/**
* Automatically try to handle any line ending type.
*/
ANY,
}
/**
* Enumeration describing how a drive can be started/stopped.
*/
enum DriveStartStopType {
/**
* Unknown or drive doesn't support
* start/stop.
*/
UNKNOWN,
/**
* The stop method will physically
* shut down the drive and e.g. power down the port the drive is
* attached to.
*/
SHUTDOWN,
/**
* The start/stop methods are used
* for connecting/disconnect to the drive over the network.
*/
NETWORK,
/**
* The start/stop methods will
* assemble/disassemble a virtual drive from several physical
* drives.
*/
MULTIDISK,
/**
* The start/stop methods will
* unlock/lock the disk (for example using the ATA <quote>SECURITY
* UNLOCK DEVICE</quote> command)
*/
PASSWORD,
}
/**
* GEmblemOrigin is used to add information about the origin of the emblem
* to #GEmblem.
*/
enum EmblemOrigin {
/**
* Emblem of unknown origin
*/
UNKNOWN,
/**
* Emblem adds device-specific information
*/
DEVICE,
/**
* Emblem depicts live metadata, such as "readonly"
*/
LIVEMETADATA,
/**
* Emblem comes from a user-defined tag, e.g. set by nautilus (in the future)
*/
TAG,
}
/**
* Used by g_file_set_attributes_from_info() when setting file attributes.
*/
enum FileAttributeStatus {
/**
* Attribute value is unset (empty).
*/
UNSET,
/**
* Attribute value is set.
*/
SET,
/**
* Indicates an error in setting the value.
*/
ERROR_SETTING,
}
/**
* The data types for file attributes.
*/
enum FileAttributeType {
/**
* indicates an invalid or uninitialized type.
*/
INVALID,
/**
* a null terminated UTF8 string.
*/
STRING,
/**
* a zero terminated string of non-zero bytes.
*/
BYTE_STRING,
/**
* a boolean value.
*/
BOOLEAN,
/**
* an unsigned 4-byte/32-bit integer.
*/
UINT32,
/**
* a signed 4-byte/32-bit integer.
*/
INT32,
/**
* an unsigned 8-byte/64-bit integer.
*/
UINT64,
/**
* a signed 8-byte/64-bit integer.
*/
INT64,
/**
* a #GObject.
*/
OBJECT,
/**
* a %NULL terminated char **. Since 2.22
*/
STRINGV,
}
/**
* Specifies what type of event a monitor event is.
*/
enum FileMonitorEvent {
/**
* a file changed.
*/
CHANGED,
/**
* a hint that this was probably the last change in a set of changes.
*/
CHANGES_DONE_HINT,
/**
* a file was deleted.
*/
DELETED,
/**
* a file was created.
*/
CREATED,
/**
* a file attribute was changed.
*/
ATTRIBUTE_CHANGED,
/**
* the file location will soon be unmounted.
*/
PRE_UNMOUNT,
/**
* the file location was unmounted.
*/
UNMOUNTED,
/**
* the file was moved -- only sent if the
* (deprecated) %G_FILE_MONITOR_SEND_MOVED flag is set
*/
MOVED,
/**
* the file was renamed within the
* current directory -- only sent if the %G_FILE_MONITOR_WATCH_MOVES
* flag is set. Since: 2.46.
*/
RENAMED,
/**
* the file was moved into the
* monitored directory from another location -- only sent if the
* %G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.46.
*/
MOVED_IN,
/**
* the file was moved out of the
* monitored directory to another location -- only sent if the
* %G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.46
*/
MOVED_OUT,
}
/**
* Indicates the file's on-disk type.
*
* On Windows systems a file will never have %G_FILE_TYPE_SYMBOLIC_LINK type;
* use #GFileInfo and %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK to determine
* whether a file is a symlink or not. This is due to the fact that NTFS does
* not have a single filesystem object type for symbolic links - it has
* files that symlink to files, and directories that symlink to directories.
* #GFileType enumeration cannot precisely represent this important distinction,
* which is why all Windows symlinks will continue to be reported as
* %G_FILE_TYPE_REGULAR or %G_FILE_TYPE_DIRECTORY.
*/
enum FileType {
/**
* File's type is unknown.
*/
UNKNOWN,
/**
* File handle represents a regular file.
*/
REGULAR,
/**
* File handle represents a directory.
*/
DIRECTORY,
/**
* File handle represents a symbolic link
* (Unix systems).
*/
SYMBOLIC_LINK,
/**
* File is a "special" file, such as a socket, fifo,
* block device, or character device.
*/
SPECIAL,
/**
* File is a shortcut (Windows systems).
*/
SHORTCUT,
/**
* File is a mountable location.
*/
MOUNTABLE,
}
/**
* Indicates a hint from the file system whether files should be
* previewed in a file manager. Returned as the value of the key
* %G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW.
*/
enum FilesystemPreviewType {
/**
* Only preview files if user has explicitly requested it.
*/
IF_ALWAYS,
/**
* Preview files if user has requested preview of "local" files.
*/
IF_LOCAL,
/**
* Never preview files.
*/
NEVER,
}
/**
* Error codes returned by GIO functions.
*
* Note that this domain may be extended in future GLib releases. In
* general, new error codes either only apply to new APIs, or else
* replace %G_IO_ERROR_FAILED in cases that were not explicitly
* distinguished before. You should therefore avoid writing code like
*
* ```c
* if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_FAILED))
* {
* // Assume that this is EPRINTERONFIRE
* ...
* }
* ```
*
* but should instead treat all unrecognized error codes the same as
* %G_IO_ERROR_FAILED.
*
* See also #GPollableReturn for a cheaper way of returning
* %G_IO_ERROR_WOULD_BLOCK to callers without allocating a #GError.
*/
enum IOErrorEnum {
/**
* Generic error condition for when an operation fails
* and no more specific #GIOErrorEnum value is defined.
*/
FAILED,
/**
* File not found.
*/
NOT_FOUND,
/**
* File already exists.
*/
EXISTS,
/**
* File is a directory.
*/
IS_DIRECTORY,
/**
* File is not a directory.
*/
NOT_DIRECTORY,
/**
* File is a directory that isn't empty.
*/
NOT_EMPTY,
/**
* File is not a regular file.
*/
NOT_REGULAR_FILE,
/**
* File is not a symbolic link.
*/
NOT_SYMBOLIC_LINK,
/**
* File cannot be mounted.
*/
NOT_MOUNTABLE_FILE,
/**
* Filename is too many characters.
*/
FILENAME_TOO_LONG,
/**
* Filename is invalid or contains invalid characters.
*/
INVALID_FILENAME,
/**
* File contains too many symbolic links.
*/
TOO_MANY_LINKS,
/**
* No space left on drive.
*/
NO_SPACE,
/**
* Invalid argument.
*/
INVALID_ARGUMENT,
/**
* Permission denied.
*/
PERMISSION_DENIED,
/**
* Operation (or one of its parameters) not supported
*/
NOT_SUPPORTED,
/**
* File isn't mounted.
*/
NOT_MOUNTED,
/**
* File is already mounted.
*/
ALREADY_MOUNTED,
/**
* File was closed.
*/
CLOSED,
/**
* Operation was cancelled. See #GCancellable.
*/
CANCELLED,
/**
* Operations are still pending.
*/
PENDING,
/**
* File is read only.
*/
READ_ONLY,
/**
* Backup couldn't be created.
*/
CANT_CREATE_BACKUP,
/**
* File's Entity Tag was incorrect.
*/
WRONG_ETAG,
/**
* Operation timed out.
*/
TIMED_OUT,
/**
* Operation would be recursive.
*/
WOULD_RECURSE,
/**
* File is busy.
*/
BUSY,
/**
* Operation would block.
*/
WOULD_BLOCK,
/**
* Host couldn't be found (remote operations).
*/
HOST_NOT_FOUND,
/**
* Operation would merge files.
*/
WOULD_MERGE,
/**
* Operation failed and a helper program has
* already interacted with the user. Do not display any error dialog.
*/
FAILED_HANDLED,
/**
* The current process has too many files
* open and can't open any more. Duplicate descriptors do count toward
* this limit. Since 2.20
*/
TOO_MANY_OPEN_FILES,
/**
* The object has not been initialized. Since 2.22
*/
NOT_INITIALIZED,
/**
* The requested address is already in use. Since 2.22
*/
ADDRESS_IN_USE,
/**
* Need more input to finish operation. Since 2.24
*/
PARTIAL_INPUT,
/**
* The input data was invalid. Since 2.24
*/
INVALID_DATA,
/**
* A remote object generated an error that
* doesn't correspond to a locally registered #GError error
* domain. Use g_dbus_error_get_remote_error() to extract the D-Bus
* error name and g_dbus_error_strip_remote_error() to fix up the
* message so it matches what was received on the wire. Since 2.26.
*/
DBUS_ERROR,
/**
* Host unreachable. Since 2.26
*/
HOST_UNREACHABLE,
/**
* Network unreachable. Since 2.26
*/
NETWORK_UNREACHABLE,
/**
* Connection refused. Since 2.26
*/
CONNECTION_REFUSED,
/**
* Connection to proxy server failed. Since 2.26
*/
PROXY_FAILED,
/**
* Proxy authentication failed. Since 2.26
*/
PROXY_AUTH_FAILED,
/**
* Proxy server needs authentication. Since 2.26
*/
PROXY_NEED_AUTH,
/**
* Proxy connection is not allowed by ruleset.
* Since 2.26
*/
PROXY_NOT_ALLOWED,
/**
* Broken pipe. Since 2.36
*/
BROKEN_PIPE,
/**
* Connection closed by peer. Note that this
* is the same code as %G_IO_ERROR_BROKEN_PIPE; before 2.44 some
* "connection closed" errors returned %G_IO_ERROR_BROKEN_PIPE, but others
* returned %G_IO_ERROR_FAILED. Now they should all return the same
* value, which has this more logical name. Since 2.44.
*/
CONNECTION_CLOSED,
/**
* Transport endpoint is not connected. Since 2.44
*/
NOT_CONNECTED,
/**
* Message too large. Since 2.48.
*/
MESSAGE_TOO_LARGE,
/**
* No such device found. Since 2.74
*/
NO_SUCH_DEVICE,
}
/**
* Flags for use with g_io_module_scope_new().
*/
enum IOModuleScopeFlags {
/**
* No module scan flags
*/
NONE,
/**
* When using this scope to load or
* scan modules, automatically block a modules which has the same base
* basename as previously loaded module.
*/
BLOCK_DUPLICATES,
}
/**
* Memory availability warning levels.
*
* Note that because new values might be added, it is recommended that applications check
* #GMemoryMonitorWarningLevel as ranges, for example:
*
* ```c
* if (warning_level > G_MEMORY_MONITOR_WARNING_LEVEL_LOW)
* drop_caches ();
* ```
*
*/
enum MemoryMonitorWarningLevel {
/**
* Memory on the device is low, processes
* should free up unneeded resources (for example, in-memory caches) so they can
* be used elsewhere.
*/
LOW,
/**
* Same as `G_MEMORY_MONITOR_WARNING_LEVEL_LOW`
* but the device has even less free memory, so processes should try harder to free
* up unneeded resources. If your process does not need to stay running, it is a
* good time for it to quit.
*/
MEDIUM,
/**
* The system will soon start terminating
* processes to reclaim memory, including background processes.
*/
CRITICAL,
}
/**
* #GMountOperationResult is returned as a result when a request for
* information is send by the mounting operation.
*/
enum MountOperationResult {
/**
* The request was fulfilled and the
* user specified data is now available
*/
HANDLED,
/**
* The user requested the mount operation
* to be aborted
*/
ABORTED,
/**
* The request was unhandled (i.e. not
* implemented)
*/
UNHANDLED,
}
/**
* The host's network connectivity state, as reported by #GNetworkMonitor.
*/
enum NetworkConnectivity {
/**
* The host is not configured with a
* route to the Internet; it may or may not be connected to a local
* network.
*/
LOCAL,
/**
* The host is connected to a network, but
* does not appear to be able to reach the full Internet, perhaps
* due to upstream network problems.
*/
LIMITED,
/**
* The host is behind a captive portal and
* cannot reach the full Internet.
*/
PORTAL,
/**
* The host is connected to a network, and
* appears to be able to reach the full Internet.
*/
FULL,
}
/**
* Priority levels for #GNotifications.
*/
enum NotificationPriority {
/**
* the default priority, to be used for the
* majority of notifications (for example email messages, software updates,
* completed download/sync operations)
*/
NORMAL,
/**
* for notifications that do not require
* immediate attention - typically used for contextual background
* information, such as contact birthdays or local weather
*/
LOW,
/**
* for events that require more attention,
* usually because responses are time-sensitive (for example chat and SMS
* messages or alarms)
*/
HIGH,
/**
* for urgent notifications, or notifications
* that require a response in a short space of time (for example phone calls
* or emergency warnings)
*/
URGENT,
}
/**
* #GPasswordSave is used to indicate the lifespan of a saved password.
*
* #Gvfs stores passwords in the Gnome keyring when this flag allows it
* to, and later retrieves it again from there.
*/
enum PasswordSave {
/**
* never save a password.
*/
NEVER,
/**
* save a password for the session.
*/
FOR_SESSION,
/**
* save a password permanently.
*/
PERMANENTLY,
}
/**
* Return value for various IO operations that signal errors via the
* return value and not necessarily via a #GError.
*
* This enum exists to be able to return errors to callers without having to
* allocate a #GError. Allocating #GErrors can be quite expensive for
* regularly happening errors like %G_IO_ERROR_WOULD_BLOCK.
*
* In case of %G_POLLABLE_RETURN_FAILED a #GError should be set for the
* operation to give details about the error that happened.
*/
enum PollableReturn {
/**
* Generic error condition for when an operation fails.
*/
FAILED,
/**
* The operation was successfully finished.
*/
OK,
/**
* The operation would block.
*/
WOULD_BLOCK,
}
/**
* An error code used with %G_RESOLVER_ERROR in a #GError returned
* from a #GResolver routine.
*/
enum ResolverError {
/**
* the requested name/address/service was not
* found
*/
NOT_FOUND,
/**
* the requested information could not
* be looked up due to a network error or similar problem
*/
TEMPORARY_FAILURE,
/**
* unknown error
*/
INTERNAL,
}
/**
* The type of record that g_resolver_lookup_records() or
* g_resolver_lookup_records_async() should retrieve. The records are returned
* as lists of #GVariant tuples. Each record type has different values in
* the variant tuples returned.
*
* %G_RESOLVER_RECORD_SRV records are returned as variants with the signature
* `(qqqs)`, containing a `guint16` with the priority, a `guint16` with the
* weight, a `guint16` with the port, and a string of the hostname.
*
* %G_RESOLVER_RECORD_MX records are returned as variants with the signature
* `(qs)`, representing a `guint16` with the preference, and a string containing
* the mail exchanger hostname.
*
* %G_RESOLVER_RECORD_TXT records are returned as variants with the signature
* `(as)`, representing an array of the strings in the text record. Note: Most TXT
* records only contain a single string, but
* [RFC 1035](https://tools.ietf.org/html/rfc1035#section-3.3.14) does allow a
* record to contain multiple strings. The RFC which defines the interpretation
* of a specific TXT record will likely require concatenation of multiple
* strings if they are present, as with
* [RFC 7208](https://tools.ietf.org/html/rfc7208#section-3.3).
*
* %G_RESOLVER_RECORD_SOA records are returned as variants with the signature
* `(ssuuuuu)`, representing a string containing the primary name server, a
* string containing the administrator, the serial as a `guint32`, the refresh
* interval as a `guint32`, the retry interval as a `guint32`, the expire timeout
* as a `guint32`, and the TTL as a `guint32`.
*
* %G_RESOLVER_RECORD_NS records are returned as variants with the signature
* `(s)`, representing a string of the hostname of the name server.
*/
enum ResolverRecordType {
/**
* look up DNS SRV records for a domain
*/
SRV,
/**
* look up DNS MX records for a domain
*/
MX,
/**
* look up DNS TXT records for a name
*/
TXT,
/**
* look up DNS SOA records for a zone
*/
SOA,
/**
* look up DNS NS records for a domain
*/
NS,
}
/**
* An error code used with %G_RESOURCE_ERROR in a #GError returned
* from a #GResource routine.
*/
enum ResourceError {
/**
* no file was found at the requested path
*/
NOT_FOUND,
/**
* unknown error
*/
INTERNAL,
}
/**
* Describes an event occurring on a #GSocketClient. See the
* #GSocketClient::event signal for more details.
*
* Additional values may be added to this type in the future.
*/
enum SocketClientEvent {
/**
* The client is doing a DNS lookup.
*/
RESOLVING,
/**
* The client has completed a DNS lookup.
*/
RESOLVED,
/**
* The client is connecting to a remote
* host (either a proxy or the destination server).
*/
CONNECTING,
/**
* The client has connected to a remote
* host.
*/
CONNECTED,
/**
* The client is negotiating
* with a proxy to connect to the destination server.
*/
PROXY_NEGOTIATING,
/**
* The client has negotiated
* with the proxy server.
*/
PROXY_NEGOTIATED,
/**
* The client is performing a
* TLS handshake.
*/
TLS_HANDSHAKING,
/**
* The client has performed a
* TLS handshake.
*/
TLS_HANDSHAKED,
/**
* The client is done with a particular
* #GSocketConnectable.
*/
COMPLETE,
}
/**
* The protocol family of a #GSocketAddress. (These values are
* identical to the system defines %AF_INET, %AF_INET6 and %AF_UNIX,
* if available.)
*/
enum SocketFamily {
/**
* no address family
*/
INVALID,
/**
* the UNIX domain family
*/
UNIX,
/**
* the IPv4 family
*/
IPV4,
/**
* the IPv6 family
*/
IPV6,
}
/**
* Describes an event occurring on a #GSocketListener. See the
* #GSocketListener::event signal for more details.
*
* Additional values may be added to this type in the future.
*/
enum SocketListenerEvent {
/**
* The listener is about to bind a socket.
*/
BINDING,
/**
* The listener has bound a socket.
*/
BOUND,
/**
* The listener is about to start
* listening on this socket.
*/
LISTENING,
/**
* The listener is now listening on
* this socket.
*/
LISTENED,
}
/**
* A protocol identifier is specified when creating a #GSocket, which is a
* family/type specific identifier, where 0 means the default protocol for
* the particular family/type.
*
* This enum contains a set of commonly available and used protocols. You
* can also pass any other identifiers handled by the platform in order to
* use protocols not listed here.
*/
enum SocketProtocol {
/**
* The protocol type is unknown
*/
UNKNOWN,
/**
* The default protocol for the family/type
*/
DEFAULT,
/**
* TCP over IP
*/
TCP,
/**
* UDP over IP
*/
UDP,
/**
* SCTP over IP
*/
SCTP,
}
/**
* Flags used when creating a #GSocket. Some protocols may not implement
* all the socket types.
*/
enum SocketType {
/**
* Type unknown or wrong
*/
INVALID,
/**
* Reliable connection-based byte streams (e.g. TCP).
*/
STREAM,
/**
* Connectionless, unreliable datagram passing.
* (e.g. UDP)
*/
DATAGRAM,
/**
* Reliable connection-based passing of datagrams
* of fixed maximum length (e.g. SCTP).
*/
SEQPACKET,
}
/**
* The client authentication mode for a #GTlsServerConnection.
*/
enum TlsAuthenticationMode {
/**
* client authentication not required
*/
NONE,
/**
* client authentication is requested
*/
REQUESTED,
/**
* client authentication is required
*/
REQUIRED,
}
/**
* Flags for g_tls_interaction_request_certificate(),
* g_tls_interaction_request_certificate_async(), and
* g_tls_interaction_invoke_request_certificate().
*/
enum TlsCertificateRequestFlags {
/**
* No flags
*/
NONE,
}
/**
* An error code used with %G_TLS_CHANNEL_BINDING_ERROR in a #GError to
* indicate a TLS channel binding retrieval error.
*/
enum TlsChannelBindingError {
/**
* Either entire binding
* retrieval facility or specific binding type is not implemented in the
* TLS backend.
*/
NOT_IMPLEMENTED,
/**
* The handshake is not yet
* complete on the connection which is a strong requirement for any existing
* binding type.
*/
INVALID_STATE,
/**
* Handshake is complete but
* binding data is not available. That normally indicates the TLS
* implementation failed to provide the binding data. For example, some
* implementations do not provide a peer certificate for resumed connections.
*/
NOT_AVAILABLE,
/**
* Binding type is not supported
* on the current connection. This error could be triggered when requesting
* `tls-server-end-point` binding data for a certificate which has no hash
* function or uses multiple hash functions.
*/
NOT_SUPPORTED,
/**
* Any other backend error
* preventing binding data retrieval.
*/
GENERAL_ERROR,
}
/**
* The type of TLS channel binding data to retrieve from #GTlsConnection
* or #GDtlsConnection, as documented by RFC 5929 or RFC 9266. The
* [`tls-unique-for-telnet`](https://tools.ietf.org/html/rfc5929#section-5)
* binding type is not currently implemented.
*/
enum TlsChannelBindingType {
/**
* [`tls-unique`](https://tools.ietf.org/html/rfc5929#section-3) binding
* type
*/
UNIQUE,
/**
* [`tls-server-end-point`](https://tools.ietf.org/html/rfc5929#section-4)
* binding type
*/
SERVER_END_POINT,
/**
* [`tls-exporter`](https://www.rfc-editor.org/rfc/rfc9266.html) binding
* type. Since: 2.74
*/
EXPORTER,
}
/**
* Flags for g_tls_database_lookup_certificate_for_handle(),
* g_tls_database_lookup_certificate_issuer(),
* and g_tls_database_lookup_certificates_issued_by().
*/
enum TlsDatabaseLookupFlags {
/**
* No lookup flags
*/
NONE,
/**
* Restrict lookup to certificates that have
* a private key.
*/
KEYPAIR,
}
/**
* An error code used with %G_TLS_ERROR in a #GError returned from a
* TLS-related routine.
*/
enum TlsError {
/**
* No TLS provider is available
*/
UNAVAILABLE,
/**
* Miscellaneous TLS error
*/
MISC,
/**
* The certificate presented could not
* be parsed or failed validation.
*/
BAD_CERTIFICATE,
/**
* The TLS handshake failed because the
* peer does not seem to be a TLS server.
*/
NOT_TLS,
/**
* The TLS handshake failed because the
* peer's certificate was not acceptable.
*/
HANDSHAKE,
/**
* The TLS handshake failed because
* the server requested a client-side certificate, but none was
* provided. See g_tls_connection_set_certificate().
*/
CERTIFICATE_REQUIRED,
/**
* The TLS connection was closed without proper
* notice, which may indicate an attack. See
* g_tls_connection_set_require_close_notify().
*/
EOF,
/**
* The TLS handshake failed
* because the client sent the fallback SCSV, indicating a protocol
* downgrade attack. Since: 2.60
*/
INAPPROPRIATE_FALLBACK,
/**
* The certificate failed
* to load because a password was incorrect. Since: 2.72
*/
BAD_CERTIFICATE_PASSWORD,
}
/**
* #GTlsInteractionResult is returned by various functions in #GTlsInteraction
* when finishing an interaction request.
*/
enum TlsInteractionResult {
/**
* The interaction was unhandled (i.e. not
* implemented).
*/
UNHANDLED,
/**
* The interaction completed, and resulting data
* is available.
*/
HANDLED,
/**
* The interaction has failed, or was cancelled.
* and the operation should be aborted.
*/
FAILED,
}
/**
* The TLS or DTLS protocol version used by a #GTlsConnection or
* #GDtlsConnection. The integer values of these versions are sequential
* to ensure newer known protocol versions compare greater than older
* known versions. Any known DTLS protocol version will compare greater
* than any SSL or TLS protocol version. The protocol version may be
* %G_TLS_PROTOCOL_VERSION_UNKNOWN if the TLS backend supports a newer
* protocol version that GLib does not yet know about. This means that
* it's possible for an unknown DTLS protocol version to compare less
* than the TLS protocol versions.
*/
enum TlsProtocolVersion {
/**
* No protocol version or unknown protocol version
*/
UNKNOWN,
/**
* SSL 3.0, which is insecure and should not be used
*/
SSL_3_0,
/**
* TLS 1.0, which is insecure and should not be used
*/
TLS_1_0,
/**
* TLS 1.1, which is insecure and should not be used
*/
TLS_1_1,
/**
* TLS 1.2, defined by [RFC 5246](https://datatracker.ietf.org/doc/html/rfc5246)
*/
TLS_1_2,
/**
* TLS 1.3, defined by [RFC 8446](https://datatracker.ietf.org/doc/html/rfc8446)
*/
TLS_1_3,
/**
* DTLS 1.0, which is insecure and should not be used
*/
DTLS_1_0,
/**
* DTLS 1.2, defined by [RFC 6347](https://datatracker.ietf.org/doc/html/rfc6347)
*/
DTLS_1_2,
}
/**
* When to allow rehandshaking. See
* g_tls_connection_set_rehandshake_mode().
*/
enum TlsRehandshakeMode {
/**
* Never allow rehandshaking
*/
NEVER,
/**
* Allow safe rehandshaking only
*/
SAFELY,
/**
* Allow unsafe rehandshaking
*/
UNSAFELY,
}
/**
* The type of name used by a #GUnixSocketAddress.
* %G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain
* socket bound to a filesystem path. %G_UNIX_SOCKET_ADDRESS_ANONYMOUS
* indicates a socket not bound to any name (eg, a client-side socket,
* or a socket created with socketpair()).
*
* For abstract sockets, there are two incompatible ways of naming
* them; the man pages suggest using the entire `struct sockaddr_un`
* as the name, padding the unused parts of the %sun_path field with
* zeroes; this corresponds to %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED.
* However, many programs instead just use a portion of %sun_path, and
* pass an appropriate smaller length to bind() or connect(). This is
* %G_UNIX_SOCKET_ADDRESS_ABSTRACT.
*/
enum UnixSocketAddressType {
/**
* invalid
*/
INVALID,
/**
* anonymous
*/
ANONYMOUS,
/**
* a filesystem path
*/
PATH,
/**
* an abstract name
*/
ABSTRACT,
/**
* an abstract name, 0-padded
* to the full length of a unix socket name
*/
ABSTRACT_PADDED,
}
/**
* Used to select the type of data format to use for #GZlibDecompressor
* and #GZlibCompressor.
*/
enum ZlibCompressorFormat {
/**
* deflate compression with zlib header
*/
ZLIB,
/**
* gzip file format
*/
GZIP,
/**
* deflate compression with no header
*/
RAW,
}
/**
* Flags used when creating a #GAppInfo.
* @bitfield
*/
enum AppInfoCreateFlags {
/**
* No flags.
*/
NONE,
/**
* Application opens in a terminal window.
*/
NEEDS_TERMINAL,
/**
* Application supports URI arguments.
*/
SUPPORTS_URIS,
/**
* Application supports startup notification. Since 2.26
*/
SUPPORTS_STARTUP_NOTIFICATION,
}
/**
* Flags used to define the behaviour of a #GApplication.
* @bitfield
*/
enum ApplicationFlags {
/**
* Default. Deprecated in 2.74, use
* %G_APPLICATION_DEFAULT_FLAGS instead
*/
FLAGS_NONE,
/**
* Default flags. Since: 2.74
*/
DEFAULT_FLAGS,
/**
* Run as a service. In this mode, registration
* fails if the service is already running, and the application
* will initially wait up to 10 seconds for an initial activation
* message to arrive.
*/
IS_SERVICE,
/**
* Don't try to become the primary instance.
*/
IS_LAUNCHER,
/**
* This application handles opening files (in
* the primary instance). Note that this flag only affects the default
* implementation of local_command_line(), and has no effect if
* %G_APPLICATION_HANDLES_COMMAND_LINE is given.
* See g_application_run() for details.
*/
HANDLES_OPEN,
/**
* This application handles command line
* arguments (in the primary instance). Note that this flag only affect
* the default implementation of local_command_line().
* See g_application_run() for details.
*/
HANDLES_COMMAND_LINE,
/**
* Send the environment of the
* launching process to the primary instance. Set this flag if your
* application is expected to behave differently depending on certain
* environment variables. For instance, an editor might be expected
* to use the `GIT_COMMITTER_NAME` environment variable
* when editing a git commit message. The environment is available
* to the #GApplication::command-line signal handler, via
* g_application_command_line_getenv().
*/
SEND_ENVIRONMENT,
/**
* Make no attempts to do any of the typical
* single-instance application negotiation, even if the application
* ID is given. The application neither attempts to become the
* owner of the application ID nor does it check if an existing
* owner already exists. Everything occurs in the local process.
* Since: 2.30.
*/
NON_UNIQUE,
/**
* Allow users to override the
* application ID from the command line with `--gapplication-app-id`.
* Since: 2.48
*/
CAN_OVERRIDE_APP_ID,
/**
* Allow another instance to take over
* the bus name. Since: 2.60
*/
ALLOW_REPLACEMENT,
/**
* Take over from another instance. This flag is
* usually set by passing `--gapplication-replace` on the commandline.
* Since: 2.60
*/
REPLACE,
}
/**
* #GAskPasswordFlags are used to request specific information from the
* user, or to notify the user of their choices in an authentication
* situation.
* @bitfield
*/
enum AskPasswordFlags {
/**
* operation requires a password.
*/
NEED_PASSWORD,
/**
* operation requires a username.
*/
NEED_USERNAME,
/**
* operation requires a domain.
*/
NEED_DOMAIN,
/**
* operation supports saving settings.
*/
SAVING_SUPPORTED,
/**
* operation supports anonymous users.
*/
ANONYMOUS_SUPPORTED,
/**
* operation takes TCRYPT parameters (Since: 2.58)
*/
TCRYPT,
}
/**
* Flags used in g_bus_own_name().
* @bitfield
*/
enum BusNameOwnerFlags {
/**
* No flags set.
*/
NONE,
/**
* Allow another message bus connection to claim the name.
*/
ALLOW_REPLACEMENT,
/**
* If another message bus connection owns the name and have
* specified %G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, then take the name from the other connection.
*/
REPLACE,
/**
* If another message bus connection owns the name, immediately
* return an error from g_bus_own_name() rather than entering the waiting queue for that name. (Since 2.54)
*/
DO_NOT_QUEUE,
}
/**
* Flags used in g_bus_watch_name().
* @bitfield
*/
enum BusNameWatcherFlags {
/**
* No flags set.
*/
NONE,
/**
* If no-one owns the name when
* beginning to watch the name, ask the bus to launch an owner for the
* name.
*/
AUTO_START,
}
/**
* Flags used when calling a g_converter_convert().
* @bitfield
*/
enum ConverterFlags {
/**
* No flags.
*/
NONE,
/**
* At end of input data
*/
INPUT_AT_END,
/**
* Flush data
*/
FLUSH,
}
/**
* Flags used in g_dbus_connection_call() and similar APIs.
* @bitfield
*/
enum DBusCallFlags {
/**
* No flags set.
*/
NONE,
/**
* The bus must not launch
* an owner for the destination name in response to this method
* invocation.
*/
NO_AUTO_START,
/**
* the caller is prepared to
* wait for interactive authorization. Since 2.46.
*/
ALLOW_INTERACTIVE_AUTHORIZATION,
}
/**
* Capabilities negotiated with the remote peer.
* @bitfield
*/
enum DBusCapabilityFlags {
/**
* No flags set.
*/
NONE,
/**
* The connection
* supports exchanging UNIX file descriptors with the remote peer.
*/
UNIX_FD_PASSING,
}
/**
* Flags used when creating a new #GDBusConnection.
* @bitfield
*/
enum DBusConnectionFlags {
/**
* No flags set.
*/
NONE,
/**
* Perform authentication against server.
*/
AUTHENTICATION_CLIENT,
/**
* Perform authentication against client.
*/
AUTHENTICATION_SERVER,
/**
* When
* authenticating as a server, allow the anonymous authentication
* method.
*/
AUTHENTICATION_ALLOW_ANONYMOUS,
/**
* Pass this flag if connecting to a peer that is a
* message bus. This means that the Hello() method will be invoked as part of the connection setup.
*/
MESSAGE_BUS_CONNECTION,
/**
* If set, processing of D-Bus messages is
* delayed until g_dbus_connection_start_message_processing() is called.
*/
DELAY_MESSAGE_PROCESSING,
/**
* When authenticating
* as a server, require the UID of the peer to be the same as the UID of the server. (Since: 2.68)
*/
AUTHENTICATION_REQUIRE_SAME_USER,
/**
* When authenticating, try to use
* protocols that work across a Linux user namespace boundary, even if this
* reduces interoperability with older D-Bus implementations. This currently
* affects client-side `EXTERNAL` authentication, for which this flag makes
* connections to a server in another user namespace succeed, but causes
* a deadlock when connecting to a GDBus server older than 2.73.3. Since: 2.74
*/
CROSS_NAMESPACE,
}
/**
* Flags describing the behavior of a #GDBusInterfaceSkeleton instance.
* @bitfield
*/
enum DBusInterfaceSkeletonFlags {
/**
* No flags set.
*/
NONE,
/**
* Each method invocation is handled in
* a thread dedicated to the invocation. This means that the method implementation can use blocking IO
* without blocking any other part of the process. It also means that the method implementation must
* use locking to access data structures used by other threads.
*/
HANDLE_METHOD_INVOCATIONS_IN_THREAD,
}
/**
* Message flags used in #GDBusMessage.
* @bitfield
*/
enum DBusMessageFlags {
/**
* No flags set.
*/
NONE,
/**
* A reply is not expected.
*/
NO_REPLY_EXPECTED,
/**
* The bus must not launch an
* owner for the destination name in response to this message.
*/
NO_AUTO_START,
/**
* If set on a method
* call, this flag means that the caller is prepared to wait for interactive
* authorization. Since 2.46.
*/
ALLOW_INTERACTIVE_AUTHORIZATION,
}
/**
* Flags used when constructing a #GDBusObjectManagerClient.
* @bitfield
*/
enum DBusObjectManagerClientFlags {
/**
* No flags set.
*/
NONE,
/**
* If not set and the
* manager is for a well-known name, then request the bus to launch
* an owner for the name if no-one owns the name. This flag can only
* be used in managers for well-known names.
*/
DO_NOT_AUTO_START,
}
/**
* Flags describing the access control of a D-Bus property.
* @bitfield
*/
enum DBusPropertyInfoFlags {
/**
* No flags set.
*/
NONE,
/**
* Property is readable.
*/
READABLE,
/**
* Property is writable.
*/
WRITABLE,
}
/**
* Flags used when constructing an instance of a #GDBusProxy derived class.
* @bitfield
*/
enum DBusProxyFlags {
/**
* No flags set.
*/
NONE,
/**
* Don't load properties.
*/
DO_NOT_LOAD_PROPERTIES,
/**
* Don't connect to signals on the remote object.
*/
DO_NOT_CONNECT_SIGNALS,
/**
* If the proxy is for a well-known name,
* do not ask the bus to launch an owner during proxy initialization or a method call.
* This flag is only meaningful in proxies for well-known names.
*/
DO_NOT_AUTO_START,
/**
* If set, the property value for any __invalidated property__ will be (asynchronously) retrieved upon receiving the [`PropertiesChanged`](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties) D-Bus signal and the property will not cause emission of the #GDBusProxy::g-properties-changed signal. When the value is received the #GDBusProxy::g-properties-changed signal is emitted for the property along with the retrieved value. Since 2.32.
*/
GET_INVALIDATED_PROPERTIES,
/**
* If the proxy is for a well-known name,
* do not ask the bus to launch an owner during proxy initialization, but allow it to be
* autostarted by a method call. This flag is only meaningful in proxies for well-known names,
* and only if %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is not also specified.
*/
DO_NOT_AUTO_START_AT_CONSTRUCTION,
/**
* Don't actually send the AddMatch D-Bus
* call for this signal subscription. This gives you more control
* over which match rules you add (but you must add them manually). (Since: 2.72)
*/
NO_MATCH_RULE,
}
/**
* Flags used when sending #GDBusMessages on a #GDBusConnection.
* @bitfield
*/
enum DBusSendMessageFlags {
/**
* No flags set.
*