ev-document-info.h 4.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
/*
 *  Copyright (C) 2000-2003 Marco Pesenti Gritti
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  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 22 23 24
#if !defined (__EV_EVINCE_DOCUMENT_H_INSIDE__) && !defined (EVINCE_COMPILATION)
#error "Only <evince-document.h> can be included directly."
#endif

25 26 27 28 29 30 31 32 33
#ifndef EV_DOCUMENT_INFO_H
#define EV_DOCUMENT_INFO_H

#include <glib-object.h>
#include <glib.h>

G_BEGIN_DECLS

typedef struct _EvDocumentInfo    EvDocumentInfo;
34
typedef struct _EvDocumentLicense EvDocumentLicense;
35

36 37
#define EV_TYPE_DOCUMENT_INFO (ev_document_info_get_type())

38 39 40 41 42 43 44
typedef enum
{
	EV_DOCUMENT_LAYOUT_SINGLE_PAGE,
	EV_DOCUMENT_LAYOUT_ONE_COLUMN,
	EV_DOCUMENT_LAYOUT_TWO_COLUMN_LEFT,
	EV_DOCUMENT_LAYOUT_TWO_COLUMN_RIGHT,
	EV_DOCUMENT_LAYOUT_TWO_PAGE_LEFT,
45
	EV_DOCUMENT_LAYOUT_TWO_PAGE_RIGHT
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
} EvDocumentLayout;

typedef enum
{
	EV_DOCUMENT_MODE_NONE,
	EV_DOCUMENT_MODE_USE_OC,
	EV_DOCUMENT_MODE_USE_THUMBS,
	EV_DOCUMENT_MODE_FULL_SCREEN,
	EV_DOCUMENT_MODE_USE_ATTACHMENTS,
	EV_DOCUMENT_MODE_PRESENTATION = EV_DOCUMENT_MODE_FULL_SCREEN /* Will these be different? */
} EvDocumentMode;

typedef enum
{
	EV_DOCUMENT_UI_HINT_HIDE_TOOLBAR = 1 << 0,
	EV_DOCUMENT_UI_HINT_HIDE_MENUBAR = 1 << 1,
	EV_DOCUMENT_UI_HINT_HIDE_WINDOWUI = 1 << 2,
	EV_DOCUMENT_UI_HINT_FIT_WINDOW = 1 << 3,
	EV_DOCUMENT_UI_HINT_CENTER_WINDOW = 1 << 4,
	EV_DOCUMENT_UI_HINT_DISPLAY_DOC_TITLE = 1 << 5,
66
	EV_DOCUMENT_UI_HINT_DIRECTION_RTL = 1 << 6
67 68
} EvDocumentUIHints;

69
/* This define is needed because glib-mkenums chokes with multiple lines */
70 71 72 73
#define _PERMISSIONS_FULL (EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT  \
			 | EV_DOCUMENT_PERMISSIONS_OK_TO_MODIFY \
			 | EV_DOCUMENT_PERMISSIONS_OK_TO_COPY   \
			 | EV_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES)
74 75 76 77 78 79 80

typedef enum
{
	EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT = 1 << 0,
	EV_DOCUMENT_PERMISSIONS_OK_TO_MODIFY = 1 << 1,
	EV_DOCUMENT_PERMISSIONS_OK_TO_COPY = 1 << 2,
	EV_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES = 1 << 3,
81
	EV_DOCUMENT_PERMISSIONS_FULL = _PERMISSIONS_FULL
82 83
} EvDocumentPermissions;

84 85 86 87 88 89 90 91
typedef enum
{
	EV_DOCUMENT_INFO_TITLE = 1 << 0,
	EV_DOCUMENT_INFO_FORMAT = 1 << 1,
	EV_DOCUMENT_INFO_AUTHOR = 1 << 2,
	EV_DOCUMENT_INFO_SUBJECT = 1 << 3,
	EV_DOCUMENT_INFO_KEYWORDS = 1 << 4,
	EV_DOCUMENT_INFO_LAYOUT = 1 << 5,
92 93 94 95 96 97 98
	EV_DOCUMENT_INFO_CREATOR = 1 << 6,
	EV_DOCUMENT_INFO_PRODUCER = 1 << 7,
	EV_DOCUMENT_INFO_CREATION_DATE = 1 << 8,
	EV_DOCUMENT_INFO_MOD_DATE = 1 << 9,
	EV_DOCUMENT_INFO_LINEARIZED = 1 << 10,
	EV_DOCUMENT_INFO_START_MODE = 1 << 11,
	EV_DOCUMENT_INFO_UI_HINTS = 1 << 12,
99 100
	EV_DOCUMENT_INFO_PERMISSIONS = 1 << 13,
	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 106 107 108
} EvDocumentInfoFields;

struct _EvDocumentInfo
{
109 110 111 112 113
	char *title;
	char *format; /* eg, "pdf-1.5" */
	char *author;
	char *subject;
	char *keywords;
114 115 116
	char *creator;
	char *producer;
	char *linearized;
117
        char *security;
118 119
	GTime creation_date;
	GTime modified_date;
120 121 122
	EvDocumentLayout layout;
	EvDocumentMode mode;
	guint ui_hints;
123
	guint permissions;
124
	int   n_pages;
125 126
	double paper_height;
	double paper_width;
127
	EvDocumentLicense *license;
128 129 130 131 132

	/* Mask of all the valid fields */
	guint fields_mask;
};

133 134 135
GType           ev_document_info_get_type (void) G_GNUC_CONST;
EvDocumentInfo *ev_document_info_copy     (EvDocumentInfo *info);
void            ev_document_info_free     (EvDocumentInfo *info);
136

137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
/* EvDocumentLicense */
#define EV_TYPE_DOCUMENT_LICENSE (ev_document_license_get_type())
struct _EvDocumentLicense {
	gchar *text;
	gchar *uri;
	gchar *web_statement;
};
GType              ev_document_license_get_type          (void) G_GNUC_CONST;
EvDocumentLicense *ev_document_license_new               (void);
EvDocumentLicense *ev_document_license_copy              (EvDocumentLicense *license);
void               ev_document_license_free              (EvDocumentLicense *license);
const gchar       *ev_document_license_get_text          (EvDocumentLicense *license);
const gchar       *ev_document_license_get_uri           (EvDocumentLicense *license);
const gchar       *ev_document_license_get_web_statement (EvDocumentLicense *license);

152 153 154
G_END_DECLS

#endif /* EV_DOCUMENT_INFO_H */