summaryrefslogtreecommitdiffstats
path: root/src/prefs-utils.h
blob: b60a674df8cbfd200d67a8571b4d33b14430d434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Utility functions for reading and setting preferences
 *
 * Authors:
 *   bulia byak <bulia@dr.com>
 *
 * Copyright (C) 2003 authors
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#ifndef SEEN_PREFS_UTILS_H
#define SEEN_PREFS_UTILS_H

#include <glib/gtypes.h>
#include <glib/gslist.h>

bool pref_path_exists(gchar const *path);
unsigned int pref_path_number_of_children(gchar const *path);
gchar * create_pref(gchar const *father_path, gchar const *child);
bool get_pref_children(gchar const *father_path, GSList ** children);
gchar * get_pref_nth_child(gchar const *father_path, unsigned int n);

void prefs_set_int_attribute(gchar const *path, gchar const *attr, long long int value);
long long int prefs_get_int_attribute(gchar const *path, gchar const *attr, long long int def);
long long int prefs_get_int_attribute_limited(gchar const *path, gchar const *attr, long long int def, long long int min, long long int max);

void prefs_set_double_attribute(gchar const *path, gchar const *attr, double value);
double prefs_get_double_attribute(gchar const *path, gchar const *attr, double def);
double prefs_get_double_attribute_limited(gchar const *path, gchar const *attr, double def, double min, double max);

gchar const *prefs_get_string_attribute(gchar const *path, gchar const *attr);
void prefs_set_string_attribute(gchar const *path, gchar const *attr, gchar const *value);

void prefs_set_recent_file(const gchar * uri, const gchar * name);
const gchar ** prefs_get_recent_files(void);

#endif /* !SEEN_PREFS_UTILS_H */

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :