Added initial revision of stock widget to repo.
[stockwidget] / lib-stock-settings.h
1 /*
2  * Stock Widget: Resource settings
3  * Jon Parr
4  */
5 #ifndef STOCK_SETTINGS_H
6 #define STOCK_SETTINGS_H
7
8 #include <gtk/gtk.h>
9
10 /* Configuration file entries */
11 #define STOCK_PLUGIN_APPLET_ID                  "stockwidget"
12 #define STOCK_PLUGIN_TICKERS                    "tickers"
13 #define STOCK_PLUGIN_UPDATE_TIME                "updatetime"
14 #define STOCK_PLUGIN_SETTINGS_FILE              "/stockwidget.config"
15 #define STOCK_PLUGIN_DEFAULT_TICKER             "IMG.L"
16
17 /*
18  * Struct used for holding settings stored out and loaded
19  * in from configuration file.
20  */
21 typedef struct _StockPluginSettings
22 {
23         /* Current number of stock tickers selectable in the settings dialog */
24         unsigned int uiNumTickers;
25         
26         /* Current stock ticker symbols selectable in the settings dialog.
27            The chosen one is always the first to make loading/saving chosen ticker easy as.
28          */
29         char **ppszTickers;
30
31         /* Number of minutes between an automatic update, if 0 no automatic updating */
32         unsigned int uiUpdateTime;
33
34         /* Applet ID used as key for config file */
35         gchar *iD;
36         
37 } StockPluginSettings;
38
39 void
40 stock_free_settings(StockPluginSettings *psSettings);
41
42 void
43 stock_set_default_settings(StockPluginSettings *psSettings);
44
45 void
46 stock_read_settings(StockPluginSettings *psSettings);
47
48 void
49 stock_save_settings(StockPluginSettings *psSettings);
50
51 #endif/*STOCK_SETTINGS_H*/