summaryrefslogtreecommitdiffstats
path: root/src/include/report/event_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/report/event_config.h')
-rw-r--r--src/include/report/event_config.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h
new file mode 100644
index 00000000..ee0cf7ab
--- /dev/null
+++ b/src/include/report/event_config.h
@@ -0,0 +1,51 @@
+#include <glib.h>
+
+typedef enum
+{
+ OPTION_TYPE_TEXT,
+ OPTION_TYPE_BOOL,
+ OPTION_TYPE_PASSWORD,
+ OPTION_TYPE_NUMBER,
+ OPTION_TYPE_INVALID,
+} option_type_t;
+
+/*
+ * struct to hold information about config options
+ * it's supposed to hold information about:
+ * type -> which designates the widget used to display it and we can do some test based on the type
+ * label
+ * allowed value(s) -> regexp?
+ * name -> env variable name
+ * value -> value retrieved from the gui, so when we want to set the env
+ * evn variables, we can just traverse the list of the options
+ * and set the env variables according to name:value in this structure
+ */
+typedef struct
+{
+ char *name; //name of the value which should be used for env variable
+ char *value;
+ char *label;
+ option_type_t type;
+ char *description; //can be used as tooltip in gtk app
+ char *allowed_value;
+ int required;
+} event_option_t;
+
+//structure to hold the option data
+typedef struct
+{
+ char *name; //name of the event "Bugzilla" "RedHat Support Uploader"
+ char *title; //window title - not used right now, maybe the "name" is enough?
+ char *action;//action description to show in gui like: Upload report to the Red Hat bugzilla"
+ GList *options;
+} event_config_t;
+
+void load_event_description_from_file(event_config_t *event_config, const char* filename);
+
+// (Re)loads data from /etc/abrt/events/*.{conf,xml}
+void load_event_config_data(void);
+/* Frees all loaded data */
+void free_event_config_data(void);
+event_config_t *get_event_config(const char *name);
+
+extern GList *g_event_config_list; // for iterating through entire list of all loaded configs \ No newline at end of file