source: branches/kmk/Lucide/plugins/ludoc/lutypes.h @ 339

Last change on this file since 339 was 306, checked in by dmik, 12 years ago

branches/kmk: Made all Lucide SOM plugins build with kmk/gcc.

File size: 6.4 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};
85
86   
87#define LU_DOCUMENT_LAYOUT_SINGLE_PAGE       0
88#define LU_DOCUMENT_LAYOUT_ONE_COLUMN        1
89#define LU_DOCUMENT_LAYOUT_TWO_COLUMN_LEFT   2
90#define LU_DOCUMENT_LAYOUT_TWO_COLUMN_RIGHT  3
91#define LU_DOCUMENT_LAYOUT_TWO_PAGE_LEFT     4
92#define LU_DOCUMENT_LAYOUT_TWO_PAGE_RIGHT    5
93
94   
95#define LU_DOCUMENT_MODE_NONE             0
96#define LU_DOCUMENT_MODE_USE_OC           1
97#define LU_DOCUMENT_MODE_USE_THUMBS       2
98#define LU_DOCUMENT_MODE_FULL_SCREEN      3
99#define LU_DOCUMENT_MODE_USE_ATTACHMENTS  4
100#define LU_DOCUMENT_MODE_PRESENTATION     LU_DOCUMENT_MODE_FULL_SCREEN
101
102
103#define LU_DOCUMENT_UI_HINT_HIDE_TOOLBAR       0x0001
104#define LU_DOCUMENT_UI_HINT_HIDE_MENUBAR       0x0002
105#define LU_DOCUMENT_UI_HINT_HIDE_WINDOWUI      0x0004
106#define LU_DOCUMENT_UI_HINT_FIT_WINDOW         0x0008
107#define LU_DOCUMENT_UI_HINT_CENTER_WINDOW      0x0010
108#define LU_DOCUMENT_UI_HINT_DISPLAY_DOC_TITLE  0x0020
109#define LU_DOCUMENT_UI_HINT_DIRECTION_RTL      0x0040
110
111
112
113#define LU_DOCUMENT_PERMISSIONS_OK_TO_PRINT      0x0001
114#define LU_DOCUMENT_PERMISSIONS_OK_TO_MODIFY     0x0002
115#define LU_DOCUMENT_PERMISSIONS_OK_TO_COPY       0x0004
116#define LU_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES  0x0008
117#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)
118
119
120#define LU_DOCUMENT_INFO_TITLE          0x0001
121#define LU_DOCUMENT_INFO_FORMAT         0x0002
122#define LU_DOCUMENT_INFO_AUTHOR         0x0004
123#define LU_DOCUMENT_INFO_SUBJECT        0x0008
124#define LU_DOCUMENT_INFO_KEYWORDS       0x0010
125#define LU_DOCUMENT_INFO_LAYOUT         0x0020
126#define LU_DOCUMENT_INFO_CREATOR        0x0040
127#define LU_DOCUMENT_INFO_PRODUCER       0x0080
128#define LU_DOCUMENT_INFO_CREATION_DATE  0x0100
129#define LU_DOCUMENT_INFO_MOD_DATE       0x0200
130#define LU_DOCUMENT_INFO_LINEARIZED     0x0400
131#define LU_DOCUMENT_INFO_START_MODE     0x0800
132#define LU_DOCUMENT_INFO_UI_HINTS       0x1000
133#define LU_DOCUMENT_INFO_PERMISSIONS    0x2000
134#define LU_DOCUMENT_INFO_N_PAGES        0x4000
135#define LU_DOCUMENT_INFO_SECURITY       0x8000
136
137
138struct LuDocumentInfo
139{
140    char *title;
141    char *format;
142    char *author;
143    char *subject;
144    char *keywords;
145    char *creator;
146    char *producer;
147    long security;
148    long linearized;
149    unsigned long creation_date;
150    unsigned long modified_date;
151    unsigned long layout;
152    unsigned long mode;
153    unsigned long ui_hints;
154    unsigned long permissions;
155    long n_pages;
156
157    // Mask of all valid fields
158    unsigned long fields_mask;
159};
160
161#ifndef __SOMIDL__
162typedef long (EXPENTRY *_asynchCallbackFn)( void *data );
163//typedef _asynchCallbackFn *asynchCallbackFn;
164#endif
165
166// Load errors
167#define LU_LDERR_NO_ERROR       0
168#define LU_LDERR_CUSTOM         1
169#define LU_LDERR_OUT_OF_MEMORY  2
170#define LU_LDERR_OPEN_ERROR     3
171#define LU_LDERR_READ_ERROR     4
172#define LU_LDERR_DAMAGED        5
173#define LU_LDERR_WRONG_FORMAT   6
174#define LU_LDERR_ENCRYPTED      7
175
176// Render errors/warnings
177#define LU_RERR_NO_ERROR              0
178#define LU_RERR_CUSTOM                1
179#define LU_RERR_OUT_OF_MEMORY         2
180#define LU_RERR_CORRUPTED_PAGE_DATA   3
181#define LU_RERR_FONT_NOT_FOUND        4
182
183//
184// ***  Structs to detect type of file by it's content ***
185//
186
187// one signature to check
188struct LuSignature
189{
190    unsigned long  offset; // offset to read data
191    unsigned long  origin; // offset: 0 - from beginning of file, 1 - from end
192    unsigned long  length; // length of data bytes to check
193    void          *data;   // pointer to data bytes
194};
195
196// list of signatures to check
197// all signatures must be checked for positive result
198struct LuSignatureList
199{
200    unsigned long  count;       // number of LuSignature structures
201    LuSignature   *signatures;  // array of LuSignature structures
202};
203
204// list of checklists
205// at least one checklist must be checked for positive result
206struct LuSignatureCheck
207{
208    unsigned long    count;   // number of LuSignatureList structures
209    LuSignatureList *slists;  // array of LuSignatureList structures
210};
211
212#endif // lutypes_h
Note: See TracBrowser for help on using the repository browser.