ba44e5ed61f5400ad203c293da90c9d3a6bc0dfc
[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. *)
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
33   method failure : exn -> unit
34     (** This is the global error handling function.  It is invoked in
35         the main thread for failures in the slave thread (see
36         {!Slave.set_failure_hook}). *)
37
38   method throbber_busy : unit -> unit
39   method throbber_idle : unit -> unit
40     (** These are callbacks from the slave thread (invoked in the main
41         thread) which are called whenever the throbber should be
42         animated/busy or idle.  *)
43
44   method set_statusbar : string -> unit
45     (** This callback from the slave thread (invoked in the main thread)
46         updates the status bar when some slave operation starts or
47         stops. *)
48
49   method progress : int64 * int64 -> unit
50     (** This called whenever the progress bar should move. *)
51
52   method tree : Filetree.tree
53     (** Return the filetree contained in the window. *)
54
55   method connect_to : string option -> unit -> unit
56     (** Connect to the given libvirt URI. *)
57
58   method run_cli_request : Cmdline.cli_request -> unit
59     (** This function performs the {!Cmdline.cli_request} operation.
60         The actual operation happens asynchronously after this function
61         has returned. *)
62
63 end