source: trunk/Lucide/plugins/ludoc/lutypes.h

Last change on this file was 522, checked in by Gregg Young, 5 years ago

Add substitute font name to Font dialog Ticket [280]

File size: 6.5 KB
Line 
1/* ***** BEGIN LICENSE BLOCK *****
2 * Version: CDDL 1.0/LGPL 2.1
3 *
4 * The contents of this file are subject to the COMMON DEVELOPMENT AND
5 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
6 * this file except in compliance with the License. You may obtain a copy of
7 * the License at http://www.sun.com/cddl/
8 *
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
13 *
14 * The Initial Developer of the Original Code is
15 * Eugene Romanenko, netlabs.org.
16 * Portions created by the Initial Developer are Copyright (C) 2006
17 * the Initial Developer. All Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 * Alternatively, the contents of this file may be used under the terms of
22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
23 * in which case the provisions of the LGPL are applicable instead of those
24 * above. If you wish to allow use of your version of this file only under the
25 * terms of the LGPL, and not to allow others to use your version of this file
26 * under the terms of the CDDL, indicate your decision by deleting the
27 * provisions above and replace them with the notice and other provisions
28 * required by the LGPL. If you do not delete the provisions above, a recipient
29 * may use your version of this file under the terms of any one of the CDDL
30 * or the LGPL.
31 *
32 * ***** END LICENSE BLOCK ***** */
33
34
35#ifndef lutypes_h
36#define lutypes_h
37
38#ifndef __SOMIDL__
39#include <os2.h>
40#endif
41
42
43struct LuRectangle
44{
45    double x1;
46    double y1;
47    double x2;
48    double y2;
49};
50
51
52#define LU_LINK_TYPE_TITLE         0
53#define LU_LINK_TYPE_PAGE          1
54#define LU_LINK_TYPE_EXTERNAL_URI  2
55#define LU_LINK_TYPE_EXTERNAL_FILE 3
56#define LU_LINK_TYPE_LAUNCH        4
57
58
59struct LuLink
60{
61    char *title;
62    char *uri;
63    long type;
64    long page;
65};
66
67
68struct LuLinkMapping
69{
70    LuLink link;
71    LuRectangle area;
72};
73
74
75#define LU_FONTEMBED_NOT_EMBEDDED       0
76#define LU_FONTEMBED_EMBEDDED           1
77#define LU_FONTEMBED_EMBEDDED_SUBSET    2
78
79struct LuFontInfo
80{
81    char  *name;
82    char  *type;
83    short embedded;
84    char  *subname;
85};
86
87   
88#define LU_DOCUMENT_LAYOUT_SINGLE_PAGE       0
89#define LU_DOCUMENT_LAYOUT_ONE_COLUMN        1
90#define LU_DOCUMENT_LAYOUT_TWO_COLUMN_LEFT   2
91#define LU_DOCUMENT_LAYOUT_TWO_COLUMN_RIGHT  3
92#define LU_DOCUMENT_LAYOUT_TWO_PAGE_LEFT     4
93#define LU_DOCUMENT_LAYOUT_TWO_PAGE_RIGHT    5
94
95   
96#define LU_DOCUMENT_MODE_NONE             0
97#define LU_DOCUMENT_MODE_USE_OC           1
98#define LU_DOCUMENT_MODE_USE_THUMBS       2
99#define LU_DOCUMENT_MODE_FULL_SCREEN      3
100#define LU_DOCUMENT_MODE_USE_ATTACHMENTS  4
101#define LU_DOCUMENT_MODE_PRESENTATION     LU_DOCUMENT_MODE_FULL_SCREEN
102
103
104#define LU_DOCUMENT_UI_HINT_HIDE_TOOLBAR       0x0001
105#define LU_DOCUMENT_UI_HINT_HIDE_MENUBAR       0x0002
106#define LU_DOCUMENT_UI_HINT_HIDE_WINDOWUI      0x0004
107#define LU_DOCUMENT_UI_HINT_FIT_WINDOW         0x0008
108#define LU_DOCUMENT_UI_HINT_CENTER_WINDOW      0x0010
109#define LU_DOCUMENT_UI_HINT_DISPLAY_DOC_TITLE  0x0020
110#define LU_DOCUMENT_UI_HINT_DIRECTION_RTL      0x0040
111
112
113
114#define LU_DOCUMENT_PERMISSIONS_OK_TO_PRINT      0x0001
115#define LU_DOCUMENT_PERMISSIONS_OK_TO_MODIFY     0x0002
116#define LU_DOCUMENT_PERMISSIONS_OK_TO_COPY       0x0004
117#define LU_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES  0x0008
118#define LU_DOCUMENT_PERMISSIONS_FULL  (LU_DOCUMENT_PERMISSIONS_OK_TO_PRINT|LU_DOCUMENT_PERMISSIONS_OK_TO_MODIFY|LU_DOCUMENT_PERMISSIONS_OK_TO_COPY|LU_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES)
119
120
121#define LU_DOCUMENT_INFO_TITLE          0x0001
122#define LU_DOCUMENT_INFO_FORMAT         0x0002
123#define LU_DOCUMENT_INFO_AUTHOR         0x0004
124#define LU_DOCUMENT_INFO_SUBJECT        0x0008
125#define LU_DOCUMENT_INFO_KEYWORDS       0x0010
126#define LU_DOCUMENT_INFO_LAYOUT         0x0020
127#define LU_DOCUMENT_INFO_CREATOR        0x0040
128#define LU_DOCUMENT_INFO_PRODUCER       0x0080
129#define LU_DOCUMENT_INFO_CREATION_DATE  0x0100
130#define LU_DOCUMENT_INFO_MOD_DATE       0x0200
131#define LU_DOCUMENT_INFO_LINEARIZED     0x0400
132#define LU_DOCUMENT_INFO_START_MODE     0x0800
133#define LU_DOCUMENT_INFO_UI_HINTS       0x1000
134#define LU_DOCUMENT_INFO_PERMISSIONS    0x2000
135#define LU_DOCUMENT_INFO_N_PAGES        0x4000
136#define LU_DOCUMENT_INFO_SECURITY       0x8000
137
138
139struct LuDocumentInfo
140{
141    char *title;
142    char *format;
143    char *author;
144    char *subject;
145    char *keywords;
146    char *creator;
147    char *producer;
148    long security;
149    long linearized;
150    unsigned long creation_date;
151    unsigned long modified_date;
152    unsigned long layout;
153    unsigned long mode;
154    unsigned long ui_hints;
155    unsigned long permissions;
156    long n_pages;
157
158    // Mask of all valid fields
159    unsigned long fields_mask;
160};
161
162#ifndef __SOMIDL__
163typedef long (EXPENTRY *_asynchCallbackFn)( void *data );
164//typedef _asynchCallbackFn *asynchCallbackFn;
165#endif
166
167// Load errors
168#define LU_LDERR_NO_ERROR       0
169#define LU_LDERR_CUSTOM         1
170#define LU_LDERR_OUT_OF_MEMORY  2
171#define LU_LDERR_OPEN_ERROR     3
172#define LU_LDERR_READ_ERROR     4
173#define LU_LDERR_DAMAGED        5
174#define LU_LDERR_WRONG_FORMAT   6
175#define LU_LDERR_ENCRYPTED      7
176
177// Render errors/warnings
178#define LU_RERR_NO_ERROR              0
179#define LU_RERR_CUSTOM                1
180#define LU_RERR_OUT_OF_MEMORY         2
181#define LU_RERR_CORRUPTED_PAGE_DATA   3
182#define LU_RERR_FONT_NOT_FOUND        4
183
184//
185// ***  Structs to detect type of file by it's content ***
186//
187
188// one signature to check
189struct LuSignature
190{
191    unsigned long  offset; // offset to read data
192    unsigned long  origin; // offset: 0 - from beginning of file, 1 - from end
193    unsigned long  length; // length of data bytes to check
194    void          *data;   // pointer to data bytes
195};
196
197// list of signatures to check
198// all signatures must be checked for positive result
199struct LuSignatureList
200{
201    unsigned long  count;       // number of LuSignature structures
202    LuSignature   *signatures;  // array of LuSignature structures
203};
204
205// list of checklists
206// at least one checklist must be checked for positive result
207struct LuSignatureCheck
208{
209    unsigned long    count;   // number of LuSignatureList structures
210    LuSignatureList *slists;  // array of LuSignatureList structures
211};
212
213#endif // lutypes_h
Note: See TracBrowser for help on using the repository browser.