~ubuntu-branches/ubuntu/maverick/cairo-dock/maverick

« back to all changes in this revision

Viewing changes to src/gldit/cairo-dock-file-manager.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-09 23:26:12 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100809232612-yp4c6ig3jt1bzpdv
Tags: 2.2.0~0beta4-0ubuntu1
* New Upstream Version (LP: #614624)
* Fixed a few bugs on LP:
 - LP: #518453: Dock appears under all windows
                 (Compiz - fullscreen window)
 - LP: #521369: Separator are not removed when closing
                 grouped windows
 - LP: #521762: Some sentences are not correct
 - LP: #526466: Icons of apps with same class shouldn't
                 be stacked by default
 - LP: #535083: Dialogues looks ugly when a lot of them
                 appears at the same time
 - More details on the 'ChangeLog' file
* debian/rules:
 - Autotools has been replaced by CMake
 - Man pages are now included in the source code
* debian/copyright:
 - Updated with the new pathes and new files
* debian/control:
 - Autotools has been replaced by CMake
 - Added libcurl4-gnutls-dev as Build-deps
 - Bump Standard-Version to 3.9.1
* debian/cairo-dock-core.install:
 - Man pages are now included in the source code
 - All sonames are now installed into lib32 or lib64
* debian/cairo-dock-dev.install:
 - pkgconfig is now installed into lib32 or lib64

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* This file is a part of the Cairo-Dock project
 
3
*
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
 
6
*
 
7
* This program is free software; you can redistribute it and/or
 
8
* modify it under the terms of the GNU General Public License
 
9
* as published by the Free Software Foundation; either version 3
 
10
* of the License, or (at your option) any later version.
 
11
*
 
12
* This program 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
 
15
* 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, see <http://www.gnu.org/licenses/>.
 
18
*/
 
19
 
 
20
 
 
21
#ifndef __CAIRO_DOCK_FILE_MANAGER__
 
22
#define  __CAIRO_DOCK_FILE_MANAGER__
 
23
 
 
24
#include "cairo-dock-icons.h"
 
25
#include "cairo-dock-struct.h"
 
26
G_BEGIN_DECLS
 
27
 
 
28
/**
 
29
*@file cairo-dock-file-manager.h This class handles the integration into the desktop environment, which includes :
 
30
* - the VFS (Virtual File System)
 
31
* - the various desktop-related tools.
 
32
*/
 
33
 
 
34
/// Type of available Desktop Environments.
 
35
typedef enum {
 
36
        CAIRO_DOCK_UNKNOWN_ENV=0,
 
37
        CAIRO_DOCK_GNOME,
 
38
        CAIRO_DOCK_KDE,
 
39
        CAIRO_DOCK_XFCE,
 
40
        CAIRO_DOCK_NB_DESKTOPS
 
41
        } CairoDockDesktopEnv;
 
42
 
 
43
/// Type of events that can occur to a file.
 
44
typedef enum {
 
45
        CAIRO_DOCK_FILE_MODIFIED=0,
 
46
        CAIRO_DOCK_FILE_DELETED,
 
47
        CAIRO_DOCK_FILE_CREATED,
 
48
        CAIRO_DOCK_NB_EVENT_ON_FILES
 
49
        } CairoDockFMEventType;
 
50
 
 
51
/// Type of sorting available on files.
 
52
typedef enum {
 
53
        CAIRO_DOCK_FM_SORT_BY_NAME=0,
 
54
        CAIRO_DOCK_FM_SORT_BY_DATE,
 
55
        CAIRO_DOCK_FM_SORT_BY_SIZE,
 
56
        CAIRO_DOCK_FM_SORT_BY_TYPE,
 
57
        CAIRO_DOCK_NB_SORT_ON_FILE
 
58
        } CairoDockFMSortType;
 
59
 
 
60
#define CAIRO_DOCK_FM_VFS_ROOT "_vfsroot_"
 
61
#define CAIRO_DOCK_FM_NETWORK "_network_"
 
62
#define CAIRO_DOCK_FM_TRASH "_trash_"
 
63
#define CAIRO_DOCK_FM_DESKTOP "_desktop_"
 
64
 
 
65
typedef void (*CairoDockFMGetFileInfoFunc) (const gchar *cBaseURI, gchar **cName, gchar **cURI, gchar **cIconName, gboolean *bIsDirectory, int *iVolumeID, double *fOrder, CairoDockFMSortType iSortType);
 
66
typedef void (*CairoDockFMFilePropertiesFunc) (const gchar *cURI, guint64 *iSize, time_t *iLastModificationTime, gchar **cMimeType, int *iUID, int *iGID, int *iPermissionsMask);
 
67
typedef GList * (*CairoDockFMListDirectoryFunc) (const gchar *cURI, CairoDockFMSortType g_fm_iSortType, int iNewIconsType, gboolean bListHiddenFiles, int iNbMaxFiles, gchar **cFullURI);
 
68
typedef gsize (*CairoDockFMMeasureDirectoryFunc) (const gchar *cURI, gint iCountType, gboolean bRecursive, gint *pCancel);
 
69
typedef void (*CairoDockFMLaunchUriFunc) (const gchar *cURI);
 
70
 
 
71
typedef gchar * (*CairoDockFMIsMountedFunc) (const gchar *cURI, gboolean *bIsMounted);
 
72
typedef gboolean (*CairoDockFMCanEjectFunc) (const gchar *cURI);
 
73
typedef gboolean (*CairoDockFMEjectDriveFunc) (const gchar *cURI);
 
74
 
 
75
typedef void (*CairoDockFMMountCallback) (gboolean bMounting, gboolean bSuccess, const gchar *cName, const gchar *cUri, gpointer data);
 
76
typedef void (*CairoDockFMMountFunc) (const gchar *cURI, int iVolumeID, CairoDockFMMountCallback pCallback, gpointer user_data);
 
77
typedef void (*CairoDockFMUnmountFunc) (const gchar *cURI, int iVolumeID, CairoDockFMMountCallback pCallback, gpointer user_data);
 
78
 
 
79
typedef void (*CairoDockFMMonitorCallback) (CairoDockFMEventType iEventType, const gchar *cURI, gpointer data);
 
80
typedef void (*CairoDockFMAddMonitorFunc) (const gchar *cURI, gboolean bDirectory, CairoDockFMMonitorCallback pCallback, gpointer data);
 
81
typedef void (*CairoDockFMRemoveMonitorFunc) (const gchar *cURI);
 
82
 
 
83
typedef gboolean (*CairoDockFMDeleteFileFunc) (const gchar *cURI, gboolean bNoTrash);
 
84
typedef gboolean (*CairoDockFMRenameFileFunc) (const gchar *cOldURI, const gchar *cNewName);
 
85
typedef gboolean (*CairoDockFMMoveFileFunc) (const gchar *cURI, const gchar *cDirectoryURI);
 
86
typedef gboolean (*CairoDockFMCreateFileFunc) (const gchar *cURI, gboolean bDirectory);
 
87
typedef GList * (*CairoDockFMListAppsForFileFunc) (const gchar *cURI);
 
88
 
 
89
typedef gchar * (*CairoDockFMGetTrashFunc) (const gchar *cNearURI, gchar **cFileInfoPath);
 
90
typedef void (*CairoDockFMEmptyTrashFunc) (void);
 
91
typedef gchar * (*CairoDockFMGetDesktopFunc) (void);
 
92
typedef void (*CairoDockFMUserActionFunc) (void);
 
93
 
 
94
/// Definition of the Desktop Environment backend.
 
95
struct _CairoDockDesktopEnvBackend {
 
96
        CairoDockFMGetFileInfoFunc              get_file_info;
 
97
        CairoDockFMFilePropertiesFunc   get_file_properties;
 
98
        CairoDockFMListDirectoryFunc    list_directory;
 
99
        CairoDockFMMeasureDirectoryFunc measure_directory;
 
100
        CairoDockFMLaunchUriFunc                launch_uri;
 
101
        CairoDockFMIsMountedFunc                is_mounted;
 
102
        CairoDockFMCanEjectFunc                 can_eject;
 
103
        CairoDockFMEjectDriveFunc               eject;
 
104
        CairoDockFMMountFunc                    mount;
 
105
        CairoDockFMUnmountFunc                  unmount;
 
106
        CairoDockFMAddMonitorFunc               add_monitor;
 
107
        CairoDockFMRemoveMonitorFunc    remove_monitor;
 
108
        CairoDockFMDeleteFileFunc               delete_file;
 
109
        CairoDockFMRenameFileFunc               rename;
 
110
        CairoDockFMMoveFileFunc                 move;
 
111
        CairoDockFMCreateFileFunc               create;
 
112
        CairoDockFMListAppsForFileFunc  list_apps_for_file;
 
113
        CairoDockFMEmptyTrashFunc               empty_trash;
 
114
        CairoDockFMGetTrashFunc                 get_trash_path;
 
115
        CairoDockFMGetDesktopFunc               get_desktop_path;
 
116
        CairoDockFMUserActionFunc               logout;
 
117
        CairoDockFMUserActionFunc               lock_screen;
 
118
        CairoDockFMUserActionFunc               shutdown;
 
119
        CairoDockFMUserActionFunc               setup_time;
 
120
        CairoDockFMUserActionFunc               show_system_monitor;
 
121
};
 
122
 
 
123
/** Register a environment backend, overwriting any previous backend.
 
124
*/
 
125
void cairo_dock_fm_register_vfs_backend (CairoDockDesktopEnvBackend *pVFSBackend);
 
126
 
 
127
/** List the content of a directory and turn it into a list of icons.
 
128
*/
 
129
GList * cairo_dock_fm_list_directory (const gchar *cURI, CairoDockFMSortType g_fm_iSortType, int iNewIconsType, gboolean bListHiddenFiles, int iNbMaxFiles, gchar **cFullURI);
 
130
 
 
131
/** Measure a directory (number of files or total size).
 
132
*/
 
133
gsize cairo_dock_fm_measure_diretory (const gchar *cBaseURI, gint iCountType, gboolean bRecursive, gint *pCancel);
 
134
 
 
135
/** Get the main info to represent a file.
 
136
*/
 
137
gboolean cairo_dock_fm_get_file_info (const gchar *cBaseURI, gchar **cName, gchar **cURI, gchar **cIconName, gboolean *bIsDirectory, int *iVolumeID, double *fOrder, CairoDockFMSortType iSortType);
 
138
 
 
139
/** Get some properties about a file.
 
140
*/
 
141
gboolean cairo_dock_fm_get_file_properties (const gchar *cURI, guint64 *iSize, time_t *iLastModificationTime, gchar **cMimeType, int *iUID, int *iGID, int *iPermissionsMask);
 
142
 
 
143
/** Open a file with the default application.
 
144
*/
 
145
gboolean cairo_dock_fm_launch_uri (const gchar *cURI);
 
146
 
 
147
/** Add a monitor on an URI. It will be called each time a modification occurs on the file.
 
148
*/
 
149
gboolean cairo_dock_fm_add_monitor_full (const gchar *cURI, gboolean bDirectory, const gchar *cMountedURI, CairoDockFMMonitorCallback pCallback, gpointer data);
 
150
 
 
151
/** Remove a monitor on an URI.
 
152
*/
 
153
gboolean cairo_dock_fm_remove_monitor_full (const gchar *cURI, gboolean bDirectory, const gchar *cMountedURI);
 
154
 
 
155
/** Mount a point.
 
156
*/
 
157
gboolean cairo_dock_fm_mount_full (const gchar *cURI, int iVolumeID, CairoDockFMMountCallback pCallback, gpointer user_data);
 
158
 
 
159
/** Unmount a point.
 
160
*/
 
161
gboolean cairo_dock_fm_unmount_full (const gchar *cURI, int iVolumeID, CairoDockFMMountCallback pCallback, gpointer user_data);
 
162
 
 
163
/** Say if a point is currently mounted.
 
164
*/
 
165
gchar *cairo_dock_fm_is_mounted (const gchar *cURI, gboolean *bIsMounted);
 
166
 
 
167
/** Say if a point can be ejected (like a CD player).
 
168
*/
 
169
gboolean cairo_dock_fm_can_eject (const gchar *cURI);
 
170
 
 
171
/** Eject a drive, like a CD player.
 
172
*/
 
173
gboolean cairo_dock_fm_eject_drive (const gchar *cURI);
 
174
 
 
175
 
 
176
/** Delete a file.
 
177
*/
 
178
gboolean cairo_dock_fm_delete_file (const gchar *cURI, gboolean bNoTrash);
 
179
 
 
180
/** Rename a file.
 
181
*/
 
182
gboolean cairo_dock_fm_rename_file (const gchar *cOldURI, const gchar *cNewName);
 
183
 
 
184
/** Move a file.
 
185
*/
 
186
gboolean cairo_dock_fm_move_file (const gchar *cURI, const gchar *cDirectoryURI);
 
187
 
 
188
/** Create a new file.
 
189
*/
 
190
gboolean cairo_dock_fm_create_file (const gchar *cURI, gboolean bDirectory);
 
191
 
 
192
/** Get the list of applications that can open a given file. Returns a list of strings arrays : {name, command, icon}.
 
193
*/
 
194
GList *cairo_dock_fm_list_apps_for_file (const gchar *cURI);
 
195
 
 
196
/** Empty the Trash.
 
197
*/
 
198
gboolean cairo_dock_fm_empty_trash (void);
 
199
 
 
200
/** Get the path to the Trash.
 
201
*/
 
202
gchar *cairo_dock_fm_get_trash_path (const gchar *cNearURI, gchar **cFileInfoPath);
 
203
/** Get the path to the Desktop.
 
204
*/
 
205
gchar *cairo_dock_fm_get_desktop_path (void);
 
206
 
 
207
/** Raise the logout panel.
 
208
*/
 
209
gboolean cairo_dock_fm_logout (void);
 
210
/** Raise the shutdown panel.
 
211
*/
 
212
gboolean cairo_dock_fm_shutdown (void);
 
213
 
 
214
/** Lock the screen.
 
215
*/
 
216
gboolean cairo_dock_fm_lock_screen (void);
 
217
 
 
218
/** Raise the panel to configure the time.
 
219
*/
 
220
gboolean cairo_dock_fm_setup_time (void);
 
221
 
 
222
/** Raise the default system monitor.
 
223
*/
 
224
gboolean cairo_dock_fm_show_system_monitor (void);
 
225
 
 
226
/** Create an Icon representing a given URI.
 
227
*/
 
228
Icon *cairo_dock_fm_create_icon_from_URI (const gchar *cURI, CairoContainer *pContainer, CairoDockFMSortType iFileSortType);
 
229
 
 
230
 
 
231
gboolean cairo_dock_fm_move_into_directory (const gchar *cURI, Icon *icon, CairoContainer *pContainer);
 
232
 
 
233
 
 
234
CairoDockDesktopEnv cairo_dock_guess_environment (void);
 
235
 
 
236
/** Get the size of a local file.
 
237
*@param cFilePath path of a file on the hard disk.
 
238
*@return the size of the file, or 0 if it doesn't exist.
 
239
*/
 
240
int cairo_dock_get_file_size (const gchar *cFilePath);
 
241
 
 
242
 
 
243
G_END_DECLS
 
244
#endif