~ubuntu-branches/ubuntu/utopic/pcmanfm/utopic

« back to all changes in this revision

Viewing changes to src/vfs/vfs-dir.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Lee (李健秋)
  • Date: 2010-05-23 23:04:11 UTC
  • mfrom: (8.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100523230411-4ei3g4u14pf5rozb
Tags: 0.9.5-2
* Upload to sid. No new additional bug report since last upload into 
  experimental. (Closes:#506243, #509257, #532973, #502225, #535810, 
  #570114, #581033, #518683)
* debian/control:
  Adjusted depends/recommends for people who doesn't want to have gvfs
  on their system. Without gvfs installed, pcmanfm would still works 
  but lose volume management and trashcan support.
  - Drop depends on gamin, shared-mime-info, desktop-file-utils, dbus, 
    xdg-user-dirs
  - Recommends on lxde-icon-theme | gnome-icon-theme, gvfs-backends,
    gvfs-fuse

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
*  C Interface: vfs-dir
3
 
*
4
 
* Description: Object used to present a directory
5
 
*
6
 
*
7
 
* Author: Hong Jen Yee (PCMan) <pcman.tw (AT) gmail.com>, (C) 2006
8
 
*
9
 
* Copyright: See COPYING file that comes with this distribution
10
 
*
11
 
*/
12
 
 
13
 
#ifndef _VFS_DIR_H_
14
 
#define _VFS_DIR_H_
15
 
 
16
 
#include <glib.h>
17
 
#include <glib-object.h>
18
 
 
19
 
#include "vfs-file-monitor.h"
20
 
#include "vfs-file-info.h"
21
 
#include "vfs-async-task.h"
22
 
 
23
 
G_BEGIN_DECLS
24
 
 
25
 
#define VFS_TYPE_DIR             (vfs_dir_get_type())
26
 
#define VFS_DIR(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),  VFS_TYPE_DIR, VFSDir))
27
 
#define VFS_DIR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass),  VFS_TYPE_DIR, VFSDirClass))
28
 
#define VFS_IS_DIR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VFS_TYPE_DIR))
29
 
#define VFS_IS_DIR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass),  VFS_TYPE_DIR))
30
 
#define VFS_DIR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj),  VFS_TYPE_DIR, VFSDirClass))
31
 
 
32
 
typedef struct _VFSDir VFSDir;
33
 
typedef struct _VFSDirClass VFSDirClass;
34
 
 
35
 
struct _VFSDir
36
 
{
37
 
    GObject parent;
38
 
 
39
 
    char* path;
40
 
    char* disp_path;
41
 
    GList* file_list;
42
 
    int n_files;
43
 
 
44
 
    union {
45
 
        int flags;
46
 
        struct {
47
 
            gboolean is_home : 1;
48
 
            gboolean is_desktop : 1;
49
 
            gboolean is_trash : 1;
50
 
            gboolean is_mount_point : 1;
51
 
            gboolean is_remote : 1;
52
 
            gboolean is_virtual : 1;
53
 
        };
54
 
    };
55
 
 
56
 
    /*<private>*/
57
 
    VFSFileMonitor* monitor;
58
 
    GMutex* mutex;  /* Used to guard file_list */
59
 
    VFSAsyncTask* task;
60
 
    gboolean file_listed : 1;
61
 
    gboolean load_complete : 1;
62
 
    gboolean cancel: 1;
63
 
    gboolean show_hidden : 1;
64
 
 
65
 
    struct _VFSThumbnailLoader* thumbnail_loader;
66
 
 
67
 
    GSList* changed_files;
68
 
};
69
 
 
70
 
struct _VFSDirClass
71
 
{
72
 
    GObjectClass parent;
73
 
    /* Default signal handlers */
74
 
    void ( *file_created ) ( VFSDir* dir, VFSFileInfo* file );
75
 
    void ( *file_deleted ) ( VFSDir* dir, VFSFileInfo* file );
76
 
    void ( *file_changed ) ( VFSDir* dir, VFSFileInfo* file );
77
 
    void ( *thumbnail_loaded ) ( VFSDir* dir, VFSFileInfo* file );
78
 
    void ( *file_listed ) ( VFSDir* dir );
79
 
    void ( *load_complete ) ( VFSDir* dir );
80
 
    /*  void (*need_reload) ( VFSDir* dir ); */
81
 
    /*  void (*update_mime) ( VFSDir* dir ); */
82
 
};
83
 
 
84
 
typedef void ( *VFSDirStateCallback ) ( VFSDir* dir, int state, gpointer user_data );
85
 
 
86
 
GType vfs_dir_get_type ( void );
87
 
 
88
 
VFSDir* vfs_dir_get_by_path( const char* path );
89
 
 
90
 
gboolean vfs_dir_is_loading( VFSDir* dir );
91
 
void vfs_dir_cancel_load( VFSDir* dir );
92
 
gboolean vfs_dir_is_file_listed( VFSDir* dir );
93
 
 
94
 
void vfs_dir_unload_thumbnails( VFSDir* dir, gboolean is_big );
95
 
 
96
 
/* emit signals */
97
 
void vfs_dir_emit_file_created( VFSDir* dir, const char* file_name, VFSFileInfo* file );
98
 
void vfs_dir_emit_file_deleted( VFSDir* dir, const char* file_name, VFSFileInfo* file );
99
 
void vfs_dir_emit_file_changed( VFSDir* dir, const char* file_name, VFSFileInfo* file );
100
 
void vfs_dir_emit_thumbnail_loaded( VFSDir* dir, VFSFileInfo* file );
101
 
 
102
 
/* get the path of desktop dir */
103
 
const char* vfs_get_desktop_dir();
104
 
 
105
 
/* Get the path of user's trash dir under home dir.
106
 
 * NOTE:
107
 
 * According to the spec, there are many legal trash dirs on the system
108
 
 * located at various places. However, because that spec is poor and try
109
 
 * very hard to make simple things more complicated, we only support
110
 
 * home trash dir instead. They are good at making things complicated and
111
 
 * hard to implement. This time, they did it again.
112
 
 */
113
 
const char* vfs_get_trash_dir();
114
 
 
115
 
/* call function "func" for every VFSDir instances */
116
 
void vfs_dir_foreach( GHFunc func, gpointer user_data );
117
 
 
118
 
G_END_DECLS
119
 
 
120
 
#endif