1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ 2 3 /* 4 * Copyright (C) 2002 Anders Carlsson 5 * Copyright (C) 2002 Bent Spoon Software 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License as 9 * published by the Free Software Foundation; either version 2 of the 10 * License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public 18 * License along with this program; if not, write to the 19 * Free Software Foundation, Inc., 51 Franklin Street - Suite 500, 20 * Boston, MA 02110-1335, USA. 21 * 22 * Author: Anders Carlsson <andersca@gnu.org> 23 */ 24 25 /* fm-tree-model.h - Model for the tree view */ 26 27 #ifndef FM_TREE_MODEL_H 28 #define FM_TREE_MODEL_H 29 30 #include <glib-object.h> 31 #include <gtk/gtk.h> 32 #include <gio/gio.h> 33 #include <libnemo-private/nemo-file.h> 34 35 #define FM_TYPE_TREE_MODEL fm_tree_model_get_type() 36 #define FM_TREE_MODEL(obj) \ 37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_TREE_MODEL, FMTreeModel)) 38 #define FM_TREE_MODEL_CLASS(klass) \ 39 (G_TYPE_CHECK_CLASS_CAST ((klass), FM_TYPE_TREE_MODEL, FMTreeModelClass)) 40 #define FM_IS_TREE_MODEL(obj) \ 41 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FM_TYPE_TREE_MODEL)) 42 #define FM_IS_TREE_MODEL_CLASS(klass) \ 43 (G_TYPE_CHECK_CLASS_TYPE ((klass), FM_TYPE_TREE_MODEL)) 44 #define FM_TREE_MODEL_GET_CLASS(obj) \ 45 (G_TYPE_INSTANCE_GET_CLASS ((obj), FM_TYPE_TREE_MODEL, FMTreeModelClass)) 46 47 enum { 48 FM_TREE_MODEL_DISPLAY_NAME_COLUMN, 49 FM_TREE_MODEL_CLOSED_ICON_COLUMN, 50 FM_TREE_MODEL_OPEN_ICON_COLUMN, 51 FM_TREE_MODEL_FONT_STYLE_COLUMN, 52 FM_TREE_MODEL_TEXT_WEIGHT_COLUMN, 53 FM_TREE_MODEL_NUM_COLUMNS 54 }; 55 56 typedef struct FMTreeModelDetails FMTreeModelDetails; 57 58 typedef struct { 59 GObject parent; 60 FMTreeModelDetails *details; 61 } FMTreeModel; 62 63 typedef struct { 64 GObjectClass parent_class; 65 66 void (* row_loaded) (FMTreeModel *tree_model, 67 GtkTreeIter *iter); 68 } FMTreeModelClass; 69 70 GType fm_tree_model_get_type (void); 71 FMTreeModel *fm_tree_model_new (void); 72 void fm_tree_model_set_show_hidden_files (FMTreeModel *model, 73 gboolean show_hidden_files); 74 void fm_tree_model_set_show_only_directories (FMTreeModel *model, 75 gboolean show_only_directories); 76 NemoFile * fm_tree_model_iter_get_file (FMTreeModel *model, 77 GtkTreeIter *iter); 78 void fm_tree_model_add_root_uri (FMTreeModel *model, 79 const char *root_uri, 80 const char *display_name, 81 GIcon *icon, 82 GMount *mount); 83 void fm_tree_model_remove_root_uri (FMTreeModel *model, 84 const char *root_uri); 85 gboolean fm_tree_model_iter_is_root (FMTreeModel *model, 86 GtkTreeIter *iter); 87 int fm_tree_model_iter_compare_roots (FMTreeModel *model, 88 GtkTreeIter *iter_a, 89 GtkTreeIter *iter_b); 90 gboolean fm_tree_model_file_get_iter (FMTreeModel *model, 91 GtkTreeIter *iter, 92 NemoFile *file, 93 GtkTreeIter *currentIter); 94 95 GMount * fm_tree_model_get_mount_for_root_node_file 96 (FMTreeModel *model, 97 NemoFile *file); 98 void fm_tree_model_set_highlight_for_files (FMTreeModel *model, 99 GList *files); 100 101 #endif /* FM_TREE_MODEL_H */