gphoto2-widget.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /** \file
  2. *
  3. * \author Copyright 2000 Scott Fritzinger
  4. *
  5. * \note
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * \note
  12. * This library 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 GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * \note
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA
  22. */
  23. #ifndef __GPHOTO2_WIDGET_H__
  24. #define __GPHOTO2_WIDGET_H__
  25. #include <gphoto2/gphoto2-context.h>
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif /* __cplusplus */
  29. /** \brief internal structure please use the accessors. */
  30. typedef struct _CameraWidget CameraWidget;
  31. #ifdef __cplusplus
  32. }
  33. #endif /* __cplusplus */
  34. #include <gphoto2/gphoto2-camera.h>
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif /* __cplusplus */
  38. /**
  39. * \brief Type of the widget to be created.
  40. *
  41. * The actual widget type we want to create. The type of the value
  42. * it supports depends on this type.
  43. */
  44. typedef enum { /* Value (get/set): */
  45. GP_WIDGET_WINDOW, /**< \brief Window widget
  46. * This is the toplevel configuration widget. It should likely contain multiple #GP_WIDGET_SECTION entries.
  47. */
  48. GP_WIDGET_SECTION, /**< \brief Section widget (think Tab) */
  49. GP_WIDGET_TEXT, /**< \brief Text widget. */ /* char * */
  50. GP_WIDGET_RANGE, /**< \brief Slider widget. */ /* float */
  51. GP_WIDGET_TOGGLE, /**< \brief Toggle widget (think check box) */ /* int */
  52. GP_WIDGET_RADIO, /**< \brief Radio button widget. */ /* char * */
  53. GP_WIDGET_MENU, /**< \brief Menu widget (same as RADIO). */ /* char * */
  54. GP_WIDGET_BUTTON, /**< \brief Button press widget. */ /* CameraWidgetCallback */
  55. GP_WIDGET_DATE /**< \brief Date entering widget. */ /* int */
  56. } CameraWidgetType;
  57. /**
  58. * \brief Callback handler for Button widgets.
  59. */
  60. typedef int (* CameraWidgetCallback) (Camera *, CameraWidget *, GPContext *);
  61. int gp_widget_new (CameraWidgetType type, const char *label,
  62. CameraWidget **widget);
  63. int gp_widget_free (CameraWidget *widget);
  64. int gp_widget_ref (CameraWidget *widget);
  65. int gp_widget_unref (CameraWidget *widget);
  66. int gp_widget_append (CameraWidget *widget, CameraWidget *child);
  67. int gp_widget_prepend (CameraWidget *widget, CameraWidget *child);
  68. int gp_widget_count_children (CameraWidget *widget);
  69. int gp_widget_get_child (CameraWidget *widget, int child_number,
  70. CameraWidget **child);
  71. /* Retrieve Widgets */
  72. int gp_widget_get_child_by_label (CameraWidget *widget,
  73. const char *label,
  74. CameraWidget **child);
  75. int gp_widget_get_child_by_id (CameraWidget *widget, int id,
  76. CameraWidget **child);
  77. int gp_widget_get_child_by_name (CameraWidget *widget,
  78. const char *name,
  79. CameraWidget **child);
  80. int gp_widget_get_root (CameraWidget *widget,
  81. CameraWidget **root);
  82. int gp_widget_get_parent (CameraWidget *widget,
  83. CameraWidget **parent);
  84. int gp_widget_set_value (CameraWidget *widget, const void *value);
  85. int gp_widget_get_value (CameraWidget *widget, void *value);
  86. int gp_widget_set_name (CameraWidget *widget, const char *name);
  87. int gp_widget_get_name (CameraWidget *widget, const char **name);
  88. int gp_widget_set_info (CameraWidget *widget, const char *info);
  89. int gp_widget_get_info (CameraWidget *widget, const char **info);
  90. int gp_widget_get_id (CameraWidget *widget, int *id);
  91. int gp_widget_get_type (CameraWidget *widget, CameraWidgetType *type);
  92. int gp_widget_get_label (CameraWidget *widget, const char **label);
  93. int gp_widget_set_range (CameraWidget *range,
  94. float low, float high, float increment);
  95. int gp_widget_get_range (CameraWidget *range,
  96. float *min, float *max, float *increment);
  97. int gp_widget_add_choice (CameraWidget *widget, const char *choice);
  98. int gp_widget_count_choices (CameraWidget *widget);
  99. int gp_widget_get_choice (CameraWidget *widget, int choice_number,
  100. const char **choice);
  101. int gp_widget_changed (CameraWidget *widget);
  102. int gp_widget_set_changed (CameraWidget *widget, int changed);
  103. int gp_widget_set_readonly (CameraWidget *widget, int readonly);
  104. int gp_widget_get_readonly (CameraWidget *widget, int *readonly);
  105. #ifdef __cplusplus
  106. }
  107. #endif /* __cplusplus */
  108. #endif /* __GPHOTO2_WIDGET_H__ */