1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00
profanity/src/config/preferences.h

113 lines
2.9 KiB
C
Raw Normal View History

/*
2012-05-09 22:29:48 -04:00
* preferences.h
*
2014-03-08 20:18:19 -05:00
* Copyright (C) 2012 - 2014 James Booth <boothj5@gmail.com>
*
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"
#include <glib.h>
2013-01-02 15:27:37 -05:00
#ifdef HAVE_NCURSESW_NCURSES_H
#include <ncursesw/ncurses.h>
#elif HAVE_NCURSES_H
#include <ncurses.h>
2012-09-08 11:51:09 -04:00
#endif
#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_TITLEBAR,
2013-02-02 21:35:04 -05:00
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,
PREF_NOTIFY_INVITE,
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,
PREF_AUTOAWAY_MESSAGE,
2014-01-13 15:17:45 -05:00
PREF_CONNECT_ACCOUNT,
PREF_OTR_LOG,
2014-04-13 15:41:11 -04:00
PREF_OTR_WARN,
PREF_LOG_ROTATE
2013-02-02 21:35:04 -05:00
} preference_t;
typedef struct prof_alias_t {
gchar *name;
gchar *value;
} ProfAlias;
2012-05-09 22:29:48 -04:00
void prefs_load(void);
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);
char * prefs_autocomplete_boolean_choice(char *prefix);
void prefs_reset_boolean_choice(void);
2012-05-10 18:51:06 -04:00
gint prefs_get_gone(void);
void prefs_set_gone(gint value);
void prefs_set_notify_remind(gint period);
gint prefs_get_notify_remind(void);
void prefs_set_max_log_size(gint value);
2012-11-11 16:44:55 -05:00
gint prefs_get_max_log_size(void);
void prefs_set_priority(gint value);
gint prefs_get_priority(void);
void prefs_set_reconnect(gint value);
gint prefs_get_reconnect(void);
void prefs_set_autoping(gint value);
gint prefs_get_autoping(void);
2012-11-30 18:34:14 -05:00
gint prefs_get_autoaway_time(void);
void prefs_set_autoaway_time(gint value);
void prefs_add_login(const char *jid);
gboolean prefs_add_alias(const char * const name, const char * const value);
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