]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-document-info.h
[dualscreen] fix crash on ctrl+w and fix control window closing
[evince.git] / libdocument / ev-document-info.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2 /*
3  *  Copyright (C) 2000-2003 Marco Pesenti Gritti
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  */
20
21 #if !defined (__EV_EVINCE_DOCUMENT_H_INSIDE__) && !defined (EVINCE_COMPILATION)
22 #error "Only <evince-document.h> can be included directly."
23 #endif
24
25 #ifndef EV_DOCUMENT_INFO_H
26 #define EV_DOCUMENT_INFO_H
27
28 #include <glib-object.h>
29 #include <glib.h>
30
31 G_BEGIN_DECLS
32
33 typedef struct _EvDocumentInfo    EvDocumentInfo;
34 typedef struct _EvDocumentLicense EvDocumentLicense;
35
36 #define EV_TYPE_DOCUMENT_INFO (ev_document_info_get_type())
37
38 typedef enum
39 {
40         EV_DOCUMENT_LAYOUT_SINGLE_PAGE,
41         EV_DOCUMENT_LAYOUT_ONE_COLUMN,
42         EV_DOCUMENT_LAYOUT_TWO_COLUMN_LEFT,
43         EV_DOCUMENT_LAYOUT_TWO_COLUMN_RIGHT,
44         EV_DOCUMENT_LAYOUT_TWO_PAGE_LEFT,
45         EV_DOCUMENT_LAYOUT_TWO_PAGE_RIGHT
46 } EvDocumentLayout;
47
48 typedef enum
49 {
50         EV_DOCUMENT_MODE_NONE,
51         EV_DOCUMENT_MODE_USE_OC,
52         EV_DOCUMENT_MODE_USE_THUMBS,
53         EV_DOCUMENT_MODE_FULL_SCREEN,
54         EV_DOCUMENT_MODE_USE_ATTACHMENTS,
55         EV_DOCUMENT_MODE_PRESENTATION = EV_DOCUMENT_MODE_FULL_SCREEN /* Will these be different? */
56 } EvDocumentMode;
57
58 typedef enum
59 {
60         EV_DOCUMENT_UI_HINT_HIDE_TOOLBAR = 1 << 0,
61         EV_DOCUMENT_UI_HINT_HIDE_MENUBAR = 1 << 1,
62         EV_DOCUMENT_UI_HINT_HIDE_WINDOWUI = 1 << 2,
63         EV_DOCUMENT_UI_HINT_FIT_WINDOW = 1 << 3,
64         EV_DOCUMENT_UI_HINT_CENTER_WINDOW = 1 << 4,
65         EV_DOCUMENT_UI_HINT_DISPLAY_DOC_TITLE = 1 << 5,
66         EV_DOCUMENT_UI_HINT_DIRECTION_RTL = 1 << 6
67 } EvDocumentUIHints;
68
69 /* This define is needed because glib-mkenums chokes with multiple lines */
70 #define PERMISSIONS_FULL (EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT  \
71                         | EV_DOCUMENT_PERMISSIONS_OK_TO_MODIFY \
72                         | EV_DOCUMENT_PERMISSIONS_OK_TO_COPY   \
73                         | EV_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES)
74
75 typedef enum
76 {
77         EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT = 1 << 0,
78         EV_DOCUMENT_PERMISSIONS_OK_TO_MODIFY = 1 << 1,
79         EV_DOCUMENT_PERMISSIONS_OK_TO_COPY = 1 << 2,
80         EV_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES = 1 << 3,
81         EV_DOCUMENT_PERMISSIONS_FULL = PERMISSIONS_FULL
82 } EvDocumentPermissions;
83
84 typedef enum
85 {
86         EV_DOCUMENT_INFO_TITLE = 1 << 0,
87         EV_DOCUMENT_INFO_FORMAT = 1 << 1,
88         EV_DOCUMENT_INFO_AUTHOR = 1 << 2,
89         EV_DOCUMENT_INFO_SUBJECT = 1 << 3,
90         EV_DOCUMENT_INFO_KEYWORDS = 1 << 4,
91         EV_DOCUMENT_INFO_LAYOUT = 1 << 5,
92         EV_DOCUMENT_INFO_CREATOR = 1 << 6,
93         EV_DOCUMENT_INFO_PRODUCER = 1 << 7,
94         EV_DOCUMENT_INFO_CREATION_DATE = 1 << 8,
95         EV_DOCUMENT_INFO_MOD_DATE = 1 << 9,
96         EV_DOCUMENT_INFO_LINEARIZED = 1 << 10,
97         EV_DOCUMENT_INFO_START_MODE = 1 << 11,
98         EV_DOCUMENT_INFO_UI_HINTS = 1 << 12,
99         EV_DOCUMENT_INFO_PERMISSIONS = 1 << 13,
100         EV_DOCUMENT_INFO_N_PAGES = 1 << 14,
101         EV_DOCUMENT_INFO_SECURITY = 1 << 15,
102         EV_DOCUMENT_INFO_PAPER_SIZE = 1 << 16,
103         EV_DOCUMENT_INFO_LICENSE = 1 << 17,
104
105 } EvDocumentInfoFields;
106
107 struct _EvDocumentInfo
108 {
109         char *title;
110         char *format; /* eg, "pdf-1.5" */
111         char *author;
112         char *subject;
113         char *keywords;
114         char *creator;
115         char *producer;
116         char *linearized;
117         char *security;
118         GTime creation_date;
119         GTime modified_date;
120         EvDocumentLayout layout;
121         EvDocumentMode mode;
122         guint ui_hints;
123         guint permissions;
124         int   n_pages;
125         double paper_height;
126         double paper_width;
127         EvDocumentLicense *license;
128
129         /* Mask of all the valid fields */
130         guint fields_mask;
131 };
132
133 GType           ev_document_info_get_type (void) G_GNUC_CONST;
134 EvDocumentInfo *ev_document_info_copy     (EvDocumentInfo *info);
135 void            ev_document_info_free     (EvDocumentInfo *info);
136
137 /* EvDocumentLicense */
138 #define EV_TYPE_DOCUMENT_LICENSE (ev_document_license_get_type())
139 struct _EvDocumentLicense {
140         gchar *text;
141         gchar *uri;
142         gchar *web_statement;
143 };
144 GType              ev_document_license_get_type          (void) G_GNUC_CONST;
145 EvDocumentLicense *ev_document_license_new               (void);
146 EvDocumentLicense *ev_document_license_copy              (EvDocumentLicense *license);
147 void               ev_document_license_free              (EvDocumentLicense *license);
148 const gchar       *ev_document_license_get_text          (EvDocumentLicense *license);
149 const gchar       *ev_document_license_get_uri           (EvDocumentLicense *license);
150 const gchar       *ev_document_license_get_web_statement (EvDocumentLicense *license);
151
152 G_END_DECLS
153
154 #endif /* EV_DOCUMENT_INFO_H */