summaryrefslogtreecommitdiff
path: root/src/nautilus-list-model.h
blob: ba771b8c28cefebe9c48f1505d4d6f85b0ab3154 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

/* fm-list-model.h - a GtkTreeModel for file lists. 

   Copyright (C) 2001, 2002 Anders Carlsson

   The Gnome Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The Gnome Library 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
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
   see <http://www.gnu.org/licenses/>.

   Authors: Anders Carlsson <andersca@gnu.org>
*/

#pragma once

#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include "nautilus-file.h"
#include "nautilus-directory.h"
#include <nautilus-extension.h>

#define NAUTILUS_TYPE_LIST_MODEL nautilus_list_model_get_type()
G_DECLARE_DERIVABLE_TYPE (NautilusListModel, nautilus_list_model, NAUTILUS, LIST_MODEL, GObject);

enum {
	NAUTILUS_LIST_MODEL_FILE_COLUMN,
	NAUTILUS_LIST_MODEL_SUBDIRECTORY_COLUMN,
	NAUTILUS_LIST_MODEL_SMALL_ICON_COLUMN,
	NAUTILUS_LIST_MODEL_STANDARD_ICON_COLUMN,
	NAUTILUS_LIST_MODEL_LARGE_ICON_COLUMN,
	NAUTILUS_LIST_MODEL_LARGER_ICON_COLUMN,
	NAUTILUS_LIST_MODEL_FILE_NAME_IS_EDITABLE_COLUMN,
	NAUTILUS_LIST_MODEL_NUM_COLUMNS
};

struct _NautilusListModelClass
{
	GObjectClass parent_class;

	void (* subdirectory_unloaded)(NautilusListModel *model,
				       NautilusDirectory *subdirectory);
};

gboolean nautilus_list_model_add_file                          (NautilusListModel          *model,
								NautilusFile         *file,
								NautilusDirectory    *directory);
void     nautilus_list_model_file_changed                      (NautilusListModel          *model,
								NautilusFile         *file,
								NautilusDirectory    *directory);
gboolean nautilus_list_model_is_empty                          (NautilusListModel          *model);
void     nautilus_list_model_remove_file                       (NautilusListModel          *model,
								NautilusFile         *file,
								NautilusDirectory    *directory);
void     nautilus_list_model_clear                             (NautilusListModel          *model);
gboolean nautilus_list_model_get_tree_iter_from_file           (NautilusListModel          *model,
								NautilusFile         *file,
								NautilusDirectory    *directory,
								GtkTreeIter          *iter);
GList *  nautilus_list_model_get_all_iters_for_file            (NautilusListModel          *model,
								NautilusFile         *file);
gboolean nautilus_list_model_get_first_iter_for_file           (NautilusListModel          *model,
								NautilusFile         *file,
								GtkTreeIter          *iter);
void     nautilus_list_model_set_should_sort_directories_first (NautilusListModel          *model,
								gboolean              sort_directories_first);

int      nautilus_list_model_get_sort_column_id_from_attribute (NautilusListModel *model,
								GQuark       attribute);
GQuark   nautilus_list_model_get_attribute_from_sort_column_id (NautilusListModel *model,
								int sort_column_id);
void     nautilus_list_model_sort_files                        (NautilusListModel *model,
								GList **files);

NautilusListZoomLevel nautilus_list_model_get_zoom_level_from_column_id (int               column);
int               nautilus_list_model_get_column_id_from_zoom_level (NautilusListZoomLevel zoom_level);
guint    nautilus_list_model_get_icon_size_for_zoom_level      (NautilusListZoomLevel zoom_level);

NautilusFile *    nautilus_list_model_file_for_path (NautilusListModel *model, GtkTreePath *path);
gboolean          nautilus_list_model_load_subdirectory (NautilusListModel *model, GtkTreePath *path, NautilusDirectory **directory);
void              nautilus_list_model_unload_subdirectory (NautilusListModel *model, GtkTreeIter *iter);

void              nautilus_list_model_set_drag_view (NautilusListModel *model,
						     GtkTreeView *view,
						     int begin_x, 
						     int begin_y);
GtkTreeView *     nautilus_list_model_get_drag_view (NautilusListModel *model,
						     int *drag_begin_x,
						     int *drag_begin_y);

GtkTargetList *   nautilus_list_model_get_drag_target_list (void);

int               nautilus_list_model_compare_func (NautilusListModel *model,
						    NautilusFile *file1,
						    NautilusFile *file2);


int               nautilus_list_model_add_column (NautilusListModel *model,
						  NautilusColumn *column);

void              nautilus_list_model_subdirectory_done_loading (NautilusListModel       *model,
								 NautilusDirectory *directory);

void              nautilus_list_model_set_highlight_for_files (NautilusListModel *model,
							       GList *files);