PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/framework/vendor/zend/Zend/Pdf/Exception.php

http://zoop.googlecode.com/
PHP | 343 lines | 56 code | 78 blank | 209 comment | 0 complexity | 203fe5e83eca761a8f5f2dd2e2f8a37f MD5 | raw file
  1<?php
  2/**
  3 * Zend Framework
  4 *
  5 * LICENSE
  6 *
  7 * This source file is subject to the new BSD license that is bundled
  8 * with this package in the file LICENSE.txt.
  9 * It is also available through the world-wide-web at this URL:
 10 * http://framework.zend.com/license/new-bsd
 11 * If you did not receive a copy of the license and are unable to
 12 * obtain it through the world-wide-web, please send an email
 13 * to license@zend.com so we can send you a copy immediately.
 14 *
 15 * @category   Zend
 16 * @package    Zend_Pdf
 17 * @subpackage Core
 18 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
 19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 20 * @version    $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $
 21 */
 22
 23/** Zend_Exception */
 24require_once 'Zend/Exception.php';
 25
 26
 27/**
 28 * Exception class for Zend_Pdf.
 29 *
 30 * If you expect a certain type of exception to be caught and handled by the
 31 * caller, create a constant for it here and include it in the object being
 32 * thrown. Example:
 33 *
 34 *   throw new Zend_Pdf_Exception('foo() is not yet implemented',
 35 *                                Zend_Pdf_Exception::NOT_IMPLEMENTED);
 36 *
 37 * This allows the caller to determine the specific type of exception that was
 38 * thrown without resorting to parsing the descriptive text.
 39 *
 40 * IMPORTANT: Do not rely on numeric values of the constants! They are grouped
 41 * sequentially below for organizational purposes only. The numbers may come to
 42 * mean something in the future, but they are subject to renumbering at any
 43 * time. ALWAYS use the symbolic constant names, which are guaranteed never to
 44 * change, in logical checks! You have been warned.
 45 *
 46 * @package    Zend_Pdf
 47 * @subpackage Core
 48 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
 49 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 50 */
 51class Zend_Pdf_Exception extends Zend_Exception
 52{
 53  /**** Class Constants ****/
 54
 55
 56  /* Generic Exceptions */
 57
 58    /**
 59     * The feature or option is planned but has not yet been implemented. It
 60     * should be available in a future revision of the framework.
 61     */
 62    const NOT_IMPLEMENTED = 0x0001;
 63
 64    /**
 65     * The feature or option has been deprecated and will be removed in a future
 66     * revision of the framework. The descriptive text accompanying this
 67     * exception should explain how to use the replacement features or options.
 68     */
 69    const DEPRECATED = 0x0002;
 70
 71    /**
 72     * Not enough paramaters were supplied to the method.
 73     */
 74    const TOO_FEW_PARAMETERS = 0x0003;
 75
 76    /**
 77     * A parameter was of the wrong data type.
 78     */
 79    const BAD_PARAMETER_TYPE = 0x0004;
 80
 81    /**
 82     * A parameter contained an unusable value.
 83     */
 84    const BAD_PARAMETER_VALUE = 0x0005;
 85
 86    /**
 87     * A parameter value was not within the expected range.
 88     */
 89    const PARAMETER_VALUE_OUT_OF_RANGE = 0x0006;
 90
 91    /**
 92     * The method that has multiple signatures could not understand the
 93     * number and/or types of parameters.
 94     */
 95    const BAD_METHOD_SIGNATURE = 0x0007;
 96
 97    /**
 98     * An array or string index was out of range.
 99     */
100    const INDEX_OUT_OF_RANGE = 0x0008;
101
102
103
104  /* Filesystem I/O */
105
106    /**
107     * The file path was unusable or invalid.
108     */
109    const BAD_FILE_PATH = 0x0101;
110
111    /**
112     * The file is not readable by the current user.
113     */
114    const NOT_READABLE = 0x0102;
115
116    /**
117     * The file is not writeable by the current user.
118     */
119    const NOT_WRITEABLE = 0x0103;
120
121    /**
122     * The file resource has been closed unexpectedly.
123     */
124    const FILE_NOT_OPEN = 0x0104;
125
126    /**
127     * An error was encountered while attempting to open the file.
128     */
129    const CANT_OPEN_FILE = 0x0105;
130
131    /**
132     * An error was encountered while attempting to obtain the current file
133     * position.
134     */
135    const CANT_GET_FILE_POSITION = 0x0106;
136
137    /**
138     * An error was encountered while attempting to set a new file position.
139     */
140    const CANT_SET_FILE_POSITION = 0x0107;
141
142    /**
143     * An attempt was made to move the current file position before the start
144     * of the file.
145     */
146    const MOVE_BEFORE_START_OF_FILE = 0x0108;
147
148    /**
149     * An attempt was made to move the current file position beyond the end of
150     * the file.
151     */
152    const MOVE_BEYOND_END_OF_FILE = 0x0109;
153
154    /**
155     * An error was encountered while attempting to obtain the file size.
156     */
157    const CANT_GET_FILE_SIZE = 0x010a;
158
159    /**
160     * An error was encountered while attempting to read data from the file.
161     */
162    const ERROR_DURING_READ = 0x010b;
163
164    /**
165     * An error was encountered while attempting to write data to the file.
166     */
167    const ERROR_DURING_WRITE = 0x010c;
168
169    /**
170     * An incompatible page size was specified for a buffered read operation.
171     */
172    const INVALID_PAGE_SIZE = 0x010d;
173
174    /**
175     * There is insufficient data to fulfill the read request.
176     */
177    const INSUFFICIENT_DATA = 0x010e;
178
179
180
181  /* Zend_Pdf_FileParser */
182
183    /**
184     * The file parser data source object was invalid or improperly initialized.
185     */
186    const BAD_DATA_SOURCE = 0x0201;
187
188    /**
189     * An unknown byte order was specified.
190     */
191    const INVALID_BYTE_ORDER = 0x0202;
192
193    /**
194     * An invalid integer size was specified.
195     */
196    const INVALID_INTEGER_SIZE = 0x0203;
197
198    /**
199     * An invalid fixed-point number size was specified.
200     */
201    const BAD_FIXED_POINT_SIZE = 0x0204;
202
203    /**
204     * The string cannot be read.
205     */
206    const CANT_READ_STRING = 0x0205;
207
208    /**
209     * This file type must be parsed in a specific order and a parsing method
210     * was called out-of-turn.
211     */
212    const PARSED_OUT_OF_ORDER = 0x0206;
213
214
215
216  /* Zend_Pdf_FileParser_Font and Subclasses */
217
218    /**
219     * The font file type is incorrect.
220     */
221    const WRONG_FONT_TYPE = 0x0301;
222
223    /**
224     * The number of tables contained in the font is outside the expected range.
225     */
226    const BAD_TABLE_COUNT = 0x0302;
227
228    /**
229     * A required table was not present in the font.
230     */
231    const REQUIRED_TABLE_NOT_FOUND = 0x0303;
232
233    /**
234     * The parser does not understand this version of this table in the font.
235     */
236    const DONT_UNDERSTAND_TABLE_VERSION = 0x0303;
237
238    /**
239     * The magic number in the font file is incorrect.
240     */
241    const BAD_MAGIC_NUMBER = 0x0304;
242
243    /**
244     * Could not locate a usable character map for this font.
245     */
246    const CANT_FIND_GOOD_CMAP = 0x0305;
247
248
249
250  /* Zend_Pdf_Cmap and Subclasses */
251
252    /**
253     * The character map type is currently unsupported.
254     */
255    const CMAP_TYPE_UNSUPPORTED = 0x0401;
256
257    /**
258     * The type of the character map is not understood.
259     */
260    const CMAP_UNKNOWN_TYPE = 0x0402;
261
262    /**
263     * The character map table data is too small.
264     */
265    const CMAP_TABLE_DATA_TOO_SMALL = 0x0403;
266
267    /**
268     * The character map table data is for a different type of table.
269     */
270    const CMAP_WRONG_TABLE_TYPE = 0x0404;
271
272    /**
273     * The character map table data contains in incorrect length.
274     */
275    const CMAP_WRONG_TABLE_LENGTH = 0x0405;
276
277    /**
278     * This character map table is language-dependent. Character maps must be
279     * language-independent.
280     */
281    const CMAP_NOT_LANGUAGE_INDEPENDENT = 0x0406;
282
283    /**
284     * The final byte offset when reading the character map table data does not
285     * match the reported length of the table.
286     */
287    const CMAP_FINAL_OFFSET_NOT_LENGTH = 0x0407;
288
289    /**
290     * The character map subtable entry count does not match the expected value.
291     */
292    const CMAP_WRONG_ENTRY_COUNT = 0x0408;
293
294
295
296  /* Zend_Pdf_Resource_Font and Subclasses */
297
298    /**
299     * The specified glyph number is out of range for this font.
300     */
301    const GLYPH_OUT_OF_RANGE = 0x0501;
302
303    /**
304     * This font program has copyright bits set which prevent it from being
305     * embedded in the PDF file. You must specify the no-embed option to use
306     * this font.
307     */
308    const FONT_CANT_BE_EMBEDDED = 0x0502;
309
310
311
312  /* Zend_Pdf_Font */
313
314    /**
315     * The font name did not match any previously instantiated font and is not
316     * one of the standard 14 PDF fonts.
317     */
318    const BAD_FONT_NAME = 0x0601;
319
320    /**
321     * The factory method could not determine the type of the font file.
322     */
323    const CANT_DETERMINE_FONT_TYPE = 0x0602;
324
325
326  /* Text Layout System */
327
328    /**
329     * The specified attribute value for the text object cannot be used.
330     */
331    const BAD_ATTRIBUTE_VALUE = 0x0701;
332
333
334  /* Zend_Pdf_Image and Subclasses */
335
336    const CANT_DETERMINE_IMAGE_TYPE = 0x0801;
337    const WRONG_IMAGE_TYPE = 0x0802;
338    const UNSUPPORTED_IMAGE_ENCODING_OPTIONS = 0x0803;
339    const IMAGE_FILE_CORRUPT = 0x0804;
340
341
342}
343