-
Notifications
You must be signed in to change notification settings - Fork 1
/
Document.h
133 lines (120 loc) · 2.37 KB
/
Document.h
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
#pragma once
#include "Definitions.h"
#include <vector>
#include "Page.h"
#include "Res.h"
#include "Signatures.h"
struct Print
{
bool printable;
int copies = -1;
};
struct ValidPeriod
{
time_t startDate;
time_t endDate;
};
struct CT_Permission
{
bool edit = true;
bool annot = true;
bool _export = true;
bool signature = true;
bool watermark = true;
bool printScreen = true;
Print *print = nullptr;
ValidPeriod *validPeriod = nullptr;
};
struct CT_VPreferences
{
enum PAGEMODE
{
NONE, FULLSCREEN, USEOUTLINES, USETHUMBS, USECUSTOMTAGS, USELAYERS, USEATTATCHS, USEBOOKMARKS
};
enum PAGELAYOUT
{
ONEPAGE, ONECOLUMN, TWOPAGEL, TWOCOLUMNL, TWOPAGER, TWOCOLUMNR
};
enum TABDISPLAY
{
DOCTITLE, FILENAME
};
enum ZOOMMODE
{
DEFAULT, FITHEIGHT, FITWIDTH, FITRECT
};
union ZoomData
{
ZOOMMODE zoomMode;
double zoom;
};
PAGEMODE pageMode = NONE;
PAGELAYOUT pageLayout = ONECOLUMN;
TABDISPLAY tabDisplay = DOCTITLE;
bool hideToolbar = false;
bool hideMenubar = false;
bool hideWindowUI = false;
ZoomData zoomData;
};
struct CT_OutlineElem
{
std::vector<CT_Action*> actions;
std::vector<CT_OutlineElem *> outlineElems;
std::string title;
int count;
bool expanded = true;
};
struct CT_Bookmark
{
CT_Dest *dest = nullptr;
std::string name;
};
struct TemplatePage;
struct CommonData
{
ST_ID maxUnitID;
CT_PageArea *pageArea = nullptr;
std::vector<std::pair<ST_Loc*, Res *>> publicRes;
std::vector<std::pair<ST_Loc*, Res *>> documentRes;
std::vector<std::pair<TemplatePage *, Page *>> templatePages;
ST_RefID defaultCS;
};
struct TemplatePage
{
ST_ID id;
std::string name;
enum ZORDER
{
BACKGROUND, FOREGROUND
};
ZORDER zorder;
ST_Loc *baseLoc = nullptr;
};
struct Document;
struct Document_Page
{
int pageIndex = -1;
Document *fromDoc = nullptr;
ST_ID id;
ST_Loc *baseLoc = nullptr;
ST_Loc *loc = nullptr;
};
typedef std::vector<std::pair<Document_Page*, Page*>> Pages;
struct OFD;
struct Document
{
int docIndex = -1;
OFD *fromOfd = nullptr;
CommonData *commonData = nullptr;
Pages pages;
std::vector<CT_OutlineElem *> outlines;
CT_Permission *permissions = nullptr;
CT_Action *actions = nullptr;
CT_VPreferences *vPreferences = nullptr;
std::vector<CT_Bookmark *> bookmarks;
ST_Loc *annotations = nullptr;
ST_Loc *customTags = nullptr;
ST_Loc *attachments = nullptr;
ST_Loc *extensions = nullptr;
Signatures *signatures = nullptr;
};