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

« back to all changes in this revision

Viewing changes to src/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-struct.h"
25
 
#include "cairo-dock-icons.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
 
typedef enum {
35
 
        CAIRO_DOCK_UNKNOWN_ENV=0,
36
 
        CAIRO_DOCK_GNOME,
37
 
        CAIRO_DOCK_KDE,
38
 
        CAIRO_DOCK_XFCE,
39
 
        CAIRO_DOCK_NB_DESKTOPS
40
 
        } CairoDockDesktopEnv;
41
 
 
42
 
/// type of events that can occur to a file.
43
 
typedef enum {
44
 
        CAIRO_DOCK_FILE_MODIFIED=0,
45
 
        CAIRO_DOCK_FILE_DELETED,
46
 
        CAIRO_DOCK_FILE_CREATED,
47
 
        CAIRO_DOCK_NB_EVENT_ON_FILES
48
 
        } CairoDockFMEventType;
49
 
 
50
 
/// Type of sorting available on files.
51
 
typedef enum {
52
 
        CAIRO_DOCK_FM_SORT_BY_NAME=0,
53
 
        CAIRO_DOCK_FM_SORT_BY_DATE,
54
 
        CAIRO_DOCK_FM_SORT_BY_SIZE,
55
 
        CAIRO_DOCK_FM_SORT_BY_TYPE,
56
 
        CAIRO_DOCK_NB_SORT_ON_FILE
57
 
        } CairoDockFMSortType;
58
 
 
59
 
#define CAIRO_DOCK_FM_VFS_ROOT "_vfsroot_"
60
 
#define CAIRO_DOCK_FM_NETWORK "_network_"
61
 
#define CAIRO_DOCK_FM_TRASH "_trash_"
62
 
#define CAIRO_DOCK_FM_DESKTOP "_desktop_"
63
 
 
64
 
typedef void (*CairoDockFMGetFileInfoFunc) (const gchar *cBaseURI, gchar **cName, gchar **cURI, gchar **cIconName, gboolean *bIsDirectory, int *iVolumeID, double *fOrder, CairoDockFMSortType iSortType);
65
 
typedef void (*CairoDockFMFilePropertiesFunc) (const gchar *cURI, guint64 *iSize, time_t *iLastModificationTime, gchar **cMimeType, int *iUID, int *iGID, int *iPermissionsMask);
66
 
typedef GList * (*CairoDockFMListDirectoryFunc) (const gchar *cURI, CairoDockFMSortType g_fm_iSortType, int iNewIconsType, gboolean bListHiddenFiles, gchar **cFullURI);
67
 
typedef void (*CairoDockFMLaunchUriFunc) (const gchar *cURI);
68
 
 
69
 
typedef gchar * (*CairoDockFMIsMountedFunc) (const gchar *cURI, gboolean *bIsMounted);
70
 
typedef gboolean (*CairoDockFMCanEjectFunc) (const gchar *cURI);
71
 
typedef gboolean (*CairoDockFMEjectDriveFunc) (const gchar *cURI);
72
 
 
73
 
typedef void (*CairoDockFMMountCallback) (gboolean bMounting, gboolean bSuccess, const gchar *cName, Icon *icon, CairoContainer *pContainer);
74
 
typedef void (*CairoDockFMMountFunc) (const gchar *cURI, int iVolumeID, CairoDockFMMountCallback pCallback, Icon *icon, CairoContainer *pContainer);
75
 
typedef void (*CairoDockFMUnmountFunc) (const gchar *cURI, int iVolumeID, CairoDockFMMountCallback pCallback, Icon *icon, CairoContainer *pContainer);
76
 
 
77
 
typedef void (*CairoDockFMMonitorCallback) (CairoDockFMEventType iEventType, const gchar *cURI, gpointer data);
78
 
typedef void (*CairoDockFMAddMonitorFunc) (const gchar *cURI, gboolean bDirectory, CairoDockFMMonitorCallback pCallback, gpointer data);
79
 
typedef void (*CairoDockFMRemoveMonitorFunc) (const gchar *cURI);
80
 
 
81
 
typedef gboolean (*CairoDockFMDeleteFileFunc) (const gchar *cURI);
82
 
typedef gboolean (*CairoDockFMRenameFileFunc) (const gchar *cOldURI, const gchar *cNewName);
83
 
typedef gboolean (*CairoDockFMMoveFileFunc) (const gchar *cURI, const gchar *cDirectoryURI);
84
 
 
85
 
typedef gchar * (*CairoDockFMGetTrashFunc) (const gchar *cNearURI, gchar **cFileInfoPath);
86
 
