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

vfs-file.h

/* 
 * Desktop Agnostic Library: File interface (similar to GFile).
 *
 * 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_FILE_H__
#define __LIBDESKTOP_AGNOSTIC_VFS_FILE_H__

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>

G_BEGIN_DECLS

typedef struct _DesktopAgnosticVFSFileBackend DesktopAgnosticVFSFileBackend;
typedef struct _DesktopAgnosticVFSFileBackendClass DesktopAgnosticVFSFileBackendClass;
typedef struct _DesktopAgnosticVFSFileMonitor DesktopAgnosticVFSFileMonitor;
typedef struct _DesktopAgnosticVFSFileMonitorIface DesktopAgnosticVFSFileMonitorIface;

#define DESKTOP_AGNOSTIC_VFS_FILE_TYPE_FILE_TYPE (desktop_agnostic_vfs_file_file_type_get_type ())

#define DESKTOP_AGNOSTIC_VFS_FILE_TYPE_BACKEND (desktop_agnostic_vfs_file_backend_get_type ())
#define DESKTOP_AGNOSTIC_VFS_FILE_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DESKTOP_AGNOSTIC_VFS_FILE_TYPE_BACKEND, DesktopAgnosticVFSFileBackend))
#define DESKTOP_AGNOSTIC_VFS_FILE_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DESKTOP_AGNOSTIC_VFS_FILE_TYPE_BACKEND, DesktopAgnosticVFSFileBackendClass))
#define DESKTOP_AGNOSTIC_VFS_FILE_IS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DESKTOP_AGNOSTIC_VFS_FILE_TYPE_BACKEND))
#define DESKTOP_AGNOSTIC_VFS_FILE_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DESKTOP_AGNOSTIC_VFS_FILE_TYPE_BACKEND))
#define DESKTOP_AGNOSTIC_VFS_FILE_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DESKTOP_AGNOSTIC_VFS_FILE_TYPE_BACKEND, DesktopAgnosticVFSFileBackendClass))

typedef struct _DesktopAgnosticVFSFileBackendPrivate DesktopAgnosticVFSFileBackendPrivate;

/**
   * The kinds of files recognized by the File backends.
   */
typedef enum  {
      DESKTOP_AGNOSTIC_VFS_FILE_FILE_TYPE_UNKNOWN = 0,
      DESKTOP_AGNOSTIC_VFS_FILE_FILE_TYPE_REGULAR,
      DESKTOP_AGNOSTIC_VFS_FILE_FILE_TYPE_DIRECTORY,
      DESKTOP_AGNOSTIC_VFS_FILE_FILE_TYPE_SYMBOLIC_LINK,
      DESKTOP_AGNOSTIC_VFS_FILE_FILE_TYPE_SPECIAL
} DesktopAgnosticVFSFileFileType;

/**
   * Abstract base class for representations of files.
   */
00063 struct _DesktopAgnosticVFSFileBackend {
      GObject parent_instance;
      DesktopAgnosticVFSFileBackendPrivate * priv;
};

struct _DesktopAgnosticVFSFileBackendClass {
      GObjectClass parent_class;
      void (*init) (DesktopAgnosticVFSFileBackend* self, const char* uri);
      DesktopAgnosticVFSFileMonitor* (*monitor) (DesktopAgnosticVFSFileBackend* self);
      void* (*get_implementation) (DesktopAgnosticVFSFileBackend* self);
      char* (*get_impl_uri) (DesktopAgnosticVFSFileBackend* self);
      char* (*get_impl_path) (DesktopAgnosticVFSFileBackend* self);
      gboolean (*get_exists) (DesktopAgnosticVFSFileBackend* self);
      DesktopAgnosticVFSFileFileType (*get_file_type) (DesktopAgnosticVFSFileBackend* self);
};


GType desktop_agnostic_vfs_file_file_type_get_type (void);
void desktop_agnostic_vfs_file_backend_init (DesktopAgnosticVFSFileBackend* self, const char* uri);
DesktopAgnosticVFSFileMonitor* desktop_agnostic_vfs_file_backend_monitor (DesktopAgnosticVFSFileBackend* self);
void* desktop_agnostic_vfs_file_backend_get_implementation (DesktopAgnosticVFSFileBackend* self);
char* desktop_agnostic_vfs_file_backend_get_impl_uri (DesktopAgnosticVFSFileBackend* self);
const char* desktop_agnostic_vfs_file_backend_get_uri (DesktopAgnosticVFSFileBackend* self);
char* desktop_agnostic_vfs_file_backend_get_impl_path (DesktopAgnosticVFSFileBackend* self);
char* desktop_agnostic_vfs_file_backend_get_path (DesktopAgnosticVFSFileBackend* self);
gboolean desktop_agnostic_vfs_file_backend_get_exists (DesktopAgnosticVFSFileBackend* self);
DesktopAgnosticVFSFileFileType desktop_agnostic_vfs_file_backend_get_file_type (DesktopAgnosticVFSFileBackend* self);
GType desktop_agnostic_vfs_file_backend_get_type (void);


G_END_DECLS

#endif

Generated by  Doxygen 1.6.0   Back to index