Prepare new maemo release
[maemo-rb.git] / apps / plugins / text_viewer / tv_action.h
blob5b3571db308de1e716fe97d70265ec9175f31165
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_ACTION_H
24 #define PLUGIN_TEXT_VIEWER_ACTION_H
26 #include "tv_menu.h"
28 /* horizontal scroll mode */
29 enum
31 TV_HORIZONTAL_SCROLL_COLUMN = 0, /* left/right one column */
32 TV_HORIZONTAL_SCROLL_SCREEN, /* left/right one screen */
33 TV_HORIZONTAL_SCROLL_PREFS, /* left/right follows the settings */
36 /*vertical scroll mode */
37 enum
39 TV_VERTICAL_SCROLL_LINE = 0, /* up/down one line */
40 TV_VERTICAL_SCROLL_PAGE, /* up/down one page */
41 TV_VERTICAL_SCROLL_PREFS, /* up/down follows the settings */
45 * initialize the action module
47 * [In/Out] buf
48 * the start pointer of the buffer
50 * [In/Out] size
51 * buffer size
53 * return
54 * true initialize success
55 * false initialize failure
57 bool tv_init_action(unsigned char **buf, size_t *bufsize);
60 * finalize modules
62 void tv_exit(void);
65 * load the file
67 * [In] file
68 * read file name
70 * return
71 * true load success
72 * false load failure
74 bool tv_load_file(const unsigned char *file);
76 /* draw the current page */
77 void tv_draw(void);
80 * scroll up
82 * [In] mode
83 * scroll mode
85 void tv_scroll_up(unsigned mode);
88 * scroll down
90 * [In] mode
91 * scroll mode
93 void tv_scroll_down(unsigned mode);
96 * scroll left
98 * [In] mode
99 * scroll mode
101 void tv_scroll_left(unsigned mode);
104 * scroll right
106 * [In] mode
107 * scroll mode
109 void tv_scroll_right(unsigned mode);
111 /* jump to the top */
112 void tv_top(void);
114 /* jump to the bottom */
115 void tv_bottom(void);
118 * display menu
120 * return
121 * the following value returns
122 * TV_MENU_RESULT_EXIT_MENU menu exit and continue this plugin
123 * TV_MENU_RESULT_EXIT_PLUGIN request to exit this plugin
124 * TV_MENU_RESULT_ATTACHED_USB connect USB cable
126 unsigned tv_menu(void);
128 /* add or remove the bookmark to the current position */
129 void tv_add_or_remove_bookmark(void);
131 #endif