A proxy for the GPaste daemon's D-Bus interface.
Every method comes in a synchronous flavor and an async pair, and both report failures the same way, in one of two kinds of domain:
- g_paste_error for a request the daemon understood and refused, e.g.
g_paste_error_not_found for an unknown uuid. The daemon registers the domain with
register_error_domain, so the code survives the
round-trip and callers can switch on it instead of matching on the message.
- g_dbus_error or g_io_error for a failure of the transport itself:
no daemon on the bus, it went away mid-call, the call was cancelled. These say nothing about the request.
A caller that wants to tell "the daemon said no" from "the daemon is not there" should therefore check the domain with
matches, not the bare code: the numbering of the two overlaps.
A call carrying a string that is not UTF-8, which is all D-Bus carries -- a file name in another encoding, a relative one joined to a
working directory named in one -- fails with g_io_error_invalid_data without being sent.
- public async string add_file (string file, Cancellable? cancellable) throws Error
Add the file contents to the GPasteDaemon
- public string add_file_sync (string file) throws Error
Add the file contents to the GPasteDaemon
- public async string add_password (string name, string password, uint timeout, Cancellable? cancellable) throws Error
Add the password to the GPasteDaemon
- public string add_password_sync (string name, string password, uint timeout) throws Error
Add the password to the GPasteDaemon
- public async string add_text (string text, Cancellable? cancellable) throws Error
Add an item to the GPasteDaemon
- public string add_text_sync (string text) throws Error
Add an item to the GPasteDaemon
- public async void backup_history (string history, string backup, Cancellable? cancellable) throws Error
Backup the current history
- public void backup_history_sync (string history, string backup) throws Error
Backup the current history
- public async void change_passphrase (Cancellable? cancellable) throws Error
Change the passphrase of the encrypted history, re-encrypting it with
the new one.
- public void change_passphrase_sync () throws Error
Change the passphrase of the encrypted history, re-encrypting it with
the new one.
- public async void delete_history (string name, Cancellable? cancellable) throws Error
Delete a history
- public void delete_history_sync (string name) throws Error
Delete a history
- public async void delete_item (string uuid, Cancellable? cancellable) throws Error
Delete an item from the GPasteDaemon
- public void delete_item_sync (string uuid) throws Error
Delete an item from the GPasteDaemon
- public async void delete_password (string name, Cancellable? cancellable) throws Error
Delete the password from the GPasteDaemon
- public void delete_password_sync (string name) throws Error
Delete the password from the GPasteDaemon
- public async string[] doctor (Cancellable? cancellable, out bool healthy) throws Error
- public string[] doctor_sync (out bool healthy) throws Error
Have the daemon check its store and put right what it can: the history
folder restricted to its owner, every history read, and the histories left under another passphrase encrypted with the one the
history in use takes.
- public async void empty_history (string name, Cancellable? cancellable) throws Error
Empty the history from the GPasteDaemon
- public void empty_history_sync (string name) throws Error
Empty the history from the GPasteDaemon
- public void follow_daemon (bool activate)
Keep looking for the daemon whenever there is none
- public DaemonPresence get_daemon_presence ()
Get whether there is a daemon to talk to
- public async List<ClientItem> get_favourites (Cancellable? cancellable) throws Error
Get the pinned items from the GPasteDaemon
- public List<ClientItem> get_favourites_sync () throws Error
Get the pinned items from the GPasteDaemon
- public async List<ClientItem> get_history (Cancellable? cancellable) throws Error
Get the history from the GPasteDaemon
- public string? get_history_name ()
Get the name of the history currently in use.
- public async uint64 get_history_size (Cancellable? cancellable) throws Error
Get the size of the current history from the GPasteDaemon
- public uint64 get_history_size_sync () throws Error
Get the size of the current history from the GPasteDaemon
.
- public List<ClientItem> get_history_sync () throws Error
Get the history from the GPasteDaemon
- public async Bytes get_image (string uuid, Cancellable? cancellable) throws Error
Get an image item's bytes from the GPasteDaemon
- public Bytes get_image_sync (string uuid) throws Error
Get an image item's bytes from the GPasteDaemon, so
clients never have to dereference the item's path themselves
- public async ClientItem get_item (string uuid, Cancellable? cancellable) throws Error
Get an item from the GPasteDaemon
- public async ClientItem get_item_at_index (uint64 index, Cancellable? cancellable) throws Error
Get an item from the GPasteDaemon
- public ClientItem get_item_at_index_sync (uint64 index) throws Error
Get an item from the GPasteDaemon
- public ClientItem get_item_sync (string uuid) throws Error
Get an item from the GPasteDaemon
- public async List<ClientItem> get_items (string[] uuids, Cancellable? cancellable) throws Error
Get some items from the GPasteDaemon
- public List<ClientItem> get_items_sync (string[] uuids) throws Error
Get some items from the GPasteDaemon
- public async uint get_password_timeout (string uuid, Cancellable? cancellable) throws Error
Get how long a password item may stay on the clipboard, in seconds
- public uint get_password_timeout_sync (string uuid) throws Error
Get how long a password item may stay on the clipboard, in seconds, 0
for one that stays as long as anything else does
- public async string[] get_uris (string uuid, Cancellable? cancellable) throws Error
Get the uris a uris item holds from the GPasteDaemon
- public string[] get_uris_sync (string uuid) throws Error
Get the uris a uris item holds from the GPasteDaemon, as
the array a client acting on the files wants rather than the one newline-joined string the item's own value is
- public string? get_version ()
Get the version of the running gpaste daemon
- public bool is_active ()
Check if the daemon is active
- public async List<ClientHistory> list_histories (Cancellable? cancellable) throws Error
List all available histories, each with how many items it holds
- public List<ClientHistory> list_histories_sync () throws Error
List all available histories, each with how many items it holds: a
view drawing the sizes beside the names needs no call of its own per history.
- public async string make_password (string uuid, string name, uint timeout, Cancellable? cancellable) throws Error
Turn a text item into a password item, or write a password's name and
timeout
- public string make_password_sync (string uuid, string name, uint timeout) throws Error
Turn a text item into a password item, or write a password's name and
timeout
- public async string merge (string? decoration, string? separator, string[] uuids, Cancellable? cancellable) throws Error
Merge some history entries
- public string merge_sync (string? decoration, string? separator, string[] uuids) throws Error
Merge some history entries
- public async void reexecute (Cancellable? cancellable) throws Error
Reexecute the GPasteDaemon
- public void reexecute_sync () throws Error
Reexecute the GPasteDaemon
- public async string replace (string uuid, string contents, Cancellable? cancellable) throws Error
Replace the contents of an item
- public string replace_sync (string uuid, string contents) throws Error
Replace the contents of an item
- public async void report_extension_state (bool state, Cancellable? cancellable) throws Error
Call this when the extension changes its state
- public void report_extension_state_sync (bool state) throws Error
Call this when the extension changes its state
- public void retry_daemon ()
Ask for a daemon now, starting one if there is none, and wait for it
from the start again -- for the user asking, which is the one case where starting a daemon is not going behind their back
- public async List<ClientItem> search (string pattern, Cancellable? cancellable) throws Error
Search for items matching pattern in history
- public List<ClientItem> search_sync (string pattern) throws Error
Search for items matching pattern in history
- public async void select (string uuid, Cancellable? cancellable) throws Error
Select an item from the GPasteDaemon
- public void select_sync (string uuid) throws Error
Select an item from the GPasteDaemon
- public async void set_active (bool state, Cancellable? cancellable) throws Error
Change the tracking state of the GPasteDaemon
- public void set_active_sync (bool state) throws Error
Change the tracking state of the GPasteDaemon.
- public async void set_favourite (string uuid, bool favourite, Cancellable? cancellable) throws Error
Pin an item, exempting it from the history's size and memory caps, or
let it go again
- public void set_favourite_sync (string uuid, bool favourite) throws Error
Pin an item, exempting it from the history's size and memory caps, or
let it go again
- public async void show_history_async (Cancellable? cancellable) throws Error
Emit the ShowHistory signal
- public void show_history_sync () throws Error
Emit the ShowHistory signal
- public async void strip_rich_text (string uuid, Cancellable? cancellable) throws Error
Drop the rich text flavours of an item, keeping the plain text it
shows
- public void strip_rich_text_sync (string uuid) throws Error
Drop the rich text flavours of an item, keeping the plain text it
shows
- public async void switch_history (string name, Cancellable? cancellable) throws Error
Switch to another history
- public void switch_history_sync (string name) throws Error
Switch to another history
- public void unfollow_daemon ()
Stop looking for the daemon, for a caller going away while something
else may still hold this
- public async string upload (string uuid, Cancellable? cancellable) throws Error
Upload an item to a pastebin service, and answer where it landed.
- public async string upload_and_copy (string uuid, Cancellable? cancellable) throws Error
Upload an item to a pastebin service, then have the daemon put the
address it answers where the user can paste it: see
upload_and_copy_sync.
- public string upload_and_copy_sync (string uuid) throws Error
Upload an item to a pastebin service, then have the daemon put the
address it answers where the user can paste it -- added to the history, or on the clipboard alone should the history refuse it -- and
answer it: what an upload offered to the user does.
- public string upload_sync (string uuid) throws Error
Upload an item to a pastebin service, and answer where it landed.