Daily check-in.
[guestfs-browser.git] / filetree_type.mli
diff --git a/filetree_type.mli b/filetree_type.mli
new file mode 100644 (file)
index 0000000..af36dee
--- /dev/null
@@ -0,0 +1,66 @@
+(* Guestfs Browser.
+ * Copyright (C) 2010 Red Hat Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *)
+
+(** This is the base class for the file tree.
+
+    The types and functions in this file should be considered
+    private to the file tree implementation.
+
+    See {!Filetree} for the full description and public interface. *)
+
+(**/**)
+
+type t = {
+  view : GTree.view;
+  model : GTree.tree_store;
+  hash : (int, hdata) Hashtbl.t;
+  index_col : int GTree.column;
+  mode_col : string GTree.column;
+  name_col : string GTree.column;
+  size_col : int64 GTree.column;
+  date_col : string GTree.column;
+  link_col : string GTree.column;
+  mutable status : (string -> unit) option;
+}
+
+and hdata = state_t * content_t
+
+and state_t =
+  | IsLeaf
+  | NodeNotStarted
+  | NodeLoading
+  | IsNode
+
+and content_t =
+  | Loading
+  | ErrorMessage of string
+  | Top of Slave.source
+  | Directory of Slave.direntry
+  | File of Slave.direntry
+
+val store_hdata : t -> Gtk.tree_iter -> hdata -> unit
+val get_hdata : t -> Gtk.tree_iter -> hdata
+  (* Store/retrieve hdata structure in a model row. *)
+
+val get_pathname : t -> Gtk.tree_iter -> Slave.source * string
+  (* Get the full path to a row by chasing up through the tree to the
+     top.  This also returns the source (eg. operating system or single
+     volume). *)
+
+val update_status : t -> string -> unit
+  (* Update the status bar. *)