2012-10-21 15:02:20 -04:00
|
|
|
/*
|
2012-05-09 22:29:48 -04:00
|
|
|
* preferences.h
|
|
|
|
*
|
2013-01-10 21:05:29 -05:00
|
|
|
* Copyright (C) 2012, 2013 James Booth <boothj5@gmail.com>
|
2012-10-21 15:02:20 -04:00
|
|
|
*
|
2012-05-09 22:29:48 -04:00
|
|
|
* This file is part of Profanity.
|
|
|
|
*
|
|
|
|
* Profanity 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Profanity 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 Profanity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PREFERENCES_H
|
|
|
|
#define PREFERENCES_H
|
|
|
|
|
2012-09-08 11:51:09 -04:00
|
|
|
#include "config.h"
|
|
|
|
|
2012-05-10 04:55:55 -04:00
|
|
|
#include <glib.h>
|
2013-01-02 15:27:37 -05:00
|
|
|
#ifdef HAVE_NCURSESW_NCURSES_H
|
|
|
|
#include <ncursesw/ncurses.h>
|
2013-01-03 19:35:54 -05:00
|
|
|
#elif HAVE_NCURSES_H
|
|
|
|
#include <ncurses.h>
|
2012-09-08 11:51:09 -04:00
|
|
|
#endif
|
2012-05-10 04:55:55 -04:00
|
|
|
|
2012-11-12 04:13:03 -05:00
|
|
|
#define PREFS_MIN_LOG_SIZE 64
|
2012-11-11 16:44:55 -05:00
|
|
|
#define PREFS_MAX_LOG_SIZE 1048580
|
|
|
|
|
2013-02-02 21:35:04 -05:00
|
|
|
typedef enum {
|
|
|
|
PREF_SPLASH,
|
|
|
|
PREF_BEEP,
|
|
|
|
PREF_VERCHECK,
|
|
|
|
PREF_THEME,
|
|
|
|
PREF_TITLEBARVERSION,
|
|
|
|
PREF_FLASH,
|
|
|
|
PREF_INTYPE,
|
|
|
|
PREF_HISTORY,
|
|
|
|
PREF_MOUSE,
|
|
|
|
PREF_STATUSES,
|
2014-01-19 11:17:34 -05:00
|
|
|
PREF_STATUSES_CONSOLE,
|
|
|
|
PREF_STATUSES_CHAT,
|
|
|
|
PREF_STATUSES_MUC,
|
2013-02-02 21:35:04 -05:00
|
|
|
PREF_STATES,
|
|
|
|
PREF_OUTTYPE,
|
|
|
|
PREF_NOTIFY_TYPING,
|
|
|
|
PREF_NOTIFY_MESSAGE,
|
2013-04-22 18:48:23 -04:00
|
|
|
PREF_NOTIFY_INVITE,
|
2013-04-27 18:46:49 -04:00
|
|
|
PREF_NOTIFY_SUB,
|
2013-02-02 21:35:04 -05:00
|
|
|
PREF_CHLOG,
|
2013-05-04 19:16:10 -04:00
|
|
|
PREF_GRLOG,
|
2013-02-02 22:24:13 -05:00
|
|
|
PREF_AUTOAWAY_CHECK,
|
|
|
|
PREF_AUTOAWAY_MODE,
|
2013-11-07 18:04:12 -05:00
|
|
|
PREF_AUTOAWAY_MESSAGE,
|
2014-01-13 15:17:45 -05:00
|
|
|
PREF_CONNECT_ACCOUNT,
|
2014-01-16 17:44:23 -05:00
|
|
|
PREF_OTR_LOG,
|
|
|
|
PREF_OTR_WARN
|
2013-02-02 21:35:04 -05:00
|
|
|
} preference_t;
|
|
|
|
|
2014-01-23 17:29:53 -05:00
|
|
|
typedef struct prof_alias_t {
|
|
|
|
gchar *name;
|
|
|
|
gchar *value;
|
|
|
|
} ProfAlias;
|
|
|
|
|
2012-05-09 22:29:48 -04:00
|
|
|
void prefs_load(void);
|
2012-07-31 18:01:15 -04:00
|
|
|
void prefs_close(void);
|
2012-05-09 22:29:48 -04:00
|
|
|
|
2012-10-21 18:46:30 -04:00
|
|
|
char * prefs_find_login(char *prefix);
|
|
|
|
void prefs_reset_login_search(void);
|
2012-10-22 17:15:06 -04:00
|
|
|
char * prefs_autocomplete_boolean_choice(char *prefix);
|
|
|
|
void prefs_reset_boolean_choice(void);
|
2012-05-10 18:51:06 -04:00
|
|
|
|
2012-12-19 18:31:25 -05:00
|
|
|
gint prefs_get_gone(void);
|
|
|
|
void prefs_set_gone(gint value);
|
2012-05-10 04:55:55 -04:00
|
|
|
|
2012-10-27 17:05:08 -04:00
|
|
|
void prefs_set_notify_remind(gint period);
|
|
|
|
gint prefs_get_notify_remind(void);
|
2012-11-12 04:13:03 -05:00
|
|
|
void prefs_set_max_log_size(gint value);
|
2012-11-11 16:44:55 -05:00
|
|
|
gint prefs_get_max_log_size(void);
|
2012-11-13 05:51:28 -05:00
|
|
|
void prefs_set_priority(gint value);
|
|
|
|
gint prefs_get_priority(void);
|
2012-11-24 21:14:38 -05:00
|
|
|
void prefs_set_reconnect(gint value);
|
|
|
|
gint prefs_get_reconnect(void);
|
2012-11-26 18:58:24 -05:00
|
|
|
void prefs_set_autoping(gint value);
|
|
|
|
gint prefs_get_autoping(void);
|
2012-10-27 17:05:08 -04:00
|
|
|
|
2012-11-30 18:34:14 -05:00
|
|
|
gint prefs_get_autoaway_time(void);
|
|
|
|
void prefs_set_autoaway_time(gint value);
|
|
|
|
|
2012-07-22 18:07:34 -04:00
|
|
|
void prefs_add_login(const char *jid);
|
|
|
|
|
2014-01-23 17:38:12 -05:00
|
|
|
gboolean prefs_add_alias(const char * const name, const char * const value);
|
2014-01-23 17:29:53 -05:00
|
|
|
gboolean prefs_remove_alias(const char * const name);
|
|
|
|
char* prefs_get_alias(const char * const name);
|
|
|
|
GList* prefs_get_aliases(void);
|
|
|
|
void prefs_free_aliases(GList *aliases);
|
|
|
|
|
2013-02-02 21:35:04 -05:00
|
|
|
gboolean prefs_get_boolean(preference_t pref);
|
2013-02-02 21:51:15 -05:00
|
|
|
void prefs_set_boolean(preference_t pref, gboolean value);
|
2013-02-02 22:24:13 -05:00
|
|
|
char * prefs_get_string(preference_t pref);
|
|
|
|
void prefs_set_string(preference_t pref, char *value);
|
2013-02-02 21:35:04 -05:00
|
|
|
|
2012-05-09 22:29:48 -04:00
|
|
|
#endif
|