File: pps-view.h

package info (click to toggle)
papers 49.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 21,044 kB
  • sloc: ansic: 37,728; sh: 197; xml: 127; makefile: 113
file content (142 lines) | stat: -rw-r--r-- 4,190 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// SPDX-License-Identifier: GPL-2.0-or-later
/* this file is part of papers, a gnome document viewer
 *
 *  Copyright (C) 2004 Red Hat, Inc
 */

#pragma once

#if !defined(__PPS_PAPERS_VIEW_H_INSIDE__) && !defined(PAPERS_COMPILATION)
#error "Only <papers-view.h> can be included directly."
#endif

#include <gtk/gtk.h>

#include <papers-document.h>

#include "context/pps-annotations-context.h"
#include "context/pps-document-model.h"
#include "context/pps-search-context.h"
#include "pps-jobs.h"

G_BEGIN_DECLS

#define PPS_TYPE_VIEW (pps_view_get_type ())
PPS_PUBLIC
G_DECLARE_DERIVABLE_TYPE (PpsView, pps_view, PPS, VIEW, GtkWidget)

PPS_PUBLIC
PpsView *pps_view_new (void);
PPS_PUBLIC
void pps_view_set_model (PpsView *view,
                         PpsDocumentModel *model);
PPS_PUBLIC
void pps_view_reload (PpsView *view);
PPS_PUBLIC
void pps_view_set_page_cache_size (PpsView *view,
                                   gsize cache_size);

PPS_PUBLIC
void pps_view_set_allow_links_change_zoom (PpsView *view,
                                           gboolean allowed);
PPS_PUBLIC
gboolean pps_view_get_allow_links_change_zoom (PpsView *view);

/* Selections */
#define PPS_TYPE_VIEW_SELECTION (pps_view_selection_get_type ())
typedef struct {
	int page;
	/* The coordinates here are at scale == 1.0, so that we can ignore
	 * resizings.  There is one per page, maximum.
	 */
	PpsRectangle rect;
	cairo_region_t *covered_region;
	PpsSelectionStyle style;
} PpsViewSelection;

PPS_PUBLIC
GType pps_view_selection_get_type (void) G_GNUC_CONST;
PPS_PUBLIC
PpsViewSelection *pps_view_selection_copy (PpsViewSelection *selection);
PPS_PUBLIC
void pps_view_selection_free (PpsViewSelection *selection);

PPS_PUBLIC
void pps_view_copy (PpsView *view);
PPS_PUBLIC
void pps_view_copy_link_address (PpsView *view,
                                 PpsLinkAction *action);
PPS_PUBLIC
void pps_view_select_all (PpsView *view);
PPS_PUBLIC
gboolean pps_view_has_selection (PpsView *view);
PPS_PUBLIC
char *pps_view_get_selected_text (PpsView *view);
PPS_PUBLIC
GList *pps_view_get_selections (PpsView *view);

/* Page size */
PPS_PUBLIC
gboolean pps_view_can_zoom_in (PpsView *view);
PPS_PUBLIC
void pps_view_zoom_in (PpsView *view);
PPS_PUBLIC
gboolean pps_view_can_zoom_out (PpsView *view);
PPS_PUBLIC
void pps_view_zoom_out (PpsView *view);

/* Find */
PPS_PUBLIC
void pps_view_set_search_context (PpsView *view,
                                  PpsSearchContext *context);

/* Navigation */
PPS_PUBLIC
void pps_view_handle_link (PpsView *view,
                           PpsLink *link);
PPS_PUBLIC
gboolean pps_view_next_page (PpsView *view);
PPS_PUBLIC
gboolean pps_view_previous_page (PpsView *view);

PPS_PUBLIC
PpsDocumentPoint *pps_view_get_document_point_for_view_point (PpsView *view,
                                                              gdouble view_point_x,
                                                              gdouble view_point_y);

/* Annotations */
PPS_PUBLIC
void pps_view_set_annotations_context (PpsView *view,
                                       PpsAnnotationsContext *context);
PPS_PUBLIC
void pps_view_focus_annotation (PpsView *view,
                                PpsAnnotation *annot);
PPS_PUBLIC
void pps_view_set_enable_spellchecking (PpsView *view,
                                        gboolean spellcheck);
PPS_PUBLIC
gboolean pps_view_get_enable_spellchecking (PpsView *view);

/* Caret navigation */
PPS_PUBLIC
gboolean pps_view_supports_caret_navigation (PpsView *view);
PPS_PUBLIC
gboolean pps_view_is_caret_navigation_enabled (PpsView *view);
PPS_PUBLIC
void pps_view_set_caret_navigation_enabled (PpsView *view,
                                            gboolean enabled);
PPS_PUBLIC
void pps_view_set_caret_cursor_position (PpsView *view,
                                         guint page,
                                         guint offset);
PPS_PUBLIC
gboolean pps_view_current_event_is_type (PpsView *view,
                                         GdkEventType type);

/* Signatures */
PPS_PUBLIC
void pps_view_start_signature_rect (PpsView *view);
PPS_PUBLIC
void pps_view_cancel_signature_rect (PpsView *view);

G_END_DECLS