text viewer: some modify text viewer's layout and preferences.
[kugel-rb.git] / apps / plugins / text_viewer / tv_preferences.h
blobd1ba7f25b4b093cf060d7b0015c63c9bec65fe37
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 Gilles Roux
11 * 2003 Garrett Derner
12 * 2010 Yoshihisa Uchida
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
23 #ifndef PLUGIN_TEXT_VIEWER_PREFERENCES_H
24 #define PLUGIN_TEXT_VIEWER_PREFERENCES_H
26 /* scrollbar_mode */
27 enum {
28 SB_OFF = 0,
29 SB_ON,
32 /* word_mode */
33 enum {
34 WM_WRAP = 0,
35 WM_CHOP,
38 /* line_mode */
39 enum {
40 LM_NORMAL = 0,
41 LM_JOIN,
42 LM_EXPAND,
43 LM_REFLOW,
46 /* alignment */
47 enum {
48 AL_LEFT = 0,
49 AL_RIGHT,
52 /* page_mode */
53 enum {
54 PM_NO_OVERLAP = 0,
55 PM_OVERLAP,
58 /* header_mode */
59 enum {
60 HD_NONE = 0,
61 HD_PATH,
64 /* footer_mode */
65 enum {
67 FT_NONE = 0,
68 FT_PAGE,
71 /* horizontal_scroll_mode */
72 enum {
73 HS_SCREEN = 0,
74 HS_COLUMN,
77 /* vertical_scroll_mode */
78 enum {
79 VS_PAGE = 0,
80 VS_LINE,
83 /* narrow_mode */
84 enum {
85 NM_PAGE = 0,
86 NM_TOP_BOTTOM,
89 struct tv_preferences {
90 unsigned word_mode;
91 unsigned line_mode;
92 unsigned alignment;
94 unsigned encoding;
96 unsigned horizontal_scrollbar;
97 unsigned vertical_scrollbar;
99 unsigned page_mode;
100 unsigned header_mode;
101 unsigned footer_mode;
102 unsigned horizontal_scroll_mode;
103 unsigned vertical_scroll_mode;
105 int autoscroll_speed;
107 int windows;
109 unsigned narrow_mode;
111 unsigned indent_spaces;
113 bool statusbar;
115 #ifdef HAVE_LCD_BITMAP
116 unsigned char font_name[MAX_PATH];
117 struct font *font;
118 #endif
119 unsigned char file_name[MAX_PATH];
123 * global pointer to the preferences (read-only)
125 extern const struct tv_preferences * const preferences;
128 * change the preferences
130 * [In] new_prefs
131 * new preferences
133 void tv_set_preferences(const struct tv_preferences *new_prefs);
136 * copy the preferences
138 * [Out] copy_prefs
139 * the preferences in copy destination
141 void tv_copy_preferences(struct tv_preferences *copy_prefs);
144 * set the default settings
146 * [Out] p
147 * the preferences which store the default settings
149 void tv_set_default_preferences(struct tv_preferences *p);
152 * register the function to be executed when the current preferences is changed
154 * [In] listner
155 * the function to be executed when the current preferences is changed
157 void tv_add_preferences_change_listner(void (*listner)(const struct tv_preferences *oldp));
159 #endif