1 /***************************************************************************
2     begin       : Wed Jan 20 2010
3     copyright   : (C) 2010 by Martin Preuss
4     email       : martin@libchipcard.de
5 
6  ***************************************************************************
7  *                                                                         *
8  *   This library is free software; you can redistribute it and/or         *
9  *   modify it under the terms of the GNU Lesser General Public            *
10  *   License as published by the Free Software Foundation; either          *
11  *   version 2.1 of the License, or (at your option) any later version.    *
12  *                                                                         *
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  *   You should have received a copy of the GNU Lesser General Public      *
19  *   License along with this library; if not, write to the Free Software   *
20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
21  *   MA  02111-1307  USA                                                   *
22  *                                                                         *
23  ***************************************************************************/
24 
25 
26 #ifndef GWENHYWFAR_GUI_DIALOG_BE_H
27 #define GWENHYWFAR_GUI_DIALOG_BE_H
28 
29 
30 #include <gwenhywfar/dialog.h>
31 #include <gwenhywfar/widget_be.h>
32 #include <gwenhywfar/stringlist.h>
33 
34 #include <stdio.h>
35 
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 
42 typedef int GWENHYWFAR_CB(*GWEN_DIALOG_SETINTPROPERTY_FN)(GWEN_DIALOG *dlg,
43                                                           GWEN_WIDGET *w,
44                                                           GWEN_DIALOG_PROPERTY prop,
45                                                           int index,
46                                                           int value,
47                                                           int doSignal);
48 
49 typedef int GWENHYWFAR_CB(*GWEN_DIALOG_GETINTPROPERTY_FN)(GWEN_DIALOG *dlg,
50                                                           GWEN_WIDGET *w,
51                                                           GWEN_DIALOG_PROPERTY prop,
52                                                           int index,
53                                                           int defaultValue);
54 
55 typedef int GWENHYWFAR_CB(*GWEN_DIALOG_SETCHARPROPERTY_FN)(GWEN_DIALOG *dlg,
56                                                            GWEN_WIDGET *w,
57                                                            GWEN_DIALOG_PROPERTY prop,
58                                                            int index,
59                                                            const char *value,
60                                                            int doSignal);
61 
62 typedef const char *GWENHYWFAR_CB(*GWEN_DIALOG_GETCHARPROPERTY_FN)(GWEN_DIALOG *dlg,
63                                                                    GWEN_WIDGET *w,
64                                                                    GWEN_DIALOG_PROPERTY prop,
65                                                                    int index,
66                                                                    const char *defaultValue);
67 
68 
69 GWENHYWFAR_API
70 GWEN_DIALOG_SETINTPROPERTY_FN GWEN_Dialog_SetSetIntPropertyFn(GWEN_DIALOG *dlg,
71                                                               GWEN_DIALOG_SETINTPROPERTY_FN fn);
72 
73 GWENHYWFAR_API
74 GWEN_DIALOG_GETINTPROPERTY_FN GWEN_Dialog_SetGetIntPropertyFn(GWEN_DIALOG *dlg,
75                                                               GWEN_DIALOG_GETINTPROPERTY_FN fn);
76 
77 GWENHYWFAR_API
78 GWEN_DIALOG_SETCHARPROPERTY_FN GWEN_Dialog_SetSetCharPropertyFn(GWEN_DIALOG *dlg,
79                                                                 GWEN_DIALOG_SETCHARPROPERTY_FN fn);
80 
81 GWENHYWFAR_API
82 GWEN_DIALOG_GETCHARPROPERTY_FN GWEN_Dialog_SetGetCharPropertyFn(GWEN_DIALOG *dlg,
83                                                                 GWEN_DIALOG_GETCHARPROPERTY_FN fn);
84 
85 
86 GWENHYWFAR_API
87 GWEN_WIDGET_TREE *GWEN_Dialog_GetWidgets(const GWEN_DIALOG *dlg);
88 
89 GWENHYWFAR_API
90 GWEN_WIDGET *GWEN_Dialog_FindWidgetByName(const GWEN_DIALOG *dlg, const char *name);
91 
92 GWENHYWFAR_API
93 GWEN_WIDGET *GWEN_Dialog_FindWidgetByImplData(const GWEN_DIALOG *dlg, int index, const void *ptr);
94 
95 
96 GWENHYWFAR_API
97 void GWEN_Dialog_SetGuiId(GWEN_DIALOG *dlg, uint32_t guiid);
98 
99 
100 /**
101  * The dialog remains the owner of the object returned (if any).
102  */
103 GWENHYWFAR_API
104 GWEN_STRINGLIST *GWEN_Dialog_GetMediaPaths(const GWEN_DIALOG *dlg);
105 
106 
107 /**
108  * Sends a signal to the signal handler of the given dialog. This does @b not send the signal
109  * to sub-dialogs. Use @ref GWEN_Dialog_EmitSignalToAll for that.
110  */
111 GWENHYWFAR_API
112 int GWEN_Dialog_EmitSignal(GWEN_DIALOG *dlg,
113                            GWEN_DIALOG_EVENTTYPE t,
114                            const char *sender);
115 
116 /**
117  * Emits signals to the given dialog and all its sub-dialogs. This should only be used
118  * for signals like @ref GWEN_DialogEvent_TypeInit and @ref GWEN_DialogEvent_TypeFini.
119  */
120 GWENHYWFAR_API
121 int GWEN_Dialog_EmitSignalToAll(GWEN_DIALOG *dlg,
122                                 GWEN_DIALOG_EVENTTYPE t,
123                                 const char *sender);
124 
125 
126 GWENHYWFAR_API
127 GWEN_DIALOG *GWEN_Dialog_GetParentDialog(const GWEN_DIALOG *dlg);
128 
129 
130 GWENHYWFAR_API
131 void GWEN_Dialog_Dump(const GWEN_DIALOG *dlg, FILE *f, unsigned int indent);
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 
138 
139 
140 #endif
141