xed/pluma/pluma-prefs-manager.h

337 lines
12 KiB
C
Raw Normal View History

2011-11-07 13:46:58 -06:00
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
2011-11-07 16:52:18 -06:00
* pluma-prefs-manager.h
* This file is part of pluma
2011-11-07 13:46:58 -06:00
*
2011-11-07 18:10:16 -06:00
* Copyright (C) 2002 Paolo Maggi
2011-11-07 13:46:58 -06:00
*
* 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
2012-11-18 19:54:49 -06:00
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
2011-11-07 13:46:58 -06:00
*/
2011-11-07 18:10:16 -06:00
2011-11-07 13:46:58 -06:00
/*
2011-11-07 18:10:16 -06:00
* Modified by the pluma Team, 2002. See the AUTHORS file for a
* list of people on the pluma Team.
* See the ChangeLog files for a list of changes.
2011-11-07 13:46:58 -06:00
*/
2011-11-07 16:52:18 -06:00
#ifndef __PLUMA_PREFS_MANAGER_H__
#define __PLUMA_PREFS_MANAGER_H__
2011-11-07 13:46:58 -06:00
#include <gtk/gtk.h>
#include <glib.h>
#include <gtksourceview/gtksourceview.h>
2011-11-07 16:52:18 -06:00
#include "pluma-app.h"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define PLUMA_SCHEMA "org.mate.pluma"
2011-11-07 13:46:58 -06:00
/* Editor */
2013-01-24 14:03:53 -06:00
#define GPM_USE_DEFAULT_FONT "use-default-font"
#define GPM_EDITOR_FONT "editor-font"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_CREATE_BACKUP_COPY "create-backup-copy"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_AUTO_SAVE "auto-save"
#define GPM_AUTO_SAVE_INTERVAL "auto-save-interval"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_UNDO_ACTIONS_LIMIT "max-undo-actions"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_WRAP_MODE "wrap-mode"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_TABS_SIZE "tabs-size"
#define GPM_INSERT_SPACES "insert-spaces"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_AUTO_INDENT "auto-indent"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_DISPLAY_LINE_NUMBERS "display-line-numbers"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_HIGHLIGHT_CURRENT_LINE "highlight-current-line"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_BRACKET_MATCHING "bracket-matching"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_DISPLAY_RIGHT_MARGIN "display-right-margin"
#define GPM_RIGHT_MARGIN_POSITION "right-margin-position"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_SMART_HOME_END "smart-home-end"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_RESTORE_CURSOR_POSITION "restore-cursor-position"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_SEARCH_HIGHLIGHTING_ENABLE "enable-search-highlighting"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_SOURCE_STYLE_SCHEME "color-scheme"
2011-11-07 13:46:58 -06:00
/* UI */
2013-01-24 14:03:53 -06:00
#define GPM_TOOLBAR_VISIBLE "toolbar-visible"
#define GPM_TOOLBAR_BUTTONS_STYLE "toolbar-buttons-style"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_STATUSBAR_VISIBLE "statusbar-visible"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_SIDE_PANE_VISIBLE "side-pane-visible"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_BOTTOM_PANEL_VISIBLE "bottom-panel-visible"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_MAX_RECENTS "max-recents"
2011-11-07 13:46:58 -06:00
/* Print */
2013-01-24 14:03:53 -06:00
#define GPM_PRINT_SYNTAX "print-syntax-highlighting"
#define GPM_PRINT_HEADER "print-header"
#define GPM_PRINT_WRAP_MODE "print-wrap-mode"
#define GPM_PRINT_LINE_NUMBERS "print-line-numbers"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
#define GPM_PRINT_FONT_BODY "print-font-body-pango"
#define GPM_PRINT_FONT_HEADER "print-font-header-pango"
#define GPM_PRINT_FONT_NUMBERS "print-font-numbers-pango"
2011-11-07 13:46:58 -06:00
/* Encodings */
2013-01-24 14:03:53 -06:00
#define GPM_AUTO_DETECTED_ENCODINGS "auto-detected-encodings"
#define GPM_SHOWN_IN_MENU_ENCODINGS "shown-in-menu-encodings"
2011-11-07 13:46:58 -06:00
/* Syntax highlighting */
2013-01-24 14:03:53 -06:00
#define GPM_SYNTAX_HL_ENABLE "enable-syntax-highlighting"
2011-11-07 13:46:58 -06:00
/* White list of writable mate-vfs methods */
2013-01-24 14:03:53 -06:00
#define GPM_WRITABLE_VFS_SCHEMES "writable-vfs-schemes"
2011-11-07 13:46:58 -06:00
/* Plugins */
2013-01-24 14:03:53 -06:00
#define GPM_ACTIVE_PLUGINS "active-plugins"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
/* Global Interface keys */
#define GPM_INTERFACE_SCHEMA "org.mate.interface"
#define GPM_SYSTEM_FONT "monospace-font-name"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
/* Global Lockdown keys */
#define GPM_LOCKDOWN_SCHEMA "org.mate.lockdown"
#define GPM_LOCKDOWN_COMMAND_LINE "disable-command-line"
#define GPM_LOCKDOWN_PRINTING "disable-printing"
#define GPM_LOCKDOWN_PRINT_SETUP "disable-print-setup"
#define GPM_LOCKDOWN_SAVE_TO_DISK "disable-save-to-disk"
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
/* Fallback default values. Keep in sync with org.mate.pluma.gschema.xml */
2011-11-07 13:46:58 -06:00
#define GPM_DEFAULT_AUTO_SAVE_INTERVAL 10 /* minutes */
2013-01-24 14:03:53 -06:00
#define GPM_DEFAULT_MAX_RECENTS 5
2011-11-07 13:46:58 -06:00
typedef enum {
2011-11-07 16:52:18 -06:00
PLUMA_TOOLBAR_SYSTEM = 0,
PLUMA_TOOLBAR_ICONS,
PLUMA_TOOLBAR_ICONS_AND_TEXT,
PLUMA_TOOLBAR_ICONS_BOTH_HORIZ
} PlumaToolbarSetting;
2011-11-07 13:46:58 -06:00
/** LIFE CYCLE MANAGEMENT FUNCTIONS **/
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_init (void);
2011-11-07 13:46:58 -06:00
2011-11-07 16:52:18 -06:00
/* This function must be called before exiting pluma */
void pluma_prefs_manager_shutdown (void);
2011-11-07 13:46:58 -06:00
/** PREFS MANAGEMENT FUNCTIONS **/
/* Use default font */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_use_default_font (void);
void pluma_prefs_manager_set_use_default_font (gboolean udf);
gboolean pluma_prefs_manager_use_default_font_can_set (void);
2011-11-07 13:46:58 -06:00
/* Editor font */
2011-11-07 16:52:18 -06:00
gchar *pluma_prefs_manager_get_editor_font (void);
void pluma_prefs_manager_set_editor_font (const gchar *font);
gboolean pluma_prefs_manager_editor_font_can_set (void);
2011-11-07 13:46:58 -06:00
/* System font */
2011-11-07 16:52:18 -06:00
gchar *pluma_prefs_manager_get_system_font (void);
2011-11-07 13:46:58 -06:00
/* Create backup copy */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_create_backup_copy (void);
void pluma_prefs_manager_set_create_backup_copy (gboolean cbc);
gboolean pluma_prefs_manager_create_backup_copy_can_set (void);
2011-11-07 13:46:58 -06:00
/* Auto save */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_auto_save (void);
void pluma_prefs_manager_set_auto_save (gboolean as);
gboolean pluma_prefs_manager_auto_save_can_set (void);
2011-11-07 13:46:58 -06:00
/* Auto save interval */
2011-11-07 16:52:18 -06:00
gint pluma_prefs_manager_get_auto_save_interval (void);
void pluma_prefs_manager_set_auto_save_interval (gint asi);
gboolean pluma_prefs_manager_auto_save_interval_can_set (void);
2011-11-07 13:46:58 -06:00
/* Undo actions limit: if < 1 then no limits */
2011-11-07 16:52:18 -06:00
gint pluma_prefs_manager_get_undo_actions_limit (void);
void pluma_prefs_manager_set_undo_actions_limit (gint ual);
gboolean pluma_prefs_manager_undo_actions_limit_can_set (void);
2011-11-07 13:46:58 -06:00
/* Wrap mode */
2011-11-07 16:52:18 -06:00
GtkWrapMode pluma_prefs_manager_get_wrap_mode (void);
void pluma_prefs_manager_set_wrap_mode (GtkWrapMode wp);
gboolean pluma_prefs_manager_wrap_mode_can_set (void);
2011-11-07 13:46:58 -06:00
/* Tabs size */
2011-11-07 16:52:18 -06:00
gint pluma_prefs_manager_get_tabs_size (void);
void pluma_prefs_manager_set_tabs_size (gint ts);
gboolean pluma_prefs_manager_tabs_size_can_set (void);
2011-11-07 13:46:58 -06:00
/* Insert spaces */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_insert_spaces (void);
void pluma_prefs_manager_set_insert_spaces (gboolean ai);
gboolean pluma_prefs_manager_insert_spaces_can_set (void);
2011-11-07 13:46:58 -06:00
/* Auto indent */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_auto_indent (void);
void pluma_prefs_manager_set_auto_indent (gboolean ai);
gboolean pluma_prefs_manager_auto_indent_can_set (void);
2011-11-07 13:46:58 -06:00
/* Display line numbers */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_display_line_numbers (void);
void pluma_prefs_manager_set_display_line_numbers (gboolean dln);
gboolean pluma_prefs_manager_display_line_numbers_can_set (void);
2011-11-07 13:46:58 -06:00
/* Toolbar visible */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_toolbar_visible (void);
void pluma_prefs_manager_set_toolbar_visible (gboolean tv);
gboolean pluma_prefs_manager_toolbar_visible_can_set (void);
2011-11-07 13:46:58 -06:00
/* Toolbar buttons style */
2011-11-07 18:10:16 -06:00
PlumaToolbarSetting pluma_prefs_manager_get_toolbar_buttons_style (void);
void pluma_prefs_manager_set_toolbar_buttons_style (PlumaToolbarSetting tbs);
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_toolbar_buttons_style_can_set (void);
2011-11-07 13:46:58 -06:00
/* Statusbar visible */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_statusbar_visible (void);
void pluma_prefs_manager_set_statusbar_visible (gboolean sv);
gboolean pluma_prefs_manager_statusbar_visible_can_set (void);
2011-11-07 13:46:58 -06:00
/* Side pane visible */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_side_pane_visible (void);
void pluma_prefs_manager_set_side_pane_visible (gboolean tv);
gboolean pluma_prefs_manager_side_pane_visible_can_set (void);
2011-11-07 13:46:58 -06:00
/* Bottom panel visible */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_bottom_panel_visible (void);
void pluma_prefs_manager_set_bottom_panel_visible (gboolean tv);
gboolean pluma_prefs_manager_bottom_panel_visible_can_set(void);
2011-11-07 13:46:58 -06:00
/* Print syntax highlighting */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_print_syntax_hl (void);
void pluma_prefs_manager_set_print_syntax_hl (gboolean ps);
gboolean pluma_prefs_manager_print_syntax_hl_can_set (void);
2011-11-07 13:46:58 -06:00
/* Print header */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_print_header (void);
void pluma_prefs_manager_set_print_header (gboolean ph);
gboolean pluma_prefs_manager_print_header_can_set (void);
2011-11-07 18:10:16 -06:00
2011-11-07 13:46:58 -06:00
/* Wrap mode while printing */
2011-11-07 16:52:18 -06:00
GtkWrapMode pluma_prefs_manager_get_print_wrap_mode (void);
void pluma_prefs_manager_set_print_wrap_mode (GtkWrapMode pwm);
gboolean pluma_prefs_manager_print_wrap_mode_can_set (void);
2011-11-07 13:46:58 -06:00
2011-11-07 18:10:16 -06:00
/* Print line numbers */
2011-11-07 16:52:18 -06:00
gint pluma_prefs_manager_get_print_line_numbers (void);
void pluma_prefs_manager_set_print_line_numbers (gint pln);
gboolean pluma_prefs_manager_print_line_numbers_can_set (void);
2011-11-07 13:46:58 -06:00
/* Font used to print the body of documents */
2011-11-07 16:52:18 -06:00
gchar *pluma_prefs_manager_get_print_font_body (void);
void pluma_prefs_manager_set_print_font_body (const gchar *font);
gboolean pluma_prefs_manager_print_font_body_can_set (void);
2013-01-24 14:03:53 -06:00
gchar *pluma_prefs_manager_get_default_print_font_body (void);
2011-11-07 13:46:58 -06:00
/* Font used to print headers */
2011-11-07 16:52:18 -06:00
gchar *pluma_prefs_manager_get_print_font_header (void);
void pluma_prefs_manager_set_print_font_header (const gchar *font);
gboolean pluma_prefs_manager_print_font_header_can_set (void);
2013-01-24 14:03:53 -06:00
gchar *pluma_prefs_manager_get_default_print_font_header (void);
2011-11-07 13:46:58 -06:00
/* Font used to print line numbers */
2011-11-07 16:52:18 -06:00
gchar *pluma_prefs_manager_get_print_font_numbers (void);
void pluma_prefs_manager_set_print_font_numbers (const gchar *font);
gboolean pluma_prefs_manager_print_font_numbers_can_set (void);
2013-01-24 14:03:53 -06:00
gchar *pluma_prefs_manager_get_default_print_font_numbers (void);
2011-11-07 13:46:58 -06:00
2011-11-07 18:10:16 -06:00
/* Max number of files in "Recent Files" menu.
2013-01-24 14:03:53 -06:00
* This is configurable only using gsettings, dconf or dconf-editor
2011-11-07 13:46:58 -06:00
*/
2011-11-07 16:52:18 -06:00
gint pluma_prefs_manager_get_max_recents (void);
2011-11-07 13:46:58 -06:00
/* Encodings */
2011-11-07 16:52:18 -06:00
GSList *pluma_prefs_manager_get_auto_detected_encodings (void);
2011-11-07 13:46:58 -06:00
2011-11-07 16:52:18 -06:00
GSList *pluma_prefs_manager_get_shown_in_menu_encodings (void);
void pluma_prefs_manager_set_shown_in_menu_encodings (const GSList *encs);
gboolean pluma_prefs_manager_shown_in_menu_encodings_can_set (void);
2011-11-07 13:46:58 -06:00
/* Highlight current line */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_highlight_current_line (void);
void pluma_prefs_manager_set_highlight_current_line (gboolean hl);
gboolean pluma_prefs_manager_highlight_current_line_can_set (void);
2011-11-07 13:46:58 -06:00
/* Highlight matching bracket */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_bracket_matching (void);
void pluma_prefs_manager_set_bracket_matching (gboolean bm);
gboolean pluma_prefs_manager_bracket_matching_can_set (void);
2011-11-07 13:46:58 -06:00
/* Display right margin */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_display_right_margin (void);
void pluma_prefs_manager_set_display_right_margin (gboolean drm);
gboolean pluma_prefs_manager_display_right_margin_can_set (void);
2011-11-07 13:46:58 -06:00
/* Right margin position */
2011-11-07 16:52:18 -06:00
gint pluma_prefs_manager_get_right_margin_position (void);
void pluma_prefs_manager_set_right_margin_position (gint rmp);
gboolean pluma_prefs_manager_right_margin_position_can_set (void);
2011-11-07 13:46:58 -06:00
/* Smart home end */
GtkSourceSmartHomeEndType
2011-11-07 16:52:18 -06:00
pluma_prefs_manager_get_smart_home_end (void);
void pluma_prefs_manager_set_smart_home_end (GtkSourceSmartHomeEndType smart_he);
gboolean pluma_prefs_manager_smart_home_end_can_set (void);
2011-11-07 13:46:58 -06:00
/* Enable syntax highlighting */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_enable_syntax_highlighting (void);
void pluma_prefs_manager_set_enable_syntax_highlighting (gboolean esh);
gboolean pluma_prefs_manager_enable_syntax_highlighting_can_set (void);
2011-11-07 13:46:58 -06:00
/* Writable VFS schemes */
2011-11-07 16:52:18 -06:00
GSList *pluma_prefs_manager_get_writable_vfs_schemes (void);
2011-11-07 13:46:58 -06:00
/* Restore cursor position */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_restore_cursor_position (void);
2011-11-07 13:46:58 -06:00
/* Enable search highlighting */
2011-11-07 16:52:18 -06:00
gboolean pluma_prefs_manager_get_enable_search_highlighting (void);
void pluma_prefs_manager_set_enable_search_highlighting (gboolean esh);
gboolean pluma_prefs_manager_enable_search_highlighting_can_set (void);
2011-11-07 13:46:58 -06:00
/* Style scheme */
2011-11-07 16:52:18 -06:00
gchar *pluma_prefs_manager_get_source_style_scheme (void);
void pluma_prefs_manager_set_source_style_scheme (const gchar *scheme);
gboolean pluma_prefs_manager_source_style_scheme_can_set(void);
2011-11-07 13:46:58 -06:00
/* Plugins */
2011-11-07 16:52:18 -06:00
GSList *pluma_prefs_manager_get_active_plugins (void);
void pluma_prefs_manager_set_active_plugins (const GSList *plugins);
gboolean pluma_prefs_manager_active_plugins_can_set (void);
2011-11-07 13:46:58 -06:00
/* Global lockdown */
2011-11-07 16:52:18 -06:00
PlumaLockdownMask pluma_prefs_manager_get_lockdown (void);
2011-11-07 13:46:58 -06:00
2013-01-24 14:03:53 -06:00
/* GSettings utilities */
GSList* pluma_prefs_manager_get_gslist (GSettings *settings, const gchar *key);
void pluma_prefs_manager_set_gslist (GSettings *settings, const gchar *key, GSList *list);
2011-11-07 16:52:18 -06:00
#endif /* __PLUMA_PREFS_MANAGER_H__ */
2011-11-07 13:46:58 -06:00