BCKCoding Protocol Reference
| Conforms to | NSObject |
| Declared in | BCKCode.h |
Tasks
Other Methods
-
codeCharactersproperty required method -
+ barcodeStandardrequired method -
+ barcodeDescriptionrequired method -
+ canEncodeContent:error:required method -
– captionTextForZone:withRenderOptions:
Creating Barcodes
Configuring barcodes
-
– horizontalQuietZoneWidth -
– aspectRatio -
– fixedHeight -
– markerBarsCanOverlapBottomCaption -
– allowsFillingOfEmptyQuietZones -
– defaultCaptionFontName -
– showCheckDigitsInCaption
Deprecated Methods
Properties
codeCharacters
The array of individual code characters the barcode comprises. When subclassing BCKCode this array of BCKCodeCharacter instances make up the bit string representation of the barcode content string. Defaults to nil.
@property (nonatomic, readonly) NSArray *codeCharactersDeclared In
BCKCode.hClass Methods
barcodeDescription
Human readable description of the barcode class. For example “EAN-8”. Defaults to nil.
+ (NSString *)barcodeDescriptionDeclared In
BCKCode.hbarcodeStandard
The barcode class' standard. For example “International standard ISO/IEC 15420”. Defaults to nil.
+ (NSString *)barcodeStandardDeclared In
BCKCode.hcanEncodeContent:error:
Checks if the content string is encodable by the BCKCode subclass. Defaults to NO.
+ (BOOL)canEncodeContent:(NSString *)content error:(NSError **)errorParameters
- content
The content string to be encoded by the BCKCode subclass. Any check digits will be generated by the subclass and should not be included in the content string.
- error
Optional output parameter providing an
NSErrorin case the content string cannot be encoded by the BCKCode subclass.
Return Value
YES if the content string is encodable, in which case the error object is set to nil. NO if the contents can not be encoded, in which case the error object contains error information.
Declared In
BCKCode.hInstance Methods
allowsFillingOfEmptyQuietZones
Whether the barcode allows for quite zones to be filled with angle brackets. If YES, then quiet zones are filled if the BCKCodeDrawingFillEmptyQuietZonesOption is specified. Defaults to NO.
- (BOOL)allowsFillingOfEmptyQuietZonesDeclared In
BCKCode.haspectRatio
The aspect ratio between the length and width of the rendered barcode. Defaults to 1.
- (CGFloat)aspectRatioDeclared In
BCKCode.hcaptionTextForZone:withRenderOptions:
The caption text to display in the given caption zone. If you return nil then the digits are taken from
- (NSString *)captionTextForZone:(BCKCodeDrawingCaption)captionZone withRenderOptions:(NSDictionary *)optionsParameters
- captionZone
The BCKCodeDrawingCaption zone specifying the required text zone.
- options
The rendering options.
Return Value
The caption text to display in this zone, or nil for no caption text.
Discussion
Note: Not implementing this method disables caption drawing altogether
Declared In
BCKCode.hdefaultCaptionFontName
The font used for text captions if no other font is specified via BCKCodeDrawingCaptionFontNameOption. Defaults to Helvetica.
- (NSString *)defaultCaptionFontNameDeclared In
BCKCode.hfixedHeight
The fixed height of the rendered barcode. Defaults to 0 to indicate there is no fixed height.
- (CGFloat)fixedHeightDeclared In
BCKCode.hhorizontalQuietZoneWidth
The width of the horizontal quiet zone (in bar units) on the left and right sides of the barcode. Defaults to 0 to indicate there are no horizontal quiet zones.
- (NSUInteger)horizontalQuietZoneWidthDeclared In
BCKCode.hinitWithContent:
Root initializer for sub-classes of the BCKCode class cluster. You should not call this on BCKCode directly, but always on concrete subclasses based on the kind of code you want to generate.
- (instancetype)initWithContent:(NSString *)contentParameters
- content
The content string for the barcode.
Return Value
The requested BCKCode subclass. Returns nil if the content string cannot be encoded using the requested BCKCode subclass.
Discussion
Warning: This method is deprecated, use - [BCKCode initWithContent:error:] instead.
Declared In
BCKCode.hinitWithContent:error:
Root initializer for subclasses of the BCKCode class cluster. You should not call this on BCKCode directly. Always use a concrete subclass depending on the kind of barcode you want to generate. The initializer copies the content string to the _content ivar. Subclasses only need to override this initializer if they add additional properties. This initialiser calls the subclass' canEncodeContent method to determine whether the content string can be encoded.
- (instancetype)initWithContent:(NSString *)content error:(NSError **)errorParameters
- content
The content string to be encoded by the subclass.
- error
Optional output parameter to take an
NSErrorin case the content cannot be encoded by this barcode class. Passnilif not error information is not required.
Return Value
The requested BCKCode subclass. Returns nil if the provided content cannot be encoded by the requested BCKCode subclass, the error object will then contain error details.
Declared In
BCKCode.hmarkerBarsCanOverlapBottomCaption
Whether the subclass allows for marker bars to extend into the bottom caption region. If YES, then the percentage of overlap can be specified with the BCKCodeDrawingMarkerBarsOverlapCaptionPercentOption. Defaults to NO.
- (BOOL)markerBarsCanOverlapBottomCaptionDeclared In
BCKCode.hshowCheckDigitsInCaption
Whether the barcode includes check digits in the caption printed below the barcode. By default any check digits that are NOT markers ARE included in the caption text. Subclasses can indicate support for excluding check digits from the caption by overriding this method and returning YES. Defaults to NO.
- (BOOL)showCheckDigitsInCaptionDeclared In
BCKCode.h