Logo Search packages:      
Sourcecode: libdesktop-agnostic version File versions  Download package

vfs-volume.h

/*
 * Desktop Agnostic Library: VFS Volume interface.
 *
 * Copyright (C) 2009 Mark Lee <libdesktop-agnostic@lazymalevolence.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * Author : Mark Lee <libdesktop-agnostic@lazymalevolence.com>
 */

#ifndef __LIBDESKTOP_AGNOSTIC_VFS_VOLUME_H__
#define __LIBDESKTOP_AGNOSTIC_VFS_VOLUME_H__

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <libdesktop-agnostic/vfs-file.h>

G_BEGIN_DECLS


#define DESKTOP_AGNOSTIC_VFS_VOLUME_TYPE_BACKEND (desktop_agnostic_vfs_volume_backend_get_type ())
#define DESKTOP_AGNOSTIC_VFS_VOLUME_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DESKTOP_AGNOSTIC_VFS_VOLUME_TYPE_BACKEND, DesktopAgnosticVFSVolumeBackend))
#define DESKTOP_AGNOSTIC_VFS_VOLUME_IS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DESKTOP_AGNOSTIC_VFS_VOLUME_TYPE_BACKEND))
#define DESKTOP_AGNOSTIC_VFS_VOLUME_BACKEND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), DESKTOP_AGNOSTIC_VFS_VOLUME_TYPE_BACKEND, DesktopAgnosticVFSVolumeBackendIface))

typedef struct _DesktopAgnosticVFSVolumeBackend DesktopAgnosticVFSVolumeBackend;
typedef struct _DesktopAgnosticVFSVolumeBackendIface DesktopAgnosticVFSVolumeBackendIface;
typedef void (*DesktopAgnosticVFSVolumeCallback) (DesktopAgnosticVFSVolumeBackend* vol, void* user_data);

#define DESKTOP_AGNOSTIC_VFS_VOLUME_TYPE_MONITOR (desktop_agnostic_vfs_volume_monitor_get_type ())
#define DESKTOP_AGNOSTIC_VFS_VOLUME_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DESKTOP_AGNOSTIC_VFS_VOLUME_TYPE_MONITOR, DesktopAgnosticVFSVolumeMonitor))
#define DESKTOP_AGNOSTIC_VFS_VOLUME_IS_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DESKTOP_AGNOSTIC_VFS_VOLUME_TYPE_MONITOR))
#define DESKTOP_AGNOSTIC_VFS_VOLUME_MONITOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), DESKTOP_AGNOSTIC_VFS_VOLUME_TYPE_MONITOR, DesktopAgnosticVFSVolumeMonitorIface))

typedef struct _DesktopAgnosticVFSVolumeMonitor DesktopAgnosticVFSVolumeMonitor;
typedef struct _DesktopAgnosticVFSVolumeMonitorIface DesktopAgnosticVFSVolumeMonitorIface;

typedef enum  {
      DESKTOP_AGNOSTIC_VFS_VOLUME_ERROR_MOUNT,
      DESKTOP_AGNOSTIC_VFS_VOLUME_ERROR_UNMOUNT,
      DESKTOP_AGNOSTIC_VFS_VOLUME_ERROR_EJECT
} DesktopAgnosticVFSVolumeError;
#define DESKTOP_AGNOSTIC_VFS_VOLUME_ERROR desktop_agnostic_vfs_volume_error_quark ()
struct _DesktopAgnosticVFSVolumeBackendIface {
      GTypeInterface parent_iface;
      gboolean (*is_mounted) (DesktopAgnosticVFSVolumeBackend* self);
      void (*mount) (DesktopAgnosticVFSVolumeBackend* self, DesktopAgnosticVFSVolumeCallback callback, void* callback_target);
      gboolean (*mount_finish) (DesktopAgnosticVFSVolumeBackend* self, GError** error);
      void (*unmount) (DesktopAgnosticVFSVolumeBackend* self, DesktopAgnosticVFSVolumeCallback callback, void* callback_target);
      gboolean (*unmount_finish) (DesktopAgnosticVFSVolumeBackend* self, GError** error);
      gboolean (*can_eject) (DesktopAgnosticVFSVolumeBackend* self);
      void (*eject) (DesktopAgnosticVFSVolumeBackend* self, DesktopAgnosticVFSVolumeCallback callback, void* callback_target);
      gboolean (*eject_finish) (DesktopAgnosticVFSVolumeBackend* self, GError** error);
      char* (*get_name) (DesktopAgnosticVFSVolumeBackend* self);
      DesktopAgnosticVFSFileBackend* (*get_uri) (DesktopAgnosticVFSVolumeBackend* self);
      char* (*get_icon) (DesktopAgnosticVFSVolumeBackend* self);
};

struct _DesktopAgnosticVFSVolumeMonitorIface {
      GTypeInterface parent_iface;
      void* (*get_implementation) (DesktopAgnosticVFSVolumeMonitor* self);
      GList* (*get_volumes) (DesktopAgnosticVFSVolumeMonitor* self);
};


GQuark desktop_agnostic_vfs_volume_error_quark (void);
gboolean desktop_agnostic_vfs_volume_backend_is_mounted (DesktopAgnosticVFSVolumeBackend* self);
void desktop_agnostic_vfs_volume_backend_mount (DesktopAgnosticVFSVolumeBackend* self, DesktopAgnosticVFSVolumeCallback callback, void* callback_target);
gboolean desktop_agnostic_vfs_volume_backend_mount_finish (DesktopAgnosticVFSVolumeBackend* self, GError** error);
void desktop_agnostic_vfs_volume_backend_unmount (DesktopAgnosticVFSVolumeBackend* self, DesktopAgnosticVFSVolumeCallback callback, void* callback_target);
gboolean desktop_agnostic_vfs_volume_backend_unmount_finish (DesktopAgnosticVFSVolumeBackend* self, GError** error);
gboolean desktop_agnostic_vfs_volume_backend_can_eject (DesktopAgnosticVFSVolumeBackend* self);
void desktop_agnostic_vfs_volume_backend_eject (DesktopAgnosticVFSVolumeBackend* self, DesktopAgnosticVFSVolumeCallback callback, void* callback_target);
gboolean desktop_agnostic_vfs_volume_backend_eject_finish (DesktopAgnosticVFSVolumeBackend* self, GError** error);
char* desktop_agnostic_vfs_volume_backend_get_name (DesktopAgnosticVFSVolumeBackend* self);
DesktopAgnosticVFSFileBackend* desktop_agnostic_vfs_volume_backend_get_uri (DesktopAgnosticVFSVolumeBackend* self);
char* desktop_agnostic_vfs_volume_backend_get_icon (DesktopAgnosticVFSVolumeBackend* self);
GType desktop_agnostic_vfs_volume_backend_get_type (void);
void* desktop_agnostic_vfs_volume_monitor_get_implementation (DesktopAgnosticVFSVolumeMonitor* self);
GList* desktop_agnostic_vfs_volume_monitor_get_volumes (DesktopAgnosticVFSVolumeMonitor* self);
GType desktop_agnostic_vfs_volume_monitor_get_type (void);


G_END_DECLS

#endif

Generated by  Doxygen 1.6.0   Back to index