This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
/
NKDEAN8Barcode.h
87 lines (76 loc) · 2.8 KB
/
NKDEAN8Barcode.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
// -----------------------------------------------------------------------------------
// NKDEAN8Barcode.h
// -----------------------------------------------------------------------------------
// Created by Jeff LaMarche on Wed May 29 2002.
// ©2002 Naked Software. All rights reserved.
// -----------------------------------------------------------------------------------
// THIS SOURCE CODE IS PROVIDED AS-IS WITH NO WARRANTY OF ANY KIND
// -----------------------------------------------------------------------------------
// You may use and redistribute this source code without limitation
// -----------------------------------------------------------------------------------
#import <Foundation/Foundation.h>
#import "NKDEAN13Barcode.h"
/*!
@header NKDEAN8Barcode.h
This subclass of NKDEAN13Barcode implements the abbreviated version of EAN.
*/
/*!
@class NKDEAN8Barcode
*/
@interface NKDEAN8Barcode : NKDEAN13Barcode
{
}
/*!
@method initWithContent: printsCaption:
@param inContent A string containing the data to be encoded; should use only <B>ASCII-8</B> characters
(those that can be encoded using a single char in UTF-8)
@param inPrints YES if caption should print.
@result Returns initialized NKDBarcode class
*/
-(id)initWithContent: (NSString *)inContent
printsCaption: (BOOL)inPrints;
/*!
@method barcode
@abstract Overridden to deal with various character parity options.
@result String of 0s and 1s that represent the encoded content, excluding initiator and terminator
*/
-(NSString *)barcode;
/*!
@method caption
@result String representing the encoded characters, formatted to appear correctly when drawn
*/
-(NSString *)caption;
/*!
@method isContentValid
@abstract Validates that this barcode supports the data it is encoding.
@discussion Enforces numerics only and length of content; does not validate check digit.
*/
-(BOOL) isContentValid;
/*!
@method generateChecksum
@abstract Overridden to generate EAN check digit
@discussion The algorithm is exactly the same as the UPC-A, except that we must take into
account the additional system digit.
*/
-(void)generateChecksum;
/*!
@method barBottom:
@abstract Overridden to specify that guard bars, terminator and initiator should extend down into the caption area
@param index The index of the bar that you want to find the bottom for (assuming origin at lower left) as an index of
completeBarcode
@result Bottom of the bar specified in inches * kScreenResolution
*/
-(float)barBottom:(int)index;
/*!
@method digitsToRight
@abstract Overridden to specify that no characters of the caption prints to the right of the barcode
@result 0
*/
-(int)digitsToRight;
/*!
@method digitsToLeft
@abstract Overridden to specify that no characters of the caption prints to the left of the barcode
@result 0
*/
-(int)digitsToLeft;
@end