typedef gchar * (*CairoDockFMGetDesktopFunc) (void);
87
 
typedef void (*CairoDockFMUserActionFunc) (void);
88
 
 
89
 
/// Definition of the Desktop Environment backend.
90
 
struct _CairoDockDesktopEnvBackend {
91
 
        CairoDockFMGetFileInfoFunc              get_file_info;
92
 
        CairoDockFMFilePropertiesFunc   get_file_properties;
93
 
        CairoDockFMListDirectoryFunc    list_directory;
94
 
        CairoDockFMLaunchUriFunc                launch_uri;
95
 
        CairoDockFMIsMountedFunc                is_mounted;
96
 
        CairoDockFMCanEjectFunc                 can_eject;
97
 
        CairoDockFMEjectDriveFunc               eject;
98
 
        CairoDockFMMountFunc                    mount;
99
 
        CairoDockFMUnmountFunc          unmount;
100
 
        CairoDockFMAddMonitorFunc       add_monitor;
101
 
        CairoDockFMRemoveMonitorFunc    remove_monitor;
102
 
        CairoDockFMDeleteFileFunc               delete_file;
103
 
        CairoDockFMRenameFileFunc       rename;
104
 
        CairoDockFMMoveFileFunc                 move;
105
 
        CairoDockFMGetTrashFunc                 get_trash_path;
106
 
        CairoDockFMGetDesktopFunc       get_desktop_path;
107
 
        CairoDockFMUserActionFunc               logout;
108
 
        CairoDockFMUserActionFunc               shutdown;
109
 
        CairoDockFMUserActionFunc               setup_time;
110
 
        CairoDockFMUserActionFunc               show_system_monitor;
111
 
};
112
 
 
113
 
/** Register a environment backend, overwriting any previous backend.
114
 
*/
115
 
void cairo_dock_fm_register_vfs_backend (CairoDockDesktopEnvBackend *pVFSBackend);
116
 
 
117
 
/** List the content of a directory and turn it into a list of icons.
118
 
*/
119
 
GList * cairo_dock_fm_list_directory (const gchar *cURI, CairoDockFMSortType g_fm_iSortType, int iNewIconsType, gboolean bListHiddenFiles, gchar **cFullURI);
120
 
 
121
 
/** Get the main info to represent a file.
122
 
*/
123
 
gboolean cairo_dock_fm_get_file_info (const gchar *cBaseURI, gchar **cName, gchar **cURI, gchar **cIconName, gboolean *bIsDirectory, int *iVolumeID, double *fOrder, CairoDockFMSortType iSortType);
124
 
 
125
 
/** Get some properties about a file.
126
 
*/
127
 
gboolean cairo_dock_fm_get_file_properties (const gchar *cURI, guint64 *iSize, time_t *iLastModificationTime, gchar **cMimeType, int *iUID, int *iGID, int *iPermissionsMask);
128
 
 
129
 
/** Open a file with the default application.
130
 
*/
131
 
gboolean cairo_dock_fm_launch_uri (const gchar *cURI);
132
 
 
133
 
/** Add a monitor on an URI. It will be called each time a modification occurs on the file.
134
 
*/
135
 
gboolean cairo_dock_fm_add_monitor_full (const gchar *cURI, gboolean bDirectory, const gchar *cMountedURI, CairoDockFMMonitorCallback pCallback, gpointer data);
136
 
/** Add a monitor on an icon representing an URI.
137
 
*/
138
 
#define cairo_dock_fm_add_monitor(pIcon) cairo_dock_fm_add_monitor_full (pIcon->cBaseURI, (pIcon->pSubDock != NULL), (pIcon->iVolumeID != 0 ? pIcon->cCommand : NULL), (CairoDockFMMonitorCallback) cairo_dock_fm_action_on_file_event, (gpointer) pIcon)
139
 
 
140
 
/** Remove a monitor on an URI.
141
 
*/
142
 
gboolean cairo_dock_fm_remove_monitor_full (const gchar *cURI, gboolean bDirectory, const gchar *cMountedURI);
143
 
/** Remove a monitor on an icon representing an URI.
144
 
*/
145
 
#define cairo_dock_fm_remove_monitor(pIcon) cairo_dock_fm_remove_monitor_full (pIcon->cBaseURI, (pIcon->pSubDock != NULL), (pIcon->iVolumeID != 0 ? pIcon->cCommand : NULL))
146
 
 
147
 
 
148
 
/** Mount a point.
149
 
*/
150
 
