Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

gphoto2-abilities-list.h

Go to the documentation of this file.
/** \file gphoto2-abilities-list.h
 * \brief List of supported camera models including their abilities.
 *
 * \author Copyright 2000 Scott Fritzinger
 *
 * \par
 * 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 of the License, or (at your option) any later version.
 *
 * \par
 * 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. 
 *
 * \par
 * 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., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __GPHOTO2_ABILITIES_LIST_H__
#define __GPHOTO2_ABILITIES_LIST_H__

#include <gphoto2/gphoto2-context.h>
#include <gphoto2/gphoto2-list.h>
#include <gphoto2/gphoto2-port-info-list.h>

#include <gphoto2/gphoto2-port-log.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/**
 * Current implementation status of the camera driver.
 */
00041 typedef enum {
00042       GP_DRIVER_STATUS_PRODUCTION,  /**< Driver is production ready. */
00043       GP_DRIVER_STATUS_TESTING,     /**< Driver is beta quality. */
00044       GP_DRIVER_STATUS_EXPERIMENTAL,      /**< Driver is alpha quality and might even not work. */
00045       GP_DRIVER_STATUS_DEPRECATED   /**< Driver is no longer recommended to use and will be removed. */
} CameraDriverStatus;

/**
 * Type of the device represented. Currently we have Still Cameras
 * and MTP Audio Players.
 */
00052 typedef enum {
00053         GP_DEVICE_STILL_CAMERA          = 0,     /**< Traditional still camera */
00054         GP_DEVICE_AUDIO_PLAYER          = 1 << 0 /**< Audio player */
} GphotoDeviceType;

/**
 * A bitmask of remote control related operations of the device.
 * Some drivers might support additional dynamic capabilities (like the PTP driver).
 */
00061 typedef enum {
00062         GP_OPERATION_NONE           = 0,    /**< No remote control operation supported. */
00063         GP_OPERATION_CAPTURE_IMAGE      = 1 << 0, /**< Capturing images supported. */
00064         GP_OPERATION_CAPTURE_VIDEO      = 1 << 1, /**< Capturing videos supported. */
00065         GP_OPERATION_CAPTURE_AUDIO      = 1 << 2, /**< Capturing audio supported. */
00066         GP_OPERATION_CAPTURE_PREVIEW    = 1 << 3, /**< Capturing image previews supported. */
00067         GP_OPERATION_CONFIG             = 1 << 4  /**< Camera and Driver configuration supported. */
} CameraOperation;

/**
 * A bitmask of image related operations of the device.
 */
00073 typedef enum {
00074         GP_FILE_OPERATION_NONE          = 0,      /**< No special file operations, just download. */
00075         GP_FILE_OPERATION_DELETE        = 1 << 1, /**< Deletion of files is possible. */
00076         GP_FILE_OPERATION_PREVIEW       = 1 << 3, /**< Previewing viewfinder content is possible. */
00077         GP_FILE_OPERATION_RAW           = 1 << 4, /**< Raw retrieval is possible (used by non-JPEG cameras) */
00078         GP_FILE_OPERATION_AUDIO         = 1 << 5, /**< Audio retrieval is possible. */
00079         GP_FILE_OPERATION_EXIF          = 1 << 6  /**< EXIF retrieval is possible. */
} CameraFileOperation;

/**
 * A bitmask of filesystem related operations of the device.
 */
00085 typedef enum {
00086         GP_FOLDER_OPERATION_NONE        = 0,      /**< No special filesystem operation. */
00087         GP_FOLDER_OPERATION_DELETE_ALL  = 1 << 0, /**< Deletion of all files on the device. */
00088         GP_FOLDER_OPERATION_PUT_FILE    = 1 << 1, /**< Upload of files to the device possible. */
00089         GP_FOLDER_OPERATION_MAKE_DIR    = 1 << 2, /**< Making directories on the device possible. */
00090         GP_FOLDER_OPERATION_REMOVE_DIR  = 1 << 3  /**< Removing directories from the device possible. */
} CameraFolderOperation;

