gphoto2-abilities-list.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /** \file gphoto2-abilities-list.h
  2. * \brief List of supported camera models including their abilities.
  3. *
  4. * \author Copyright 2000 Scott Fritzinger
  5. *
  6. * \par
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * \par
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * \par
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. * Boston, MA 02110-1301 USA
  23. */
  24. #ifndef __GPHOTO2_ABILITIES_LIST_H__
  25. #define __GPHOTO2_ABILITIES_LIST_H__
  26. #include <gphoto2/gphoto2-context.h>
  27. #include <gphoto2/gphoto2-list.h>
  28. #include <gphoto2/gphoto2-port-info-list.h>
  29. #include <gphoto2/gphoto2-port-log.h>
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif /* __cplusplus */
  33. /**
  34. * Current implementation status of the camera driver.
  35. */
  36. typedef enum {
  37. GP_DRIVER_STATUS_PRODUCTION, /**< Driver is production ready. */
  38. GP_DRIVER_STATUS_TESTING, /**< Driver is beta quality. */
  39. GP_DRIVER_STATUS_EXPERIMENTAL, /**< Driver is alpha quality and might even not work. */
  40. GP_DRIVER_STATUS_DEPRECATED /**< Driver is no longer recommended to use and will be removed. */
  41. } CameraDriverStatus;
  42. /**
  43. * Type of the device represented. Currently we have Still Cameras
  44. * and MTP Audio Players.
  45. */
  46. typedef enum {
  47. GP_DEVICE_STILL_CAMERA = 0, /**< Traditional still camera */
  48. GP_DEVICE_AUDIO_PLAYER = 1 << 0 /**< Audio player */
  49. } GphotoDeviceType;
  50. /**
  51. * A bitmask of remote control related operations of the device.
  52. * Some drivers might support additional dynamic capabilities (like the PTP driver).
  53. */
  54. typedef enum {
  55. GP_OPERATION_NONE = 0, /**< No remote control operation supported. */
  56. GP_OPERATION_CAPTURE_IMAGE = 1 << 0, /**< Capturing images supported. */
  57. GP_OPERATION_CAPTURE_VIDEO = 1 << 1, /**< Capturing videos supported. */
  58. GP_OPERATION_CAPTURE_AUDIO = 1 << 2, /**< Capturing audio supported. */
  59. GP_OPERATION_CAPTURE_PREVIEW = 1 << 3, /**< Capturing image previews supported. */
  60. GP_OPERATION_CONFIG = 1 << 4, /**< Camera and Driver configuration supported. */
  61. GP_OPERATION_TRIGGER_CAPTURE = 1 << 5 /**< Camera can trigger capture and wait for events. */
  62. } CameraOperation;
  63. /**
  64. * A bitmask of image related operations of the device.
  65. */
  66. typedef enum {
  67. GP_FILE_OPERATION_NONE = 0, /**< No special file operations, just download. */
  68. GP_FILE_OPERATION_DELETE = 1 << 1, /**< Deletion of files is possible. */
  69. GP_FILE_OPERATION_PREVIEW = 1 << 3, /**< Previewing viewfinder content is possible. */
  70. GP_FILE_OPERATION_RAW = 1 << 4, /**< Raw retrieval is possible (used by non-JPEG cameras) */
  71. GP_FILE_OPERATION_AUDIO = 1 << 5, /**< Audio retrieval is possible. */
  72. GP_FILE_OPERATION_EXIF = 1 << 6 /**< EXIF retrieval is possible. */
  73. } CameraFileOperation;
  74. /**
  75. * A bitmask of filesystem related operations of the device.
  76. */
  77. typedef enum {
  78. GP_FOLDER_OPERATION_NONE = 0, /**< No special filesystem operation. */
  79. GP_FOLDER_OPERATION_DELETE_ALL = 1 << 0, /**< Deletion of all files on the device. */
  80. GP_FOLDER_OPERATION_PUT_FILE = 1 << 1, /**< Upload of files to the device possible. */
  81. GP_FOLDER_OPERATION_MAKE_DIR = 1 << 2, /**< Making directories on the device possible. */
  82. GP_FOLDER_OPERATION_REMOVE_DIR = 1 << 3 /**< Removing directories from the device possible. */
  83. } CameraFolderOperation;
  84. #ifdef _GPHOTO2_INTERNAL_CODE
  85. /* enum CameraOperation */
  86. extern const StringFlagItem gpi_camera_operation_map[];
  87. /* enum CameraFileOperation */
  88. extern const StringFlagItem gpi_file_operation_map[];
  89. /* enum CameraFolderOperation */
  90. extern const StringFlagItem gpi_folder_operation_map[];
  91. /* enum GphotoDeviceType */
  92. extern const StringFlagItem gpi_gphoto_device_type_map[];
  93. /* enum CameraDriverStatus */
  94. extern const StringFlagItem gpi_camera_driver_status_map[];
  95. #endif /* _GPHOTO2_INTERNAL_CODE */
  96. /**
  97. * \brief Describes the properties of a specific camera.
  98. *
  99. * The internals of this structures are used extensively by the
  100. * camlibs, but the status regarding use by frontends is questionable.
  101. */
  102. typedef struct {
  103. char model [128]; /**< \brief name of camera model */
  104. CameraDriverStatus status; /**< \brief driver quality */
  105. /** \brief Supported port types. */
  106. GPPortType port;
  107. /** \brief Supported serial port speeds (terminated with a value of 0). */
  108. int speed [64];
  109. /* Supported operations */
  110. CameraOperation operations; /**< \brief Camera operation funcs */
  111. CameraFileOperation file_operations; /**< \brief Camera file op funcs */
  112. CameraFolderOperation folder_operations;/**< \brief Camera folder op funcs */
  113. int usb_vendor; /**< \brief USB Vendor D */
  114. int usb_product; /**< \brief USB Product ID */
  115. int usb_class; /**< \brief USB device class */
  116. int usb_subclass; /**< \brief USB device subclass */
  117. int usb_protocol; /**< \brief USB device protocol */
  118. /* For core use */
  119. char library [1024]; /**< \brief (Internal) library filename */
  120. char id [1024]; /**< \brief (Internal) camera ID name */
  121. GphotoDeviceType device_type; /**< \brief Device type. */
  122. /** Reserved space to use in the future w/out changing the
  123. * struct size */
  124. int reserved2; /**< reserved space \internal */
  125. int reserved3; /**< reserved space \internal */
  126. int reserved4; /**< reserved space \internal */
  127. int reserved5; /**< reserved space \internal */
  128. int reserved6; /**< reserved space \internal */
  129. int reserved7; /**< reserved space \internal */
  130. int reserved8; /**< reserved space \internal */
  131. } CameraAbilities;
  132. /**
  133. * \brief List of supported camera models including their abilities
  134. *
  135. * The internals of this list are hidden - use the access functions.
  136. */
  137. typedef struct _CameraAbilitiesList CameraAbilitiesList;
  138. int gp_abilities_list_new (CameraAbilitiesList **list);
  139. int gp_abilities_list_free (CameraAbilitiesList *list);
  140. int gp_abilities_list_load (CameraAbilitiesList *list, GPContext *context);
  141. int gp_abilities_list_load_dir (CameraAbilitiesList *list, const char *dir, GPContext *context);
  142. int gp_abilities_list_reset (CameraAbilitiesList *list);
  143. int gp_abilities_list_detect (CameraAbilitiesList *list,
  144. GPPortInfoList *info_list, CameraList *l,
  145. GPContext *context);
  146. int gp_abilities_list_append (CameraAbilitiesList *list,
  147. CameraAbilities abilities);
  148. int gp_abilities_list_count (CameraAbilitiesList *list);
  149. int gp_abilities_list_lookup_model (CameraAbilitiesList *list,
  150. const char *model);
  151. int gp_abilities_list_get_abilities (CameraAbilitiesList *list, int index,
  152. CameraAbilities *abilities);
  153. const char *gp_message_codeset (const char *);
  154. /**
  155. * Name of the environment variable which may contain the path where
  156. * to look for the camlibs. If this environment variable is not defined,
  157. * use the compiled-in default constant.
  158. *
  159. * \internal Internal use only.
  160. */
  161. #ifdef _GPHOTO2_INTERNAL_CODE
  162. #define CAMLIBDIR_ENV "CAMLIBS"
  163. #endif /* _GPHOTO2_INTERNAL_CODE */
  164. #ifdef __cplusplus
  165. }
  166. #endif /* __cplusplus */
  167. #endif /* __GPHOTO2_ABILITIES_LIST_H__ */