Added initial revision of stock widget to repo.
[stockwidget] / lib-stock-settings.h
diff --git a/lib-stock-settings.h b/lib-stock-settings.h
new file mode 100644 (file)
index 0000000..02683e9
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Stock Widget: Resource settings
+ * Jon Parr
+ */
+#ifndef STOCK_SETTINGS_H
+#define STOCK_SETTINGS_H
+
+#include <gtk/gtk.h>
+
+/* Configuration file entries */
+#define STOCK_PLUGIN_APPLET_ID                 "stockwidget"
+#define STOCK_PLUGIN_TICKERS                   "tickers"
+#define STOCK_PLUGIN_UPDATE_TIME               "updatetime"
+#define STOCK_PLUGIN_SETTINGS_FILE             "/stockwidget.config"
+#define STOCK_PLUGIN_DEFAULT_TICKER            "IMG.L"
+
+/*
+ * Struct used for holding settings stored out and loaded
+ * in from configuration file.
+ */
+typedef struct _StockPluginSettings
+{
+       /* Current number of stock tickers selectable in the settings dialog */
+       unsigned int uiNumTickers;
+       
+       /* Current stock ticker symbols selectable in the settings dialog.
+          The chosen one is always the first to make loading/saving chosen ticker easy as.
+        */
+       char **ppszTickers;
+
+       /* Number of minutes between an automatic update, if 0 no automatic updating */
+       unsigned int uiUpdateTime;
+
+       /* Applet ID used as key for config file */
+       gchar *iD;
+       
+} StockPluginSettings;
+
+void
+stock_free_settings(StockPluginSettings *psSettings);
+
+void
+stock_set_default_settings(StockPluginSettings *psSettings);
+
+void
+stock_read_settings(StockPluginSettings *psSettings);
+
+void
+stock_save_settings(StockPluginSettings *psSettings);
+
+#endif/*STOCK_SETTINGS_H*/