#ifdef _GPHOTO2_INTERNAL_CODE

  /* enum CameraOperation */
  extern const StringFlagItem gpi_camera_operation_map[];

  /* enum CameraFileOperation */
  extern const StringFlagItem gpi_file_operation_map[];

  /* enum CameraFolderOperation */
  extern const StringFlagItem gpi_folder_operation_map[];

  /* enum GphotoDeviceType */
  extern const StringFlagItem gpi_gphoto_device_type_map[];

  /* enum CameraDriverStatus */
  extern const StringFlagItem gpi_camera_driver_status_map[];

#endif /* _GPHOTO2_INTERNAL_CODE */


/** 
 * \brief Describes the properties of a specific camera.
 *
 * The internals of this structures are used extensively by the
 * camlibs, but the status regarding use by frontends is questionable.
 */
00119 typedef struct {
00120         char model [128];                 /**< \brief name of camera model */
00121         CameraDriverStatus status;        /**< \brief driver quality */

      /** \brief Supported port types. */
00124       GPPortType port;
      /** \brief Supported serial port speeds (terminated with a value of 0). */
00126         int speed [64];

        /* Supported operations */
00129         CameraOperation       operations; /**< \brief Camera operation funcs */
00130         CameraFileOperation   file_operations;  /**< \brief Camera file op funcs */
00131         CameraFolderOperation folder_operations;/**< \brief Camera folder op funcs */

00133       int usb_vendor;         /**< \brief USB Vendor D */
00134       int usb_product;  /**< \brief USB Product ID */
00135       int usb_class;          /**< \brief USB device class */
00136       int usb_subclass; /**< \brief USB device subclass */
00137       int usb_protocol; /**< \brief USB device protocol */

        /* For core use */
00140         char library [1024];  /**< \brief (Internal) library filename */
00141         char id [1024];       /**< \brief (Internal) camera ID name */

00143       GphotoDeviceType  device_type;      /**< \brief Device type. */
      /** Reserved space to use in the future w/out changing the 
       * struct size */
00146         int reserved2;        /**< reserved space \internal */
00147         int reserved3;        /**< reserved space \internal */
00148         int reserved4;        /**< reserved space \internal */
00149         int reserved5;        /**< reserved space \internal */
00150         int reserved6;        /**< reserved space \internal */
00151         int reserved7;        /**< reserved space \internal */
00152         int reserved8;        /**< reserved space \internal */
} CameraAbilities;


/**
 * \brief List of supported camera models including their abilities
 *
 * The internals of this list are hidden - use the access functions.
 */
00161 typedef struct _CameraAbilitiesList CameraAbilitiesList;


int gp_abilities_list_new    (CameraAbilitiesList **list);
int gp_abilities_list_free   (CameraAbilitiesList *list);

int gp_abilities_list_load   (CameraAbilitiesList *list, GPContext *context);
int gp_abilities_list_reset  (CameraAbilitiesList *list);

int gp_abilities_list_detect (CameraAbilitiesList *list,
                        GPPortInfoList *info_list, CameraList *l,
                        GPContext *context);

int gp_abilities_list_append (CameraAbilitiesList *list,
                        CameraAbilities abilities);

int gp_abilities_list_count  (CameraAbilitiesList *list);

int gp_abilities_list_lookup_model (CameraAbilitiesList *list,
                            const char *model);

int gp_abilities_list_get_abilities (CameraAbilitiesList *list, int index,
                             CameraAbilities *abilities);

const char *gp_message_codeset (const char *);


/**
 * Name of the environment variable which may contain the path where
 * to look for the camlibs. If this environment variable is not defined,
 * use the compiled-in default constant.
 *
 * \internal Internal use only.
 */
#ifdef _GPHOTO2_INTERNAL_CODE
#define CAMLIBDIR_ENV "CAMLIBS"
#endif /* _GPHOTO2_INTERNAL_CODE */


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __GPHOTO2_ABILITIES_LIST_H__ */

Generated by  Doxygen 1.6.0   Back to index