gboolean cairo_dock_fm_mount_full (const gchar *cURI, int iVolumeID, CairoDockFMMountCallback pCallback, Icon *icon, CairoContainer *pContainer);
151
 
/** Mount an icon representing an URI.
152
 
*/
153
 
#define cairo_dock_fm_mount(icon, pContainer) cairo_dock_fm_mount_full (icon->cBaseURI, icon->iVolumeID, cairo_dock_fm_action_after_mounting, icon, pContainer)
154
 
 
155
 
/** Unmount a point.
156
 
*/
157
 
gboolean cairo_dock_fm_unmount_full (const gchar *cURI, int iVolumeID, CairoDockFMMountCallback pCallback, Icon *icon, CairoContainer *pContainer);
158
 
/** Unmount an icon representing an URI.
159
 
*/
160
 
#define cairo_dock_fm_unmount(icon, pContainer) cairo_dock_fm_unmount_full (icon->cBaseURI, icon->iVolumeID, cairo_dock_fm_action_after_mounting, icon, pContainer)
161
 
 
162
 
/** Say if a point is currently mounted.
163
 
*/
164
 
gchar *cairo_dock_fm_is_mounted (const gchar *cURI, gboolean *bIsMounted);
165
 
 
166
 
/** Say if a point can be ejected (like a CD player).
167
 
*/
168
 
gboolean cairo_dock_fm_can_eject (const gchar *cURI);
169
 
/** Eject a drive, like a CD player.
170
 
*/
171
 
gboolean cairo_dock_fm_eject_drive (const gchar *cURI);
172
 
 
173
 
 
174
 
/** Delete a file.
175
 
*/
176
 
gboolean cairo_dock_fm_delete_file (const gchar *cURI);
177
 
 
178
 
/** Rename a file.
179
 
*/
180
 
gboolean cairo_dock_fm_rename_file (const gchar *cOldURI, const gchar *cNewName);
181
 
 
182
 
/** Move a file.
183
 
*/
184
 
gboolean cairo_dock_fm_move_file (const gchar *cURI, const gchar *cDirectoryURI);
185
 
 
186
 
/** Get the path to the Trash.
187
 
*/
188
 
gchar *cairo_dock_fm_get_trash_path (const gchar *cNearURI, gchar **cFileInfoPath);
189
 
/** Get the path to the Desktop.
190
 
*/
191
 
gchar *cairo_dock_fm_get_desktop_path (void);
192
 
 
193
 
/** Raise the logout panel.
194
 
*/
195
 
gboolean cairo_dock_fm_logout (void);
196
 
/** Raise the shutdown panel.
197
 
*/
198
 
gboolean cairo_dock_fm_shutdown (void);
199
 
 
200
 
/** Raise the panel to configure the time.
201
 
*/
202
 
gboolean cairo_dock_fm_setup_time (void);
203
 
 
204
 
/** Raise the default system monitor.
205
 
*/
206
 
gboolean cairo_dock_fm_show_system_monitor (void);
207
 
 
208
 
/** Create an Icon representing a given URI.
209
 
*/
210
 
Icon *cairo_dock_fm_create_icon_from_URI (const gchar *cURI, CairoContainer *pContainer);
211
 
 
212
 
/** Create a Dock with the list of icons representing a folder.
213
 
*/
214
 
void cairo_dock_fm_create_dock_from_directory (Icon *pIcon, CairoDock *pParentDock);
215
 
 
216
 
 
217
 
void cairo_dock_fm_manage_event_on_file (CairoDockFMEventType iEventType, const gchar *cURI, Icon *pIcon, CairoDockIconType iTypeOnCreation);
218
 
void cairo_dock_fm_action_on_file_event (CairoDockFMEventType iEventType, const gchar *cURI, Icon *pIcon);
219
 
 
220
 
void cairo_dock_fm_action_after_mounting (gboolean bMounting, gboolean bSuccess, const gchar *cName, Icon *icon, CairoContainer *pContainer);
221
 
 
222
 
 
223
 
gboolean cairo_dock_fm_move_into_directory (const gchar *cURI, Icon *icon, CairoContainer *pContainer);
224
 
 
225
 
 
226
 
CairoDockDesktopEnv cairo_dock_guess_environment (void);
227
 
 
228
 
/** Get the size of a local file.
229
 
*@param cFilePath path of a file on the hard disk.
230
 
*@return the size of the file, or 0 if it doesn't exist.
231
 
*/
232
 
int cairo_dock_get_file_size (const gchar *cFilePath);
233
 
 
234
 
 
235
 
G_END_DECLS
236
 
#endif