1 | <?php |
||
209 | class BarcodeObject { |
||
210 | /** |
||
211 | * @var Image width in pixels. |
||
212 | * @access protected |
||
213 | */ |
||
214 | var $mWidth; |
||
215 | |||
216 | /** |
||
217 | * @var Image height in pixels. |
||
218 | * @access protected |
||
219 | */ |
||
220 | var $mHeight; |
||
221 | |||
222 | /** |
||
223 | * @var Numeric code for Barcode style. |
||
224 | * @access protected |
||
225 | */ |
||
226 | var $mStyle; |
||
227 | |||
228 | /** |
||
229 | * @var Background color. |
||
230 | * @access protected |
||
231 | */ |
||
232 | var $mBgcolor; |
||
233 | |||
234 | /** |
||
235 | * @var Brush color. |
||
236 | * @access protected |
||
237 | */ |
||
238 | var $mBrush; |
||
239 | |||
240 | /** |
||
241 | * @var Image object. |
||
242 | * @access protected |
||
243 | */ |
||
244 | var $mImg; |
||
245 | |||
246 | /** |
||
247 | * @var Numeric code for character font. |
||
248 | * @access protected |
||
249 | */ |
||
250 | var $mFont; |
||
251 | |||
252 | /** |
||
253 | * @var Error message. |
||
254 | * @access protected |
||
255 | */ |
||
256 | var $mError; |
||
257 | |||
258 | /** |
||
259 | * @var Character Set. |
||
260 | * @access protected |
||
261 | */ |
||
262 | var $mCharSet; |
||
263 | |||
264 | /** |
||
265 | * @var Allowed symbols. |
||
266 | * @access protected |
||
267 | */ |
||
268 | var $mChars; |
||
269 | |||
270 | /** |
||
271 | * Class Constructor. |
||
272 | * @param int $Width Image width in pixels. |
||
273 | * @param int $Height Image height in pixels. |
||
274 | * @param int $Style Barcode style. |
||
275 | */ |
||
276 | function BarcodeObject($Width=BCD_DEFAULT_WIDTH, $Height=BCD_DEFAULT_HEIGHT, $Style=BCD_DEFAULT_STYLE) { |
||
292 | |||
293 | /** |
||
294 | * Returns the image object. |
||
295 | * @return object image. |
||
296 | * @author Nicola Asuni |
||
297 | * @since 1.5.2 |
||
298 | */ |
||
299 | function getImage() { |
||
302 | |||
303 | /** |
||
304 | * Abstract method used to draw the barcode image. |
||
305 | * @param int $xres Horizontal resolution. |
||
306 | */ |
||
307 | function DrawObject($xres) { |
||
311 | |||
312 | /** |
||
313 | * Draws the barcode border. |
||
314 | * @access protected |
||
315 | */ |
||
316 | function DrawBorder() { |
||
319 | |||
320 | /** |
||
321 | * Draws the alphanumeric code. |
||
322 | * @param int $Font Font type. |
||
323 | * @param int $xPos Horiziontal position. |
||
324 | * @param int $yPos Vertical position. |
||
325 | * @param int $Char Alphanumeric code to write. |
||
326 | * @access protected |
||
327 | */ |
||
328 | function DrawChar($Font, $xPos, $yPos, $Char) { |
||
331 | |||
332 | /** |
||
333 | * Draws a character string. |
||
334 | * @param int $Font Font type. |
||
335 | * @param int $xPos Horiziontal position. |
||
336 | * @param int $yPos Vertical position. |
||
337 | * @param int $Char string to write. |
||
338 | * @access protected |
||
339 | */ |
||
340 | function DrawText($Font, $xPos, $yPos, $Char) { |
||
343 | |||
344 | /** |
||
345 | * Draws a single barcode bar. |
||
346 | * @param int $xPos Horiziontal position. |
||
347 | * @param int $yPos Vertical position. |
||
348 | * @param int $xSize Horizontal size. |
||
349 | * @param int $xSize Vertical size. |
||
350 | * @return bool trur in case of success, false otherwise. |
||
351 | * @access protected |
||
352 | */ |
||
353 | function DrawSingleBar($xPos, $yPos, $xSize, $ySize) { |
||
363 | |||
364 | /** |
||
365 | * Returns the current error message. |
||
366 | * @return string error message. |
||
367 | */ |
||
368 | function GetError() { |
||
371 | |||
372 | /** |
||
373 | * Returns the font height. |
||
374 | * @param int $font font type. |
||
375 | * @return int font height. |
||
376 | */ |
||
377 | function GetFontHeight($font) { |
||
380 | |||
381 | /** |
||
382 | * Returns the font width. |
||
383 | * @param int $font font type. |
||
384 | * @return int font width. |
||
385 | */ |
||
386 | function GetFontWidth($font) { |
||
389 | |||
390 | /** |
||
391 | * Set font type. |
||
392 | * @param int $font font type. |
||
393 | */ |
||
394 | function SetFont($font) { |
||
397 | |||
398 | /** |
||
399 | * Returns barcode style. |
||
400 | * @return int barcode style. |
||
401 | */ |
||
402 | function GetStyle() { |
||
405 | |||
406 | /** |
||
407 | * Set barcode style. |
||
408 | * @param int $Style barcode style. |
||
409 | */ |
||
410 | function SetStyle ($Style) { |
||
413 | |||
414 | /** |
||
415 | * Flush the barcode image. |
||
416 | */ |
||
417 | function FlushObject() { |
||
429 | |||
430 | /** |
||
431 | * Destroy the barcode image. |
||
432 | */ |
||
433 | function DestroyObject() { |
||
436 | } |
||
437 | |||
441 | ?> |
||
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.