libgphoto2 photo camera library (libgphoto2) API  2.5.2
gphoto2-widget.h
Go to the documentation of this file.
00001 
00024 #ifndef __GPHOTO2_WIDGET_H__
00025 #define __GPHOTO2_WIDGET_H__
00026 
00027 #include <gphoto2/gphoto2-context.h>
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif /* __cplusplus */
00032 
00034 typedef struct _CameraWidget CameraWidget;
00035 
00036 #ifdef __cplusplus
00037 }
00038 #endif /* __cplusplus */
00039 
00040 
00041 
00042 #include <gphoto2/gphoto2-camera.h>
00043 
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif /* __cplusplus */
00047 
00054 typedef enum {                                                                  /* Value (get/set):     */
00055         GP_WIDGET_WINDOW,       
00058         GP_WIDGET_SECTION,      
00059         GP_WIDGET_TEXT,                                 /* char *               */
00060         GP_WIDGET_RANGE,                                /* float                */
00061         GP_WIDGET_TOGGLE,               /* int                  */
00062         GP_WIDGET_RADIO,                        /* char *               */
00063         GP_WIDGET_MENU,                 /* char *               */
00064         GP_WIDGET_BUTTON,                       /* CameraWidgetCallback */
00065         GP_WIDGET_DATE                          /* int                  */
00066 } CameraWidgetType;
00067 
00071 typedef int (* CameraWidgetCallback) (Camera *, CameraWidget *, GPContext *);
00072 
00073 int     gp_widget_new   (CameraWidgetType type, const char *label, 
00074                          CameraWidget **widget);
00075 int     gp_widget_free  (CameraWidget *widget);
00076 int     gp_widget_ref   (CameraWidget *widget);
00077 int     gp_widget_unref (CameraWidget *widget);
00078 
00079 int     gp_widget_append        (CameraWidget *widget, CameraWidget *child);
00080 int     gp_widget_prepend       (CameraWidget *widget, CameraWidget *child);
00081 
00082 int     gp_widget_count_children     (CameraWidget *widget);
00083 int     gp_widget_get_child          (CameraWidget *widget, int child_number, 
00084                                       CameraWidget **child);
00085 
00086 /* Retrieve Widgets */
00087 int     gp_widget_get_child_by_label (CameraWidget *widget,
00088                                       const char *label,
00089                                       CameraWidget **child);
00090 int     gp_widget_get_child_by_id    (CameraWidget *widget, int id, 
00091                                       CameraWidget **child);
00092 int     gp_widget_get_child_by_name  (CameraWidget *widget,
00093                                       const char *name,
00094                                       CameraWidget **child);
00095 int     gp_widget_get_root           (CameraWidget *widget,
00096                                       CameraWidget **root);
00097 int     gp_widget_get_parent         (CameraWidget *widget,
00098                                       CameraWidget **parent);
00099 
00100 int     gp_widget_set_value     (CameraWidget *widget, const void *value);
00101 int     gp_widget_get_value     (CameraWidget *widget, void *value);
00102 
00103 int     gp_widget_set_name      (CameraWidget *widget, const char  *name);
00104 int     gp_widget_get_name      (CameraWidget *widget, const char **name);
00105 
00106 int     gp_widget_set_info      (CameraWidget *widget, const char  *info);
00107 int     gp_widget_get_info      (CameraWidget *widget, const char **info);
00108 
00109 int     gp_widget_get_id        (CameraWidget *widget, int *id);
00110 int     gp_widget_get_type      (CameraWidget *widget, CameraWidgetType *type);
00111 int     gp_widget_get_label     (CameraWidget *widget, const char **label);
00112 
00113 int     gp_widget_set_range     (CameraWidget *range, 
00114                                  float  low, float  high, float  increment);
00115 int     gp_widget_get_range     (CameraWidget *range, 
00116                                  float *min, float *max, float *increment);
00117 
00118 int     gp_widget_add_choice     (CameraWidget *widget, const char *choice);
00119 int     gp_widget_count_choices  (CameraWidget *widget);
00120 int     gp_widget_get_choice     (CameraWidget *widget, int choice_number, 
00121                                   const char **choice);
00122 
00123 int     gp_widget_changed        (CameraWidget *widget);
00124 int     gp_widget_set_changed    (CameraWidget *widget, int changed);
00125 
00126 int     gp_widget_set_readonly   (CameraWidget *widget, int readonly);
00127 int     gp_widget_get_readonly   (CameraWidget *widget, int *readonly);
00128 
00129 #ifdef __cplusplus
00130 }
00131 #endif /* __cplusplus */
00132 
00133 #endif /* __GPHOTO2_WIDGET_H__ */