summaryrefslogtreecommitdiff
path: root/logview/src/logview-prefs.h
blob: bc9c660843149c6ffcd84ce040b0698e7f2f87bf (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* logview-prefs.h - logview user preferences handling
 *
 * Copyright (C) 2004 Vincent Noel <vnoel@cox.net>
 * Copyright (C) 2008 Cosimo Cecchi <cosimoc@gnome.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef __LOGVIEW_PREFS_H__
#define __LOGVIEW_PREFS_H__

#include "logview-filter.h"

#define LOGVIEW_TYPE_PREFS logview_prefs_get_type()
#define LOGVIEW_PREFS(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), LOGVIEW_TYPE_PREFS, LogviewPrefs))
#define LOGVIEW_PREFS_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), LOGVIEW_TYPE_PREFS, LogviewPrefsClass))
#define LOGVIEW_IS_PREFS(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LOGVIEW_TYPE_PREFS))
#define LOGVIEW_IS_PREFS_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), LOGVIEW_TYPE_PREFS))
#define LOGVIEW_PREFS_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), LOGVIEW_TYPE_PREFS, LogviewPrefsClass))

typedef struct _LogviewPrefs LogviewPrefs;
typedef struct _LogviewPrefsClass LogviewPrefsClass;
typedef struct _LogviewPrefsPrivate LogviewPrefsPrivate;

struct _LogviewPrefs {
  GObject parent;
  LogviewPrefsPrivate *priv;
};

struct _LogviewPrefsClass {
  GObjectClass parent_class;

  /* signals */
  void (* system_font_changed)  (LogviewPrefs *prefs,
                                 const char *font_name);
  void (* have_tearoff_changed) (LogviewPrefs *prefs,
                                 gboolean have_tearoff);
  void (* filters_changed)      (LogviewPrefs *prefs);
};

GType          logview_prefs_get_type (void);

/* public methods */

LogviewPrefs *  logview_prefs_get (void);
void            logview_prefs_store_window_size       (LogviewPrefs *prefs,
                                                       int width, int height);
void            logview_prefs_get_stored_window_size  (LogviewPrefs *prefs,
                                                       int *width, int *height);
char *          logview_prefs_get_monospace_font_name (LogviewPrefs *prefs);
gboolean        logview_prefs_get_have_tearoff        (LogviewPrefs *prefs);
void            logview_prefs_store_log               (LogviewPrefs *prefs,
                                                       GFile *file);
void            logview_prefs_remove_stored_log       (LogviewPrefs *prefs,
                                                       GFile *target);
gchar **        logview_prefs_get_stored_logfiles     (LogviewPrefs *prefs);
void            logview_prefs_store_fontsize          (LogviewPrefs *prefs,
                                                       int fontsize);
int             logview_prefs_get_stored_fontsize     (LogviewPrefs *prefs);
void            logview_prefs_store_active_logfile    (LogviewPrefs *prefs,
                                                       const char *filename);
char *          logview_prefs_get_active_logfile      (LogviewPrefs *prefs);

GList *         logview_prefs_get_filters             (LogviewPrefs *prefs);
void            logview_prefs_remove_filter           (LogviewPrefs *prefs,
                                                       const gchar* name);
void            logview_prefs_add_filter              (LogviewPrefs *prefs,
                                                       LogviewFilter *filter);
LogviewFilter * logview_prefs_get_filter              (LogviewPrefs *prefs,
                                                       const gchar *name);

#endif /* __LOG_PREFS_H__ */