slog-enabled cbk use gsettings.
[psensor.git] / src / cfg.h
index 4319db9..6dcbca5 100644 (file)
--- a/src/cfg.h
+++ b/src/cfg.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2012 jeanfi@gmail.com
+ * Copyright (C) 2010-2014 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
 #ifndef _PSENSOR_CONFIG_H_
 #define _PSENSOR_CONFIG_H_
 
-#include "bool.h"
-#include "color.h"
+#include <bool.h>
+#include <color.h>
 
 enum temperature_unit {
-       CELCIUS,
+       CELSIUS,
        FAHRENHEIT
 };
 
@@ -42,9 +42,7 @@ struct config {
 
        bool alpha_channel_enabled;
 
-       /*
-        * Position of the sensors list table
-        */
+       /* Position of the sensors list table */
        enum sensorlist_position sensorlist_position;
 
        bool window_decoration_enabled;
@@ -72,11 +70,12 @@ struct config {
        int hide_on_startup;
 
        enum temperature_unit temperature_unit;
+
+       bool slog_enabled;
+       int slog_interval;
 };
 
-/*
-  Loads config from GConf
-*/
+/* Loads psensor configuration */
 struct config *config_load();
 
 void config_save(const struct config *);
@@ -104,4 +103,29 @@ void config_set_sensor_name(const char *, const char *);
 bool config_is_appindicator_enabled(const char *);
 void config_set_appindicator_enabled(const char *, bool);
 
+bool config_is_appindicator_label_enabled(const char *);
+void config_set_appindicator_label_enabled(const char *, bool);
+
+bool is_slog_enabled();
+void config_set_slog_enabled_changed_cbk(void (*)(void *), void *);
+
+int config_get_slog_interval();
+
+int config_get_sensor_position(const char *);
+void config_set_sensor_position(const char *, int);
+
+char *config_get_notif_script();
+void config_set_notif_script(const char *);
+
+/*
+ * Returns the user directory containing psensor data (configuration
+ * and log).
+ * Corresponds to $HOME/.psensor/
+ * Creates the directory if it does not exist;
+ * Returns NULL if it cannot be determined.
+ */
+const char *get_psensor_user_dir();
+
+void config_sync();
+
 #endif