Commit 5a5a3db0 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow

/home/aguelzow/tmp/cvsths1us

parent 7d3c6bfa
#ifndef GNUMERIC_GCONF_PRIV_H
#define GNUMERIC_GCONF_PRIV_H
/*
* Note: This file must stay synchronized with the corresponding schema file!
*
* This file should only be included into gnumeric-gconf.c and
* dialogs/dialog-preferences.c
*/
/*
* schemas/gnumeric-dialogs.schemas
*/
#define FUNCTION_SELECT_GCONF_RECENT "/apps/gnumeric/functionselector/recentfunctions"
#define FUNCTION_SELECT_GCONF_NUM_OF_RECENT "/apps/gnumeric/functionselector/num-of-recent"
#define AUTOCORRECT_DIRECTORY "/apps/gnumeric/autocorrect"
#define AUTOCORRECT_INIT_CAPS AUTOCORRECT_DIRECTORY "/init-caps"
#define AUTOCORRECT_INIT_CAPS_LIST AUTOCORRECT_DIRECTORY "/init-caps-list"
#define AUTOCORRECT_FIRST_LETTER AUTOCORRECT_DIRECTORY "/first-letter"
#define AUTOCORRECT_FIRST_LETTER_LIST AUTOCORRECT_DIRECTORY "/first-letter-list"
#define AUTOCORRECT_NAMES_OF_DAYS AUTOCORRECT_DIRECTORY "/names-of-days"
#define AUTOCORRECT_REPLACE AUTOCORRECT_DIRECTORY "/replace"
#define PLUGIN_GCONF_DIRECTORY "/apps/gnumeric/plugins"
#define PLUGIN_GCONF_ACTIVATE_NEW PLUGIN_GCONF_DIRECTORY "/activate-new"
#define PLUGIN_GCONF_ACTIVE PLUGIN_GCONF_DIRECTORY "/active"
#define PLUGIN_GCONF_KNOWN PLUGIN_GCONF_DIRECTORY "/known"
#define PLUGIN_GCONF_FILE_STATES PLUGIN_GCONF_DIRECTORY "/file-states"
#define PLUGIN_GCONF_EXTRA_DIRS PLUGIN_GCONF_DIRECTORY "/extra-dirs"
/*
* schemas/gnumeric-general.schemas
*/
#define GNUMERIC_GCONF_UNDO_DIRECTORY "/apps/gnumeric/undo"
#define GNUMERIC_GCONF_UNDO_SIZE GNUMERIC_GCONF_UNDO_DIRECTORY "/size"
#define GNUMERIC_GCONF_UNDO_MAXNUM GNUMERIC_GCONF_UNDO_DIRECTORY "/maxnum"
#define GNUMERIC_GCONF_UNDO_SHOW_SHEET_NAME GNUMERIC_GCONF_UNDO_DIRECTORY "/show_sheet_name"
#define GNUMERIC_GCONF_UNDO_MAX_DESCRIPTOR_WIDTH GNUMERIC_GCONF_UNDO_DIRECTORY "/max_descriptor_width"
#define GNUMERIC_GCONF_FONT_DIRECTORY "/apps/gnumeric/core/defaultfont"
#define GNUMERIC_GCONF_FONT_NAME GNUMERIC_GCONF_FONT_DIRECTORY "/name"
#define GNUMERIC_GCONF_FONT_SIZE GNUMERIC_GCONF_FONT_DIRECTORY "/size"
#define GNUMERIC_GCONF_FONT_BOLD GNUMERIC_GCONF_FONT_DIRECTORY "/bold"
#define GNUMERIC_GCONF_FONT_ITALIC GNUMERIC_GCONF_FONT_DIRECTORY "/italic"
#define GNUMERIC_GCONF_FILE_HISTORY_N "/apps/gnumeric/core/file/history/n"
#define GNUMERIC_GCONF_FILE_HISTORY_FILES "/apps/gnumeric/core/file/history/files"
#define GNUMERIC_GCONF_WORKBOOK_NSHEETS "/apps/gnumeric/core/workbook/n-sheet"
#define GNUMERIC_GCONF_GUI_RES_H "/apps/gnumeric/core/gui/screen/horizontaldpi"
#define GNUMERIC_GCONF_GUI_RES_V "/apps/gnumeric/core/gui/screen/verticaldpi"
#define GNUMERIC_GCONF_GUI_ED_AUTOCOMPLETE "/apps/gnumeric/core/gui/editing/autocomplete"
#define GNUMERIC_GCONF_GUI_ED_LIVESCROLLING "/apps/gnumeric/core/gui/editing/livescrolling"
#define GNUMERIC_GCONF_GUI_ED_RECALC_LAG "/apps/gnumeric/core/gui/editing/recalclag"
#include <gconf/gconf-client.h>
#endif /* GNUMERIC_GRAPH_H */
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gnumeric-gconf.c:
*
*
* Author:
* Andreas J. Guelzow <aguelzow@taliesin.ca>
*
* (C) Copyright 2002 Andreas J. Guelzow <aguelzow@taliesin.ca>
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gnumeric-config.h>
#include <gnumeric.h>
#include "application.h"
#include "gnumeric-gconf.h"
#include "gnumeric-gconf-priv.h"
#include <gconf/gconf-client.h>
void
gnm_conf_sync (void)
{
gconf_client_suggest_sync (application_get_gconf_client (), NULL);
}
GSList *
gnm_gconf_get_plugin_file_states (void)
{
return gconf_client_get_list (application_get_gconf_client (),
PLUGIN_GCONF_FILE_STATES,
GCONF_VALUE_STRING, NULL);
}
void
gnm_gconf_set_plugin_file_states (GSList *list)
{
gconf_client_set_list (application_get_gconf_client (),
PLUGIN_GCONF_FILE_STATES,
GCONF_VALUE_STRING, list, NULL);
}
GSList *
gnm_gconf_get_plugin_extra_dirs (void)
{
return gconf_client_get_list (application_get_gconf_client (),
PLUGIN_GCONF_EXTRA_DIRS,
GCONF_VALUE_STRING, NULL);
}
void
gnm_gconf_set_plugin_extra_dirs (GSList *list)
{
gconf_client_set_list (application_get_gconf_client (),
PLUGIN_GCONF_EXTRA_DIRS,
GCONF_VALUE_STRING, list, NULL);
}
GSList *
gnm_gconf_get_active_plugins (void)
{
return gconf_client_get_list (application_get_gconf_client (),
PLUGIN_GCONF_ACTIVE,
GCONF_VALUE_STRING, NULL);
}
void
gnm_gconf_set_active_plugins (GSList *list)
{
gconf_client_set_list (application_get_gconf_client (),
PLUGIN_GCONF_ACTIVE,
GCONF_VALUE_STRING, list, NULL);
}
GSList *
gnm_gconf_get_known_plugins (void)
{
return gconf_client_get_list (application_get_gconf_client (),
PLUGIN_GCONF_KNOWN,
GCONF_VALUE_STRING, NULL);
}
void
gnm_gconf_set_known_plugins (GSList *list)
{
gconf_client_set_list (application_get_gconf_client (),
PLUGIN_GCONF_KNOWN,
GCONF_VALUE_STRING, list, NULL);
}
gboolean
gnm_gconf_get_activate_new_plugins (void)
{
return gconf_client_get_bool (application_get_gconf_client (),
PLUGIN_GCONF_ACTIVATE_NEW,
NULL);
}
void
gnm_gconf_set_activate_new_plugins (gboolean val)
{
gconf_client_set_bool (application_get_gconf_client (),
PLUGIN_GCONF_ACTIVATE_NEW,
val, NULL);
}
GSList *
gnm_gconf_get_recent_funcs (void)
{
return gconf_client_get_list (application_get_gconf_client (),
FUNCTION_SELECT_GCONF_RECENT,
GCONF_VALUE_STRING, NULL);
}
void
gnm_gconf_set_recent_funcs (GSList *list)
{
gconf_client_set_list (application_get_gconf_client (),
FUNCTION_SELECT_GCONF_RECENT,
GCONF_VALUE_STRING, list, NULL);
}
guint
gnm_gconf_get_num_of_recent_funcs (void)
{
gint num = gconf_client_get_int (application_get_gconf_client (),
FUNCTION_SELECT_GCONF_NUM_OF_RECENT,
NULL);
if (num < 0)
return 0;
return (guint) num;
}
void
gnm_gconf_set_num_of_recent_funcs (guint val)
{
gconf_client_set_int (application_get_gconf_client (),
FUNCTION_SELECT_GCONF_NUM_OF_RECENT,
(gint) val, NULL);
}
gboolean
gnm_gconf_get_autocorrect_init_caps (void)
{
return gconf_client_get_bool (application_get_gconf_client (),
AUTOCORRECT_INIT_CAPS,
NULL);
}
void
gnm_gconf_set_autocorrect_init_caps (gboolean val)
{
gconf_client_set_bool (application_get_gconf_client (),
AUTOCORRECT_INIT_CAPS,
val, NULL);
}
gboolean
gnm_gconf_get_autocorrect_first_letter (void)
{
return gconf_client_get_bool (application_get_gconf_client (),
AUTOCORRECT_FIRST_LETTER,
NULL);
}
void
gnm_gconf_set_autocorrect_first_letter (gboolean val)
{
gconf_client_set_bool (application_get_gconf_client (),
AUTOCORRECT_FIRST_LETTER,
val, NULL);
}
gboolean
gnm_gconf_get_autocorrect_names_of_days (void)
{
return gconf_client_get_bool (application_get_gconf_client (),
AUTOCORRECT_NAMES_OF_DAYS,
NULL);
}
void
gnm_gconf_set_autocorrect_names_of_days (gboolean val)
{
gconf_client_set_bool (application_get_gconf_client (),
AUTOCORRECT_NAMES_OF_DAYS,
val, NULL);
}
gboolean
gnm_gconf_get_autocorrect_replace (void)
{
return gconf_client_get_bool (application_get_gconf_client (),
AUTOCORRECT_NAMES_OF_DAYS,
NULL);
}
void
gnm_gconf_set_autocorrect_replace (gboolean val)
{
gconf_client_set_bool (application_get_gconf_client (),
AUTOCORRECT_NAMES_OF_DAYS,
val, NULL);
}
GSList *
gnm_gconf_get_autocorrect_init_caps_exceptions (void)
{
return gconf_client_get_list (application_get_gconf_client (),
AUTOCORRECT_INIT_CAPS_LIST,
GCONF_VALUE_STRING, NULL);
}
void
gnm_gconf_set_autocorrect_init_caps_exceptions (GSList *list)
{
gconf_client_set_list (application_get_gconf_client (),
AUTOCORRECT_INIT_CAPS_LIST,
GCONF_VALUE_STRING, list, NULL);
}
GSList *
gnm_gconf_get_autocorrect_first_letter_exceptions (void)
{
return gconf_client_get_list (application_get_gconf_client (),
AUTOCORRECT_FIRST_LETTER_LIST,
GCONF_VALUE_STRING, NULL);
}
void
gnm_gconf_set_autocorrect_first_letter_exceptions (GSList *list)
{
gconf_client_set_list (application_get_gconf_client (),
AUTOCORRECT_FIRST_LETTER_LIST,
GCONF_VALUE_STRING, list, NULL);
}
guint
gnm_gconf_add_notification_autocorrect (GConfClientNotifyFunc func)
{
return gconf_client_notify_add (application_get_gconf_client (), AUTOCORRECT_DIRECTORY,
func, NULL, NULL, NULL);
}
guint
gnm_gconf_rm_notification_autocorrect (guint id)
{
gconf_client_notify_remove (application_get_gconf_client (), id);
return 0;
}
gnum_float
gnm_gconf_get_horizontal_dpi (void)
{
gnum_float val = gconf_client_get_float (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_RES_H,
NULL);
return ((val == 0.0) ? 96.0 : val);
}
void
gnm_gconf_set_horizontal_dpi (gnum_float val)
{
gconf_client_set_float (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_RES_H,
val, NULL);
}
gnum_float
gnm_gconf_get_vertical_dpi (void)
{
gnum_float val = gconf_client_get_float (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_RES_V,
NULL);
return ((val == 0.0) ? 96.0 : val);
}
void
gnm_gconf_set_vertical_dpi (gnum_float val)
{
gconf_client_set_float (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_RES_V,
val, NULL);
}
gboolean
gnm_gconf_get_auto_complete (void)
{
return gconf_client_get_bool (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_ED_AUTOCOMPLETE,
NULL);
}
void
gnm_gconf_set_auto_complete (gboolean val)
{
gconf_client_set_bool (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_ED_AUTOCOMPLETE,
val, NULL);
}
gboolean
gnm_gconf_get_live_scrolling (void)
{
return gconf_client_get_bool (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_ED_LIVESCROLLING,
NULL);
}
void
gnm_gconf_set_live_scrolling (gboolean val)
{
gconf_client_set_bool (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_ED_LIVESCROLLING,
val, NULL);
}
gint
gnm_gconf_get_recalc_lag (void)
{
gint val = gconf_client_get_int (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_ED_RECALC_LAG,
NULL);
return ((val == 0) ? 200 : val);
}
void
gnm_gconf_set_recalc_lag (gint val)
{
gconf_client_set_int (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_ED_RECALC_LAG,
val, NULL);
}
gint
gnm_gconf_get_file_history_max (void)
{
gint val = gconf_client_get_int (application_get_gconf_client (),
GNUMERIC_GCONF_FILE_HISTORY_N,
NULL);
return ((val < 0) ? 4 : val);
}
void
gnm_gconf_set_file_history_max (gint val)
{
gconf_client_set_int (application_get_gconf_client (),
GNUMERIC_GCONF_FILE_HISTORY_N,
val, NULL);
}
GSList *
gnm_gconf_get_file_history_files (void)
{
return gconf_client_get_list (application_get_gconf_client (),
GNUMERIC_GCONF_FILE_HISTORY_FILES,
GCONF_VALUE_STRING, NULL);
}
void
gnm_gconf_set_file_history_files (GSList *list)
{
gconf_client_set_list (application_get_gconf_client (),
GNUMERIC_GCONF_FILE_HISTORY_FILES,
GCONF_VALUE_STRING, list, NULL);
}
gint
gnm_gconf_get_initial_sheet_number (void)
{
gint val = gconf_client_get_int (application_get_gconf_client (),
GNUMERIC_GCONF_WORKBOOK_NSHEETS,
NULL);
return ((val <= 0) ? 1 : val);
}
void
gnm_gconf_set_initial_sheet_number (gint val)
{
gconf_client_set_int (application_get_gconf_client (),
GNUMERIC_GCONF_WORKBOOK_NSHEETS,
val, NULL);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment