gwenhywfar  5.7.4
dialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Wed Jan 20 2010
3  copyright : (C) 2019 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;
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 
124  const char *sender);
125 
126 
127 
129 GWEN_DIALOG *GWEN_Dialog_new(const char *dialogId);
130 
131 
142 GWEN_DIALOG *GWEN_Dialog_CreateAndLoadWithPath(const char *dialogId,
143  const char *pmLibName,
144  const char *pmDataDir,
145  const char *fileName);
146 
147 
149 void GWEN_Dialog_free(GWEN_DIALOG *dlg);
150 
156 
157 
162 int GWEN_Dialog_ReadXmlFile(GWEN_DIALOG *dlg, const char *fname);
163 
170 const char *GWEN_Dialog_GetId(const GWEN_DIALOG *dlg);
171 
172 
174 uint32_t GWEN_Dialog_GetGuiId(const GWEN_DIALOG *dlg);
175 
176 
182 void GWEN_Dialog_AddMediaPath(GWEN_DIALOG *dlg, const char *s);
183 
184 
198  const char *destlib,
199  const char *pathName,
200  const char *relPath);
201 
202 
213  const char *parentWidgetName,
214  GWEN_DIALOG *subdlg);
215 
217 int GWEN_Dialog_RemoveWidget(GWEN_DIALOG *dlg, const char *name);
218 
219 
227 
228 
229 
230 
231 
232 typedef enum {
234 
254 
257 
258 
259 typedef enum {
264 
265 
266 typedef enum {
271 
272 
281 
302  const char *name,
304  int index,
305  int value,
306  int doSignal);
307 
319  const char *name,
321  int index,
322  int defaultValue);
323 
332  const char *name,
334  int index,
335  const char *value,
336  int doSignal);
337 
362  const char *name,
364  int index,
365  const char *defaultValue);
378 uint32_t GWEN_Dialog_GetWidgetFlags(const GWEN_DIALOG *dlg, const char *name);
379 
381 void GWEN_Dialog_SetWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
382 
384 void GWEN_Dialog_AddWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
385 
387 void GWEN_Dialog_SubWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
388 
398 int GWEN_Dialog_GetWidgetColumns(const GWEN_DIALOG *dlg, const char *name);
399 
400 
401 
406 void GWEN_Dialog_SetWidgetColumns(GWEN_DIALOG *dlg, const char *name, int i);
407 
408 
409 
417 int GWEN_Dialog_GetWidgetRows(const GWEN_DIALOG *dlg, const char *name);
418 
419 
424 void GWEN_Dialog_SetWidgetRows(GWEN_DIALOG *dlg, const char *name, int i);
425 
426 
428 const char *GWEN_Dialog_GetWidgetText(const GWEN_DIALOG *dlg, const char *name);
429 
431 void GWEN_Dialog_SetWidgetText(GWEN_DIALOG *dlg, const char *name, const char *t);
432 
433 
448 
457 
462 void GWEN_Dialog_SetI18nDomain(GWEN_DIALOG *dlg, const char *s);
463 
474 const char *GWEN_Dialog_GetI18nDomain(const GWEN_DIALOG *dlg);
475 
480 const char *GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s);
484 #ifdef __cplusplus
485 }
486 #endif
487 
488 
489 
493 #endif
GWEN_DialogEvent_ResultReject
@ GWEN_DialogEvent_ResultReject
Definition: dialog.h:113
GWEN_DialogProperty_ClearValues
@ GWEN_DialogProperty_ClearValues
Definition: dialog.h:241
GWEN_DialogSortDirection_Down
@ GWEN_DialogSortDirection_Down
Definition: dialog.h:269
GWEN_DialogProperty_SelectionMode
@ GWEN_DialogProperty_SelectionMode
Definition: dialog.h:246
GWEN_DialogEvent_TypeActivated
@ GWEN_DialogEvent_TypeActivated
Definition: dialog.h:94
GWEN_Dialog_new
GWENHYWFAR_API GWEN_DIALOG * GWEN_Dialog_new(const char *dialogId)
GWEN_Dialog_AddMediaPathsFromPathManager
GWENHYWFAR_API void GWEN_Dialog_AddMediaPathsFromPathManager(GWEN_DIALOG *dlg, const char *destlib, const char *pathName, const char *relPath)
GWEN_DialogProperty_MaxValue
@ GWEN_DialogProperty_MaxValue
Definition: dialog.h:238
GWEN_DialogProperty_Focus
@ GWEN_DialogProperty_Focus
Definition: dialog.h:248
GWEN_Dialog_CreateAndLoadWithPath
GWENHYWFAR_API GWEN_DIALOG * GWEN_Dialog_CreateAndLoadWithPath(const char *dialogId, const char *pmLibName, const char *pmDataDir, const char *fileName)
GWEN_INHERIT_FUNCTION_LIB_DEFS
#define GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl)
Definition: inherit.h:125
GWEN_DialogProperty_SelectionState
@ GWEN_DialogProperty_SelectionState
Definition: dialog.h:247
GWEN_DialogProperty_AddValue
@ GWEN_DialogProperty_AddValue
Definition: dialog.h:240
GWEN_Dialog_AddMediaPath
GWENHYWFAR_API void GWEN_Dialog_AddMediaPath(GWEN_DIALOG *dlg, const char *s)
GWEN_DialogEvent_TypeClose
@ GWEN_DialogEvent_TypeClose
Definition: dialog.h:97
GWEN_DialogProperty_ValueCount
@ GWEN_DialogProperty_ValueCount
Definition: dialog.h:242
GWEN_DialogProperty_ToolTip
@ GWEN_DialogProperty_ToolTip
Definition: dialog.h:253
GWEN_DialogProperty_Title
@ GWEN_DialogProperty_Title
Definition: dialog.h:235
GWEN_Dialog_SetIntProperty
GWENHYWFAR_API int GWEN_Dialog_SetIntProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
GWEN_Dialog_SelectionMode_Single
@ GWEN_Dialog_SelectionMode_Single
Definition: dialog.h:261
db.h
GWEN_Dialog_SetWidgetRows
GWENHYWFAR_API void GWEN_Dialog_SetWidgetRows(GWEN_DIALOG *dlg, const char *name, int i)
xml.h
GWEN_Dialog_GetGuiId
GWENHYWFAR_API uint32_t GWEN_Dialog_GetGuiId(const GWEN_DIALOG *dlg)
GWEN_DIALOG_EVENTTYPE
GWEN_DIALOG_EVENTTYPE
Definition: dialog.h:90
GWEN_DialogEvent_TypeDisabled
@ GWEN_DialogEvent_TypeDisabled
Definition: dialog.h:96
GWEN_Dialog_AddSubDialog
GWENHYWFAR_API int GWEN_Dialog_AddSubDialog(GWEN_DIALOG *dlg, const char *parentWidgetName, GWEN_DIALOG *subdlg)
GWEN_Dialog_ReadXmlFile
GWENHYWFAR_API int GWEN_Dialog_ReadXmlFile(GWEN_DIALOG *dlg, const char *fname)
GWEN_Dialog_GetI18nDomain
const GWENHYWFAR_API char * GWEN_Dialog_GetI18nDomain(const GWEN_DIALOG *dlg)
GWEN_Dialog_TranslateString
const GWENHYWFAR_API char * GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s)
GWEN_DIALOG_SIGNALHANDLER
int GWENHYWFAR_CB(* GWEN_DIALOG_SIGNALHANDLER)(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
Definition: dialog.h:122
GWEN_Dialog_SetSignalHandler
GWENHYWFAR_API GWEN_DIALOG_SIGNALHANDLER GWEN_Dialog_SetSignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_SIGNALHANDLER fn)
GWEN_DialogProperty_Value
@ GWEN_DialogProperty_Value
Definition: dialog.h:236
GWEN_Dialog_SetWidgetText
GWENHYWFAR_API void GWEN_Dialog_SetWidgetText(GWEN_DIALOG *dlg, const char *name, const char *t)
GWEN_Dialog_SelectionMode_Multi
@ GWEN_Dialog_SelectionMode_Multi
Definition: dialog.h:262
GWEN_Dialog_GetCharProperty
const GWENHYWFAR_API char * GWEN_Dialog_GetCharProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
GWEN_DialogEvent_TypeEnabled
@ GWEN_DialogEvent_TypeEnabled
Definition: dialog.h:95
GWEN_LIST_FUNCTION_LIB_DEFS
#define GWEN_LIST_FUNCTION_LIB_DEFS(t, pr, decl)
Definition: list1.h:348
GWEN_Dialog_SetWidgetFlags
GWENHYWFAR_API void GWEN_Dialog_SetWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWEN_Dialog_SubWidgetFlags
GWENHYWFAR_API void GWEN_Dialog_SubWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWEN_DialogEvent_TypeValueChanged
@ GWEN_DialogEvent_TypeValueChanged
Definition: dialog.h:93
GWEN_DialogProperty_SortDirection
@ GWEN_DialogProperty_SortDirection
Definition: dialog.h:250
GWEN_Dialog_GetWidgetRows
GWENHYWFAR_API int GWEN_Dialog_GetWidgetRows(const GWEN_DIALOG *dlg, const char *name)
GWEN_Dialog_GetWidgetText
const GWENHYWFAR_API char * GWEN_Dialog_GetWidgetText(const GWEN_DIALOG *dlg, const char *name)
GWENHYWFAR_CB
#define GWENHYWFAR_CB
Definition: gwenhywfarapi.h:89
GWEN_DialogEvent_TypeInit
@ GWEN_DialogEvent_TypeInit
Definition: dialog.h:91
GWEN_LIST2_FUNCTION_LIB_DEFS
#define GWEN_LIST2_FUNCTION_LIB_DEFS(t, pr, decl)
Definition: list2.h:56
GWEN_XMLNODE
struct GWEN__XMLNODE GWEN_XMLNODE
Definition: xml.h:156
GWEN_DialogProperty_Visibility
@ GWEN_DialogProperty_Visibility
Definition: dialog.h:252
GWEN_DialogProperty_ColumnWidth
@ GWEN_DialogProperty_ColumnWidth
Definition: dialog.h:243
GWEN_Dialog_SetCharProperty
GWENHYWFAR_API int GWEN_Dialog_SetCharProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
GWEN_DIALOG_PROPERTY
GWEN_DIALOG_PROPERTY
Definition: dialog.h:232
GWEN_DialogProperty_None
@ GWEN_DialogProperty_None
Definition: dialog.h:233
GWEN_Dialog_GetPreferences
GWENHYWFAR_API GWEN_DB_NODE * GWEN_Dialog_GetPreferences(const GWEN_DIALOG *dlg)
GWEN_DIALOG
struct GWEN_DIALOG GWEN_DIALOG
Definition: dialog.h:54
GWEN_DialogEvent_ResultAccept
@ GWEN_DialogEvent_ResultAccept
Definition: dialog.h:112
GWEN_DialogSortDirection_Up
@ GWEN_DialogSortDirection_Up
Definition: dialog.h:268
GWEN_DialogProperty_Enabled
@ GWEN_DialogProperty_Enabled
Definition: dialog.h:239
GWEN_DialogProperty_Height
@ GWEN_DialogProperty_Height
Definition: dialog.h:245
GWEN_Dialog_GetWidgetFlags
GWENHYWFAR_API uint32_t GWEN_Dialog_GetWidgetFlags(const GWEN_DIALOG *dlg, const char *name)
GWEN_Dialog_GetIntProperty
GWENHYWFAR_API int GWEN_Dialog_GetIntProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
GWEN_DialogProperty_Sort
@ GWEN_DialogProperty_Sort
Definition: dialog.h:251
GWEN_DIALOG_SORT_DIRECTION
GWEN_DIALOG_SORT_DIRECTION
Definition: dialog.h:266
GWEN_Dialog_ReadXml
GWENHYWFAR_API int GWEN_Dialog_ReadXml(GWEN_DIALOG *dlg, GWEN_XMLNODE *node)
GWEN_Dialog_SetI18nDomain
GWENHYWFAR_API void GWEN_Dialog_SetI18nDomain(GWEN_DIALOG *dlg, const char *s)
GWEN_DialogSortDirection_None
@ GWEN_DialogSortDirection_None
Definition: dialog.h:267
GWEN_DialogProperty_Width
@ GWEN_DialogProperty_Width
Definition: dialog.h:244
GWEN_Dialog_SetWidgetColumns
GWENHYWFAR_API void GWEN_Dialog_SetWidgetColumns(GWEN_DIALOG *dlg, const char *name, int i)
GWEN_DIALOG_SELECTION_MODE
GWEN_DIALOG_SELECTION_MODE
Definition: dialog.h:259
GWEN_Dialog_AddWidgetFlags
GWENHYWFAR_API void GWEN_Dialog_AddWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWEN_DB_NODE
struct GWEN_DB_NODE GWEN_DB_NODE
Definition: db.h:228
GWEN_DialogEvent_ResultNotHandled
@ GWEN_DialogEvent_ResultNotHandled
Definition: dialog.h:111
GWEN_DialogEvent_ResultHandled
@ GWEN_DialogEvent_ResultHandled
Definition: dialog.h:110
GWEN_DialogProperty_MinValue
@ GWEN_DialogProperty_MinValue
Definition: dialog.h:237
list2.h
This file contains some macros concerning lists.
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
GWEN_Dialog_free
GWENHYWFAR_API void GWEN_Dialog_free(GWEN_DIALOG *dlg)
GWEN_DialogEvent_TypeLast
@ GWEN_DialogEvent_TypeLast
Definition: dialog.h:99
GWEN_Dialog_GetId
const GWENHYWFAR_API char * GWEN_Dialog_GetId(const GWEN_DIALOG *dlg)
GWEN_Dialog_RemoveWidget
GWENHYWFAR_API int GWEN_Dialog_RemoveWidget(GWEN_DIALOG *dlg, const char *name)
GWEN_Dialog_GetWidgetColumns
GWENHYWFAR_API int GWEN_Dialog_GetWidgetColumns(const GWEN_DIALOG *dlg, const char *name)
list1.h
inherit.h
GWEN_DialogProperty_Unknown
@ GWEN_DialogProperty_Unknown
Definition: dialog.h:255
GWEN_DialogEvent_TypeFini
@ GWEN_DialogEvent_TypeFini
Definition: dialog.h:92
GWEN_Dialog_SelectionMode_None
@ GWEN_Dialog_SelectionMode_None
Definition: dialog.h:260