X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=filetree.mli;h=e2fcef230e04063c50fdb3e9f20d1e2f41bf5853;hb=63a55ccde74bd8ec7bac6ef5e4a54f2a803b2024;hp=7321a4f339274d0df9793ea91e83509de300acfc;hpb=b07102fda0034da5840a9f33bd6d404a195b8cc9;p=guestfs-browser.git diff --git a/filetree.mli b/filetree.mli index 7321a4f..e2fcef2 100644 --- a/filetree.mli +++ b/filetree.mli @@ -26,8 +26,127 @@ to this trick: http://mail.gnome.org/archives/gtk-app-devel-list/2003-May/msg00241.html *) -val filetree : string -> Slave.rw_flag -> GTree.view - (** [filetree dev rw] creates a new filetree widget. +type registry_t +val source_of_registry_t : registry_t -> Slave_types.source +val root_key_of_registry_t : registry_t -> string - [dev] is the device. - [rw] is the RO|RW flag. *) +(** The filetree widget. *) +class tree : ?packing:(GObj.widget -> unit) -> unit -> +object ('a) + inherit GTree.view + + method clear : unit -> unit + (** Clear out all rows in existing widget. *) + + method add_os : string -> Slave_types.inspection_data -> unit + (** [add_os name data] clears out the widget and adds the operating + system and/or filesystems described by the [data] struct. + + The [name] parameter should be some host-side (verifiable) name, + not any untrusted string from the guest; usually we pass the + name of the guest from libvirt here. *) + + method oses : Slave_types.inspection_os list + (** If operating system root(s) are currently loaded into the + filetree widget, this returns a list of them. If none are + loaded (empty, or could be just a pile of filesystems), then this + returns an empty list. *) + + method get_pathname : Gtk.tree_iter -> Slave_types.source * string + (** Use [get_pathname row] on a [row] representing a file or + directory. It searches back up the tree to get the source + OS and the full pathname of the file. + + Don't use this on registry entries. Use {!get_registry_path} + instead. *) + + method get_direntry : Gtk.tree_iter -> Slave_types.direntry + (** [get_direntry row] returns the file and stat information for a + file or directory. *) + + method get_registry_path : Gtk.tree_iter -> registry_t * string list + (** Use [get_registry_path row] on a [row] representing a registry + entry. It searches back up the tree and returns a tuple + containing: + + - an opaque registry handle + + - list of registry path elements (in reverse order) + + Don't use this on files and directories. Use {!get_pathname} + instead. *) + + method get_registry_value : Gtk.tree_iter -> Hivex.hive_type * string + (** [get_registry_value row] returns the type and value of the + registry value at [row]. *) + + method get_registry_file : ?fail:exn Slave.callback -> + Gtk.tree_path -> registry_t -> string Slave.callback -> unit + (** [get_registry_file ?fail path registry_t cb] forces the + registry to be downloaded (if not already). + + [cb cachefile] is called when it is downloaded, where + [cachefile] is the local hive containing the registry. + + Optional argument [?fail] is called if the download fails. *) + + method set_visited : Gtk.tree_iter -> unit + (** Mark row has visited. *) + + method has_child_info_node : Gtk.tree_path -> string -> bool + (** [has_child_info_node path info_text] returns [true] iff there is + an info node under path which exactly matches [info_text]. + + Info nodes are used for "Calculating ..." messages, and for + the final result of those calculations. *) + + method set_child_info_node : Gtk.tree_path -> string -> string -> unit + (** [set_child_info_node path info_text text] replaces the + displayed [text] in the info node [info_text] under [path]. + If the info node doesn't exist, then one is created. *) + + (** Signals emitted by the filetree widget. + + The main point of using signals is to decouple the filetree + widget from associated dialogs and operations that can be + performed by actions in the context menu. So instead of + having a giant filetree object that does everything, we have + the code split into small modules, with the filetree widget + just emitting signals when some action needs to take place. + + All the components are wired together in the {!Main} + module. *) + + method after : 'a + method disconnect : GtkSignal.id -> unit + + method clear_tree : callback:(unit -> unit) -> GtkSignal.id + (** Register a signal handler which is called when the tree is + cleared (ie. when either {!clear} or {!add_os} is called. *) + + (** The following methods register signals that are emitted + on user events in the context menu. *) + method op_checksum_file : + callback:(Gtk.tree_path * string -> unit) -> GtkSignal.id + method op_copy_regvalue : + callback:(Gtk.tree_path -> unit) -> GtkSignal.id + method op_disk_usage : + callback:(Gtk.tree_path -> unit) -> GtkSignal.id + method op_download_as_reg : + callback:(Gtk.tree_path * string -> unit) -> GtkSignal.id + method op_download_dir_find0 : + callback:(Gtk.tree_path -> unit) -> GtkSignal.id + method op_download_dir_tarball : + callback:(Slave_types.download_dir_tarball_format * Gtk.tree_path -> unit) -> + GtkSignal.id + method op_download_file : + callback:(Gtk.tree_path -> unit) -> GtkSignal.id + method op_file_information : + callback:(Gtk.tree_path -> unit) -> GtkSignal.id + method op_file_properties : + callback:(Gtk.tree_path -> unit) -> GtkSignal.id + method op_inspection_dialog : + callback:(Slave_types.inspection_os -> unit) -> GtkSignal.id + method op_view_file : + callback:(Gtk.tree_path * string -> unit) -> GtkSignal.id +end