gwenhywfar  4.6.0beta
dialog.h
Go to the documentation of this file.
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_H
27 #define GWENHYWFAR_GUI_DIALOG_H
28 
29 
30 #include <gwenhywfar/inherit.h>
31 #include <gwenhywfar/list1.h>
32 #include <gwenhywfar/list2.h>
33 #include <gwenhywfar/xml.h>
34 #include <gwenhywfar/db.h>
35 
36 
37 
47 
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 
54 typedef struct GWEN_DIALOG GWEN_DIALOG;
57 GWEN_LIST2_FUNCTION_LIB_DEFS(GWEN_DIALOG, GWEN_Dialog, GWENHYWFAR_API)
58 
59 
60 #define GWEN_WIDGET_FLAGS_NONE 0x00000000L
61 #define GWEN_WIDGET_FLAGS_FILLX 0x80000000L
62 #define GWEN_WIDGET_FLAGS_FILLY 0x40000000L
63 #define GWEN_WIDGET_FLAGS_READONLY 0x20000000L
64 #define GWEN_WIDGET_FLAGS_PASSWORD 0x10000000L
65 #define GWEN_WIDGET_FLAGS_DEFAULT_WIDGET 0x08000000L
66 
67 #define GWEN_WIDGET_FLAGS_DECOR_SHRINKABLE 0x04000000L
68 #define GWEN_WIDGET_FLAGS_DECOR_STRETCHABLE 0x02000000L
69 #define GWEN_WIDGET_FLAGS_DECOR_MINIMIZE 0x01000000L
70 #define GWEN_WIDGET_FLAGS_DECOR_MAXIMIZE 0x00800000L
71 #define GWEN_WIDGET_FLAGS_DECOR_CLOSE 0x00400000L
72 #define GWEN_WIDGET_FLAGS_DECOR_MENU 0x00200000L
73 
74 #define GWEN_WIDGET_FLAGS_FIXED_WIDTH 0x00100000L
75 #define GWEN_WIDGET_FLAGS_FIXED_HEIGHT 0x00080000L
76 #define GWEN_WIDGET_FLAGS_EQUAL_WIDTH 0x00040000L
77 #define GWEN_WIDGET_FLAGS_EQUAL_HEIGHT 0x00020000L
78 
79 #define GWEN_WIDGET_FLAGS_JUSTIFY_LEFT 0x00010000L
80 #define GWEN_WIDGET_FLAGS_JUSTIFY_RIGHT 0x00008000L
81 #define GWEN_WIDGET_FLAGS_JUSTIFY_TOP 0x00004000L
82 #define GWEN_WIDGET_FLAGS_JUSTIFY_BOTTOM 0x00002000L
83 #define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERX 0x00001000L
84 #define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERY 0x00000800L
85 
86 #define GWEN_WIDGET_FLAGS_NO_WORDWRAP 0x00000400L
87 
88 
89 
90 typedef enum {
98 
101 
102 
103 
109 enum {
114 };
115 
116 
122 typedef int GWENHYWFAR_CB (*GWEN_DIALOG_SIGNALHANDLER)(GWEN_DIALOG *dlg,
124  const char *sender);
125 
126 
127 
129 GWEN_DIALOG *GWEN_Dialog_new(const char *dialogId);
130 
132 void GWEN_Dialog_free(GWEN_DIALOG *dlg);
133 
138 int GWEN_Dialog_ReadXml(GWEN_DIALOG *dlg, GWEN_XMLNODE *node);
139 
140 
145 int GWEN_Dialog_ReadXmlFile(GWEN_DIALOG *dlg, const char *fname);
146 
153 const char*GWEN_Dialog_GetId(const GWEN_DIALOG *dlg);
154 
155 
157 uint32_t GWEN_Dialog_GetGuiId(const GWEN_DIALOG *dlg);
158 
159 
165 void GWEN_Dialog_AddMediaPath(GWEN_DIALOG *dlg, const char *s);
166 
167 
180 void GWEN_Dialog_AddMediaPathsFromPathManager(GWEN_DIALOG *dlg,
181  const char *destlib,
182  const char *pathName,
183  const char *relPath);
184 
185 
195 int GWEN_Dialog_AddSubDialog(GWEN_DIALOG *dlg,
196  const char *parentWidgetName,
197  GWEN_DIALOG *subdlg);
198 
200 int GWEN_Dialog_RemoveWidget(GWEN_DIALOG *dlg, const char *name);
201 
202 
210 
211 
212 
213 
214 
215 typedef enum {
217 
237 
240 
241 
242 typedef enum {
247 
248 
249 typedef enum {
254 
255 
264 
284 int GWEN_Dialog_SetIntProperty(GWEN_DIALOG *dlg,
285  const char *name,
287  int index,
288  int value,
289  int doSignal);
290 
301 int GWEN_Dialog_GetIntProperty(GWEN_DIALOG *dlg,
302  const char *name,
304  int index,
305  int defaultValue);
306 
314 int GWEN_Dialog_SetCharProperty(GWEN_DIALOG *dlg,
315  const char *name,
317  int index,
318  const char *value,
319  int doSignal);
320 
344 const char *GWEN_Dialog_GetCharProperty(GWEN_DIALOG *dlg,
345  const char *name,
347  int index,
348  const char *defaultValue);
361 uint32_t GWEN_Dialog_GetWidgetFlags(const GWEN_DIALOG *dlg, const char *name);
362 
364 void GWEN_Dialog_SetWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
365 
367 void GWEN_Dialog_AddWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
368 
370 void GWEN_Dialog_SubWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
371 
381 int GWEN_Dialog_GetWidgetColumns(const GWEN_DIALOG *dlg, const char *name);
382 
383 
384 
389 void GWEN_Dialog_SetWidgetColumns(GWEN_DIALOG *dlg, const char *name, int i);
390 
391 
392 
400 int GWEN_Dialog_GetWidgetRows(const GWEN_DIALOG *dlg, const char *name);
401 
402 
407 void GWEN_Dialog_SetWidgetRows(GWEN_DIALOG *dlg, const char *name, int i);
408 
409 
411 const char *GWEN_Dialog_GetWidgetText(const GWEN_DIALOG *dlg, const char *name);
412 
414 void GWEN_Dialog_SetWidgetText(GWEN_DIALOG *dlg, const char *name, const char *t);
415 
416 
430 GWEN_DB_NODE *GWEN_Dialog_GetPreferences(const GWEN_DIALOG *dlg);
431 
440 
445 void GWEN_Dialog_SetI18nDomain(GWEN_DIALOG *dlg, const char *s);
446 
457 const char *GWEN_Dialog_GetI18nDomain(const GWEN_DIALOG *dlg);
458 
463 const char *GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s);
467 #ifdef __cplusplus
468 }
469 #endif
470 
471 
472 
476 #endif