3 * \author Copyright 2000 Scott Fritzinger
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.
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.
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., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #ifndef __GPHOTO2_WIDGET_H__
25 #define __GPHOTO2_WIDGET_H__
27 #include <gphoto2/gphoto2-context.h>
31 #endif /* __cplusplus */
33 /** \brief internal structure please use the accessors. */
34 typedef struct _CameraWidget CameraWidget;
38 #endif /* __cplusplus */
42 #include <gphoto2/gphoto2-camera.h>
46 #endif /* __cplusplus */
49 * \brief Type of the widget to be created.
51 * The actual widget type we want to create. The type of the value
52 * it supports depends on this type.
54 typedef enum { /* Value (get/set): */
55 GP_WIDGET_WINDOW, /**< \brief Window widget
56 * This is the toplevel configuration widget. It should likely contain multiple #GP_WIDGET_SECTION entries.
58 GP_WIDGET_SECTION, /**< \brief Section widget (think Tab) */
59 GP_WIDGET_TEXT, /**< \brief Text widget. */ /* char * */
60 GP_WIDGET_RANGE, /**< \brief Slider widget. */ /* float */
61 GP_WIDGET_TOGGLE, /**< \brief Toggle widget (think check box) */ /* int */
62 GP_WIDGET_RADIO, /**< \brief Radio button widget. */ /* char * */
63 GP_WIDGET_MENU, /**< \brief Menu widget (same as RADIO). */ /* char * */
64 GP_WIDGET_BUTTON, /**< \brief Button press widget. */ /* CameraWidgetCallback */
65 GP_WIDGET_DATE /**< \brief Date entering widget. */ /* int */
69 * \brief Callback handler for Button widgets.
71 typedef int (* CameraWidgetCallback) (Camera *, CameraWidget *, GPContext *);
73 int gp_widget_new (CameraWidgetType type, const char *label,
74 CameraWidget **widget);
75 int gp_widget_free (CameraWidget *widget);
76 int gp_widget_ref (CameraWidget *widget);
77 int gp_widget_unref (CameraWidget *widget);
79 int gp_widget_append (CameraWidget *widget, CameraWidget *child);
80 int gp_widget_prepend (CameraWidget *widget, CameraWidget *child);
82 int gp_widget_count_children (CameraWidget *widget);
83 int gp_widget_get_child (CameraWidget *widget, int child_number,
84 CameraWidget **child);
86 /* Retrieve Widgets */
87 int gp_widget_get_child_by_label (CameraWidget *widget,
89 CameraWidget **child);
90 int gp_widget_get_child_by_id (CameraWidget *widget, int id,
91 CameraWidget **child);
92 int gp_widget_get_child_by_name (CameraWidget *widget,
94 CameraWidget **child);
95 int gp_widget_get_root (CameraWidget *widget,
97 int gp_widget_get_parent (CameraWidget *widget,
98 CameraWidget **parent);
100 int gp_widget_set_value (CameraWidget *widget, const void *value);
101 int gp_widget_get_value (CameraWidget *widget, void *value);
103 int gp_widget_set_name (CameraWidget *widget, const char *name);
104 int gp_widget_get_name (CameraWidget *widget, const char **name);
106 int gp_widget_set_info (CameraWidget *widget, const char *info);
107 int gp_widget_get_info (CameraWidget *widget, const char **info);
109 int gp_widget_get_id (CameraWidget *widget, int *id);
110 int gp_widget_get_type (CameraWidget *widget, CameraWidgetType *type);
111 int gp_widget_get_label (CameraWidget *widget, const char **label);
113 int gp_widget_set_range (CameraWidget *range,
114 float low, float high, float increment);
115 int gp_widget_get_range (CameraWidget *range,
116 float *min, float *max, float *increment);
118 int gp_widget_add_choice (CameraWidget *widget, const char *choice);
119 int gp_widget_count_choices (CameraWidget *widget);
120 int gp_widget_get_choice (CameraWidget *widget, int choice_number,
121 const char **choice);
123 int gp_widget_changed (CameraWidget *widget);
124 int gp_widget_set_changed (CameraWidget *widget, int changed);
126 int gp_widget_set_readonly (CameraWidget *widget, int readonly);
127 int gp_widget_get_readonly (CameraWidget *widget, int *readonly);
131 #endif /* __cplusplus */
133 #endif /* __GPHOTO2_WIDGET_H__ */