view mcabber/mcabber/settings.h @ 2304:fa8365fb6ac2

[PATCH 1/3] New option: vi_mode If the new vi_mode option is set to 1, let MCabber's non-chat mode accept a few commands loosely based on those available in vi(1)'s normal mode, e.g.: A Call "/roster unread_first". a Call "/roster unread_next". F Call "/roster group_prev". f Call "/roster group_next". G Call "/roster bottom". gg Call "/roster top". i Enter chat mode. [<n>]j Call "/roster down [<n>]". [<n>]k Call "/roster up [<n>]". n Repeat the previous search (if any). O Call "/roster unread_first" and open chat window. o Call "/roster unread_next" and open chat window. ZZ Call "/quit". zM Call "/group fold" for all groups. zR Call "/group unfold" for all groups. <Space> Call "/group toggle" for the current group. '' Call "/roster alternate". ! Toggle attention flag for current buddy. # Toggle unread messages flag for current buddy. /<str> Call "/roster search <str>". :q Call "/quit". :wq Call "/quit". :x Call "/quit". :<n> Jump to line <n> in the roster. :<cmd> Call "/<cmd>" (unless <cmd> matches one of the above commands).
author Holger Weiß <holger@zedat.fu-berlin.de>
date Wed, 22 Jul 2015 19:25:22 +0200
parents ccd4ffa41a1b
children e00ae0763468
line wrap: on
line source

#ifndef __MCABBER_SETTINGS_H__
#define __MCABBER_SETTINGS_H__ 1

#include <ctype.h>
#include <glib.h>

#include <mcabber/roster.h>
#include <mcabber/config.h>

#ifndef isblank
# define isblank(c)  ((c) == 0x20 || (c) == 0x09)
#endif


#define SETTINGS_TYPE_OPTION    1
#define SETTINGS_TYPE_ALIAS     2
#define SETTINGS_TYPE_BINDING   3
#ifdef HAVE_LIBOTR
#define SETTINGS_TYPE_OTR       4
#endif

#define COMMAND_CHAR    '/'
#define COMMAND_CHARSTR "/"

#define settings_opt_get(k)     settings_get(SETTINGS_TYPE_OPTION, k)
#define settings_opt_get_int(k) settings_get_int(SETTINGS_TYPE_OPTION, k)

#define mkcmdstr(cmd) COMMAND_CHARSTR cmd

typedef gchar *(*settings_guard_t)(const gchar *key, const gchar *new_value);

void    settings_init(void);
const gchar *settings_get_mcabber_config_dir(void);
int     cfg_read_file(char *filename, guint mainfile);
guint   parse_assigment(gchar *assignment, gchar **pkey, gchar **pval);
gboolean settings_set_guard(const gchar *key, settings_guard_t guard);
void    settings_del_guard(const gchar *key);
void    settings_opt_set_raw(const gchar *key, const gchar *value);
void    settings_set(guint type, const gchar *key, const gchar *value);
void    settings_del(guint type, const gchar *key);
const gchar *settings_get(guint type, const gchar *key);
int     settings_get_int(guint type, const gchar *key);
const gchar *settings_get_status_msg(enum imstatus status);
void    settings_foreach(guint type,
                         void (*pfunc)(char *k, char *v, void *param),
                         void *param);

void    settings_pgp_setdisabled(const char *bjid, guint value);
guint   settings_pgp_getdisabled(const char *bjid);
void    settings_pgp_setforce(const char *bjid, guint value);
guint   settings_pgp_getforce(const char *bjid);
void    settings_pgp_setkeyid(const char *bjid, const char *keyid);
const char *settings_pgp_getkeyid(const char *bjid);

#ifdef HAVE_LIBOTR
guint   settings_otr_getpolicy(const char *bjid);
void    settings_otr_setpolicy(const char *bjid, guint value);
#endif

guint get_max_history_blocks(void);

char *default_muc_nickname(const char *roomid);

const gchar *isbound(int key);

#endif /* __MCABBER_SETTINGS_H__ */

/* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2:  For Vim users... */