~elementary-apps/pantheon-files/trunk

« back to all changes in this revision

Viewing changes to src/fm-list-model.h

  • Committer: am.monkeyd at gmail
  • Date: 2010-11-08 13:17:02 UTC
  • Revision ID: am.monkeyd@gmail.com-20101108131702-rqeywh4r5pyx2ycz
let's roll

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 
2
 
 
3
/* fm-list-model.h - a GtkTreeModel for file lists. 
 
4
 
 
5
   Copyright (C) 2001, 2002 Anders Carlsson
 
6
 
 
7
   The Gnome Library is free software; you can redistribute it and/or
 
8
   modify it under the terms of the GNU Library 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
   The Gnome Library 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
   Library General Public License for more details.
 
16
 
 
17
   You should have received a copy of the GNU Library General Public
 
18
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
 
19
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
20
   Boston, MA 02111-1307, USA.
 
21
 
 
22
   Authors: Anders Carlsson <andersca@gnu.org>
 
23
*/
 
24
 
 
25
#include <gtk/gtk.h>
 
26
#include <gdk/gdk.h>
 
27
#include "gof-file.h"
 
28
#include "gof-directory-async.h"
 
29
/*#include <libnautilus-private/nautilus-file.h>
 
30
#include <libnautilus-private/nautilus-directory.h>
 
31
#include <libnautilus-extension/nautilus-column.h>*/
 
32
 
 
33
#ifndef FM_LIST_MODEL_H
 
34
#define FM_LIST_MODEL_H
 
35
 
 
36
#define FM_TYPE_LIST_MODEL fm_list_model_get_type()
 
37
#define FM_LIST_MODEL(obj) \
 
38
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_LIST_MODEL, FMListModel))
 
39
#define FM_LIST_MODEL_CLASS(klass) \
 
40
  (G_TYPE_CHECK_CLASS_CAST ((klass), FM_TYPE_LIST_MODEL, FMListModelClass))
 
41
#define FM_IS_LIST_MODEL(obj) \
 
42
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FM_TYPE_LIST_MODEL))
 
43
#define FM_IS_LIST_MODEL_CLASS(klass) \
 
44
  (G_TYPE_CHECK_CLASS_TYPE ((klass), FM_TYPE_LIST_MODEL))
 
45
#define FM_LIST_MODEL_GET_CLASS(obj) \
 
46
  (G_TYPE_INSTANCE_GET_CLASS ((obj), FM_TYPE_LIST_MODEL, FMListModelClass))
 
47
 
 
48
enum {
 
49
        FM_LIST_MODEL_FILE_COLUMN,
 
50
        FM_LIST_MODEL_ICON,
 
51
        FM_LIST_MODEL_FILENAME,
 
52
        FM_LIST_MODEL_SIZE,
 
53
        FM_LIST_MODEL_TYPE,
 
54
        FM_LIST_MODEL_MODIFIED,
 
55
        /*FM_LIST_MODEL_SUBDIRECTORY_COLUMN,
 
56
        FM_LIST_MODEL_SMALLEST_ICON_COLUMN,
 
57
        FM_LIST_MODEL_SMALLER_ICON_COLUMN,
 
58
        FM_LIST_MODEL_SMALL_ICON_COLUMN,
 
59
        FM_LIST_MODEL_STANDARD_ICON_COLUMN,
 
60
        FM_LIST_MODEL_LARGE_ICON_COLUMN,
 
61
        FM_LIST_MODEL_LARGER_ICON_COLUMN,
 
62
        FM_LIST_MODEL_LARGEST_ICON_COLUMN,
 
63
        FM_LIST_MODEL_SMALLEST_EMBLEM_COLUMN,
 
64
        FM_LIST_MODEL_SMALLER_EMBLEM_COLUMN,
 
65
        FM_LIST_MODEL_SMALL_EMBLEM_COLUMN,
 
66
        FM_LIST_MODEL_STANDARD_EMBLEM_COLUMN,
 
67
        FM_LIST_MODEL_LARGE_EMBLEM_COLUMN,
 
68
        FM_LIST_MODEL_LARGER_EMBLEM_COLUMN,
 
69
        FM_LIST_MODEL_LARGEST_EMBLEM_COLUMN,
 
70
        FM_LIST_MODEL_FILE_NAME_IS_EDITABLE_COLUMN,*/
 
71
        FM_LIST_MODEL_NUM_COLUMNS
 
72
};
 
73
 
 
74
typedef struct FMListModelDetails FMListModelDetails;
 
