slave: Use slightly modified event_callback.
[guestfs-browser.git] / window.mli
1 (* Guestfs Browser.
2  * Copyright (C) 2010 Red Hat Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *)
18
19 (** The Window module handles all aspects of the main window, menus,
20     dialogs and so on. *)
21
22 class window :
23 object ('a)
24   method after : 'a
25   method disconnect : GtkSignal.id -> unit
26
27   (** Signals that can be emitted by window menu items. *)
28   method connect_kvm_signal : callback:(unit -> unit) -> GtkSignal.id
29   method connect_xen_signal : callback:(unit -> unit) -> GtkSignal.id
30   method connect_none_signal : callback:(unit -> unit) -> GtkSignal.id
31   method connect_uri_signal : callback:(unit -> unit) -> GtkSignal.id
32   method open_disk_signal : callback:(unit -> unit) -> GtkSignal.id
33   method reopen_signal : callback:(unit -> unit) -> GtkSignal.id
34   method inspection_signal : callback:(unit -> unit) -> GtkSignal.id
35   method about_signal : callback:(unit -> unit) -> GtkSignal.id
36
37   method failure : exn -> unit
38     (** This is the global error handling function.  It is invoked in
39         the main thread for failures in the slave thread (see
40         {!Slave.set_failure_hook}). *)
41
42   method throbber_busy : unit -> unit
43   method throbber_idle : unit -> unit
44     (** These are callbacks from the slave thread (invoked in the main
45         thread) which are called whenever the throbber should be
46         animated/busy or idle.  *)
47
48   method set_statusbar : string -> unit
49     (** This callback from the slave thread (invoked in the main thread)
50         updates the status bar when some slave operation starts or
51         stops. *)
52
53   method progress : int64 * int64 -> unit
54     (** This called whenever the progress bar should move. *)
55
56   method tree : Filetree.tree
57     (** Return the filetree contained in the window. *)
58
59   method connect_to : string option -> unit -> unit
60     (** Connect to the given libvirt URI. *)
61
62   method open_disk_images : (string * string option) list -> unit
63     (** Open disk image(s) directly.  The second part of each pair
64         is the optional disk format. *)
65
66   method reopen : unit -> unit
67     (** Reopen the libguestfs handle and current guest. *)
68
69   method run_cli_request : Cmdline.cli_request -> unit
70     (** This function performs the {!Cmdline.cli_request} operation.
71         The actual operation happens asynchronously after this function
72         has returned. *)
73
74 end