2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
#ifndef EL__VIEWER_TEXT_VIEW_H
|
|
|
|
#define EL__VIEWER_TEXT_VIEW_H
|
|
|
|
|
|
|
|
#include "config/kbdbind.h"
|
|
|
|
#include "viewer/action.h"
|
|
|
|
|
|
|
|
struct document_view;
|
|
|
|
struct session;
|
|
|
|
struct term_event;
|
|
|
|
struct terminal;
|
|
|
|
|
2007-07-27 07:13:27 -04:00
|
|
|
/** Releases the document view's resources.
|
|
|
|
* But doesn't free() the @a doc_view. */
|
2005-09-15 09:58:31 -04:00
|
|
|
void detach_formatted(struct document_view *doc_view);
|
|
|
|
|
|
|
|
enum frame_event_status move_page_down(struct session *ses, struct document_view *doc_view);
|
|
|
|
enum frame_event_status move_page_up(struct session *ses, struct document_view *doc_view);
|
|
|
|
enum frame_event_status move_link(struct session *ses, struct document_view *doc_view,
|
|
|
|
int direction, int wraparound_bound, int wraparound_link);
|
|
|
|
|
|
|
|
#define move_link_next(ses, doc_view) move_link(ses, doc_view, 1, (doc_view)->document->nlinks - 1, 0)
|
|
|
|
#define move_link_prev(ses, doc_view) move_link(ses, doc_view, -1, 0, (doc_view)->document->nlinks - 1)
|
|
|
|
|
|
|
|
enum frame_event_status move_link_dir(struct session *ses, struct document_view *doc_view,
|
|
|
|
int dir_x, int dir_y);
|
|
|
|
|
|
|
|
#define move_link_up(ses, doc_view) move_link_dir(ses, doc_view, 0, -1)
|
|
|
|
#define move_link_down(ses, doc_view) move_link_dir(ses, doc_view, 0, 1)
|
|
|
|
#define move_link_left(ses, doc_view) move_link_dir(ses, doc_view, -1, 0)
|
|
|
|
#define move_link_right(ses, doc_view) move_link_dir(ses, doc_view, 1, 0)
|
|
|
|
|
2007-08-11 17:06:10 -04:00
|
|
|
enum frame_event_status move_link_prev_line(struct session *ses, struct document_view *doc_view);
|
|
|
|
enum frame_event_status move_link_next_line(struct session *ses, struct document_view *doc_view);
|
2007-08-19 07:58:30 -04:00
|
|
|
enum frame_event_status move_link_up_line(struct session *ses, struct document_view *doc_view);
|
|
|
|
enum frame_event_status move_link_down_line(struct session *ses, struct document_view *doc_view);
|
2007-08-11 17:06:10 -04:00
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
enum frame_event_status scroll_up(struct session *ses, struct document_view *doc_view);
|
|
|
|
enum frame_event_status scroll_down(struct session *ses, struct document_view *doc_view);
|
|
|
|
enum frame_event_status scroll_left(struct session *ses, struct document_view *doc_view);
|
|
|
|
enum frame_event_status scroll_right(struct session *ses, struct document_view *doc_view);
|
|
|
|
|
|
|
|
enum frame_event_status move_document_start(struct session *ses, struct document_view *doc_view);
|
|
|
|
enum frame_event_status move_document_end(struct session *ses, struct document_view *doc_view);
|
|
|
|
|
|
|
|
enum frame_event_status set_frame(struct session *ses, struct document_view *doc_view, int xxxx);
|
|
|
|
struct document_view *current_frame(struct session *);
|
|
|
|
|
2007-07-27 07:13:27 -04:00
|
|
|
/** Used for changing between formatted and source (plain) view. */
|
2005-09-15 09:58:31 -04:00
|
|
|
void toggle_plain_html(struct session *ses, struct document_view *doc_view, int xxxx);
|
|
|
|
|
|
|
|
enum frame_event_status move_cursor_left(struct session *ses,
|
|
|
|
struct document_view *view);
|
|
|
|
enum frame_event_status move_cursor_right(struct session *ses,
|
|
|
|
struct document_view *view);
|
|
|
|
enum frame_event_status move_cursor_up(struct session *ses,
|
|
|
|
struct document_view *view);
|
|
|
|
enum frame_event_status move_cursor_down(struct session *ses,
|
|
|
|
struct document_view *view);
|
|
|
|
|
|
|
|
enum frame_event_status move_cursor(struct session *ses,
|
|
|
|
struct document_view *doc_view,
|
|
|
|
int x, int y);
|
|
|
|
|
2007-07-27 07:13:27 -04:00
|
|
|
/** Used for changing wrapping of text */
|
2005-09-15 09:58:31 -04:00
|
|
|
void toggle_wrap_text(struct session *ses, struct document_view *doc_view, int xxxx);
|
|
|
|
|
|
|
|
enum frame_event_status copy_current_link_to_clipboard(struct session *ses,
|
|
|
|
struct document_view *doc_view,
|
|
|
|
int xxx);
|
|
|
|
|
2007-07-27 07:13:27 -04:00
|
|
|
/** If the user has provided a numeric prefix, jump to the link
|
2005-09-15 09:58:31 -04:00
|
|
|
* with that number as its index. */
|
|
|
|
int try_jump_to_link_number(struct session *ses,
|
|
|
|
struct document_view *doc_view);
|
|
|
|
|
2007-07-27 07:13:27 -04:00
|
|
|
/** @name File menu handlers.
|
|
|
|
* @{ */
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
enum frame_event_status save_as(struct session *ses, struct document_view *doc_view, int magic);
|
|
|
|
|
2007-07-27 07:13:27 -04:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @name Various event emitters and link menu handlers.
|
|
|
|
* @{ */
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
void send_event(struct session *, struct term_event *);
|
|
|
|
|
|
|
|
enum frame_event_status save_formatted_dlg(struct session *ses, struct document_view *doc_view, int xxxx);
|
|
|
|
enum frame_event_status view_image(struct session *ses, struct document_view *doc_view, int xxxx);
|
|
|
|
enum frame_event_status download_link(struct session *ses, struct document_view *doc_view, action_id_T action_id);
|
|
|
|
|
2007-07-27 07:13:27 -04:00
|
|
|
/** @} */
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
#endif
|