75
 
 
76
typedef struct FMListModel {
 
77
        GObject parent_instance;
 
78
        FMListModelDetails *details;
 
79
} FMListModel;
 
80
 
 
81
typedef struct {
 
82
        GObjectClass parent_class;
 
83
 
 
84
        void (* subdirectory_unloaded)(FMListModel *model, GOFDirectoryAsync *subdirectory);
 
85
} FMListModelClass;
 
86
 
 
87
GType    fm_list_model_get_type                          (void);
 
88
/*gboolean fm_list_model_add_file                          (FMListModel          *model,
 
89
                                                          GOFFile         *file,
 
90
                                                          NautilusDirectory    *directory);*/
 
91
/*gboolean fm_list_model_add_file                          (FMListModel          *model,
 
92
                                                          GOFFile         *file);*/
 
93
gboolean fm_list_model_add_file                          (FMListModel *model, GOFFile *file, GOFDirectoryAsync *directory);
 
94
/*void     fm_list_model_file_changed                      (FMListModel          *model,
 
95
                                                          GOFFile         *file,
 
96
                                                          NautilusDirectory    *directory);*/
 
97
gboolean fm_list_model_is_empty                          (FMListModel *model);
 
98
guint    fm_list_model_get_length                        (FMListModel *model);
 
99
/*void     fm_list_model_remove_file                       (FMListModel          *model,
 
100
                                                          GOFFile         *file,
 
101
                                                          GOFDirectoryAsync    *directory);*/
 
102
void     fm_list_model_clear                             (FMListModel *model);
 
103
gboolean fm_list_model_get_tree_iter_from_file           (FMListModel           *model,
 
104
                                                          GOFFile               *file,
 
105
                                                          GOFDirectoryAsync     *directory,
 
106
                                                          GtkTreeIter           *iter);
 
107
GList *  fm_list_model_get_all_iters_for_file            (FMListModel *model, GOFFile *file);
 
108
gboolean fm_list_model_get_first_iter_for_file           (FMListModel *model, GOFFile *file, GtkTreeIter *iter);
 
109
void     fm_list_model_set_should_sort_directories_first (FMListModel *model, gboolean sort_directories_first);
 
110
 
 
111
int      fm_list_model_get_sort_column_id_from_attribute (FMListModel *model, GQuark attribute);
 
112
GQuark   fm_list_model_get_attribute_from_sort_column_id (FMListModel *model, int sort_column_id);
 
113
void     fm_list_model_sort_files                        (FMListModel *model, GList **files);
 
114
 
 
115
//NautilusZoomLevel fm_list_model_get_zoom_level_from_column_id (int               column);
 
116
//int               fm_list_model_get_column_id_from_zoom_level (NautilusZoomLevel zoom_level);
 
117
//NautilusZoomLevel fm_list_model_get_zoom_level_from_emblem_column_id (int               column);
 
118
//int               fm_list_model_get_emblem_column_id_from_zoom_level (NautilusZoomLevel zoom_level);
 
119
 
 
120
GOFFile *       fm_list_model_file_for_path (FMListModel *model, GtkTreePath *path);
 
121
void            fm_list_model_get_directory_file (FMListModel *model, GtkTreePath *path, 
 
122
                                                  GOFDirectoryAsync **directory, GOFFile **file);
 
123
gboolean        fm_list_model_load_subdirectory (FMListModel *model, GtkTreePath *path, GOFDirectoryAsync **directory);
 
124
void            fm_list_model_unload_subdirectory (FMListModel *model, GtkTreeIter *iter);
 
125
 
 
126
/*void              fm_list_model_set_drag_view (FMListModel *model,
 
127
                                               GtkTreeView *view,
 
128
                                               int begin_x, 
 
129
                                               int begin_y);
 
130
 
 
131
GtkTargetList *   fm_list_model_get_drag_target_list (void);*/
 
132
 
 
133
int               fm_list_model_compare_func (FMListModel *model,
 
134
                                              GOFFile *file1,
 
135
                                              GOFFile *file2);
 
136
 
 
137
 
 
138
/*int               fm_list_model_add_column (FMListModel *model,
 
139
                                            NautilusColumn *column);*/
 
140
/*int               fm_list_model_get_column_number (FMListModel *model,
 
141
                                                   const char *column_name);*/
 
142
                                                   
 
143
/*void              fm_list_model_subdirectory_done_loading (FMListModel       *model,
 
144
                                                           NautilusDirectory *directory);*/
 
145
                                                   
 
146
#endif /* FM_LIST_MODEL_H */