Version 0.1.3.
[guestfs-browser.git] / filetree.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 (** Tree model for displaying files in the guest filesystem.
20
21     The model reads files and directories on demand so that we don't
22     have to read the whole thing in at the beginning.
23
24     Originally this was written as a custom tree model, but we
25     couldn't get that to work.  Instead we use something similar
26     to this trick:
27     http://mail.gnome.org/archives/gtk-app-devel-list/2003-May/msg00241.html *)
28
29 type t
30   (** A filetree widget.  Actually an opaque object which contains the
31       widget and other data.  Use the accessors below. *)
32
33 val create : packing:(GObj.widget -> unit) -> unit -> t
34   (** Create a new filetree widget (empty).
35
36       [~packing] is the required packing for the widget. *)
37
38 val clear : t -> unit
39   (** Clear out all rows in existing widget. *)
40
41 val add : t -> string -> Slave.inspection_data -> unit
42   (** [add t name data] clears out the widget and adds the operating
43       system and/or filesystems described by the [data] struct.
44
45       The [name] parameter should be some host-side (verifiable) name,
46       not any untrusted string from the guest; usually we pass the
47       name of the guest from libvirt here. *)