4
* Copyright 2009 PCMan <pcman.tw@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23
#ifndef __FM_FOLDER_H__
24
#define __FM_FOLDER_H__
26
#include <glib-object.h>
29
#include "fm-dir-list-job.h"
30
#include "fm-file-info.h"
31
#include "fm-file-info-job.h"
35
#define FM_TYPE_FOLDER (fm_folder_get_type())
36
#define FM_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\
37
FM_TYPE_FOLDER, FmFolder))
38
#define FM_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\
39
FM_TYPE_FOLDER, FmFolderClass))
40
#define FM_IS_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
42
#define FM_IS_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),\
45
typedef struct _FmFolder FmFolder;
46
typedef struct _FmFolderClass FmFolderClass;
58
FmFileInfoList* files;
60
/* for file monitor */
63
GSList* files_to_update;
70
GObjectClass parent_class;
72
void (*files_added)(FmFolder* dir, GSList* files);
73
void (*files_removed)(FmFolder* dir, GSList* files);
74
void (*files_changed)(FmFolder* dir, GSList* files);
75
void (*loaded)(FmFolder* dir);
76
gboolean (*error)(FmFolder* dir, GError* err, gboolean recoverable);
79
GType fm_folder_get_type (void);
80
FmFolder* fm_folder_get(FmPath* path);
81
FmFolder* fm_folder_get_for_gfile(GFile* gf);
82
FmFolder* fm_folder_get_for_path(FmPath* path);
83
FmFolder* fm_folder_get_for_path_name(const char* path);
84
FmFolder* fm_folder_get_for_uri(const char* uri);
86
FmFileInfoList* fm_folder_get_files (FmFolder* folder);
87
FmFileInfo* fm_folder_get_file_by_name(FmFolder* folder, const char* name);
89
gboolean fm_folder_get_is_loading(FmFolder* folder);
91
void fm_folder_reload(FmFolder* folder);
95
#endif /* __FM_FOLDER_H__ */