~ubuntu-branches/ubuntu/lucid/libfm/lucid

« back to all changes in this revision

Viewing changes to src/base/fm-folder.h

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-02-06 22:53:35 UTC
  • Revision ID: james.westby@ubuntu.com-20100206225335-wsjxzkub56ak4tp5
Tags: upstream-0.1~git20100207
ImportĀ upstreamĀ versionĀ 0.1~git20100207

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *      fm-folder.h
 
3
 *      
 
4
 *      Copyright 2009 PCMan <pcman.tw@gmail.com>
 
5
 *      
 
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.
 
10
 *      
 
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.
 
15
 *      
 
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,
 
19
 *      MA 02110-1301, USA.
 
20
 */
 
21
 
 
22
 
 
23
#ifndef __FM_FOLDER_H__
 
24
#define __FM_FOLDER_H__
 
25
 
 
26
#include <glib-object.h>
 
27
#include <gio/gio.h>
 
28
#include "fm-path.h"
 
29
#include "fm-dir-list-job.h"
 
30
#include "fm-file-info.h"
 
31
#include "fm-file-info-job.h"
 
32
 
 
33
G_BEGIN_DECLS
 
34
 
 
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),\
 
41
                        FM_TYPE_FOLDER))
 
42
#define FM_IS_FOLDER_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE((klass),\
 
43
                        FM_TYPE_FOLDER))
 
44
 
 
45
typedef struct _FmFolder                        FmFolder;
 
46
typedef struct _FmFolderClass           FmFolderClass;
 
47
 
 
48
struct _FmFolder
 
49
{
 
50
        GObject parent;
 
51
 
 
52
        /* private */
 
53
        FmPath* dir_path;
 
54
        GFile* gf;
 
55
        GFileMonitor* mon;
 
56
        FmDirListJob* job;
 
57
    FmFileInfo* dir_fi;
 
58
        FmFileInfoList* files;
 
59
 
 
60
    /* for file monitor */
 
61
    guint idle_handler;
 
62
    GSList* files_to_add;
 
63
    GSList* files_to_update;
 
64
    GSList* files_to_del;
 
65
    GSList* pending_jobs;
 
66
};
 
67
 
 
68
struct _FmFolderClass
 
69
{
 
70
        GObjectClass parent_class;
 
71
 
 
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);
 
77
};
 
78
 
 
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);
 
85
 
 
86
FmFileInfoList* fm_folder_get_files (FmFolder* folder);
 
87
FmFileInfo* fm_folder_get_file_by_name(FmFolder* folder, const char* name);
 
88
 
 
89
gboolean fm_folder_get_is_loading(FmFolder* folder);
 
90
 
 
91
void fm_folder_reload(FmFolder* folder);
 
92
 
 
93
G_END_DECLS
 
94
 
 
95
#endif /* __FM_FOLDER_H__ */