JLChen
2021-05-18 a869383e163a18cdedcf587383c1eca043129754
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
 * Copyright 2012 ZXing authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
/**
 * Enumeration for DataMatrix symbol shape hint. It can be used to force square or rectangular
 * symbols.
 */
typedef enum {
  ZXDataMatrixSymbolShapeHintForceNone,
  ZXDataMatrixSymbolShapeHintForceSquare,
  ZXDataMatrixSymbolShapeHintForceRectangle
} ZXDataMatrixSymbolShapeHint;
 
typedef enum {
  ZXPDF417CompactionAuto,
  ZXPDF417CompactionText,
  ZXPDF417CompactionByte,
  ZXPDF417CompactionNumeric
} ZXPDF417Compaction;
 
@class ZXDimension, ZXPDF417Dimensions, ZXQRCodeErrorCorrectionLevel;
 
/**
 * These are a set of hints that you may pass to Writers to specify their behavior.
 */
@interface ZXEncodeHints : NSObject
 
+ (id)hints;
 
/**
 * Specifies what character encoding to use where applicable.
 */
@property (nonatomic, assign) NSStringEncoding encoding;
 
/**
 * Specifies the matrix shape for Data Matrix.
 */
@property (nonatomic, assign) ZXDataMatrixSymbolShapeHint dataMatrixShape;
 
/**
 * Specifies a minimum barcode size. Only applicable to Data Matrix now.
 *
 * @deprecated use width/height params in
 * ZXDataMatrixWriter encode:format:width:height:error:
 */
@property (nonatomic, strong) ZXDimension *minSize DEPRECATED_ATTRIBUTE;
 
/**
 * Specifies a maximum barcode size. Only applicable to Data Matrix now.
 *
 * @deprecated without replacement
 */
@property (nonatomic, strong) ZXDimension *maxSize DEPRECATED_ATTRIBUTE;
 
/**
 * Specifies what degree of error correction to use, for example in QR Codes.
 * For Aztec it represents the minimal percentage of error correction words.
 * Note: an Aztec symbol should have a minimum of 25% EC words.
 */
@property (nonatomic, strong) ZXQRCodeErrorCorrectionLevel *errorCorrectionLevel;
 
/**
 * Specifies what percent of error correction to use.
 * For Aztec it represents the minimal percentage of error correction words.
 * Note: an Aztec symbol should have a minimum of 25% EC words.
 */
@property (nonatomic, strong) NSNumber *errorCorrectionPercent;
 
/**
 * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
 * by format; for example it controls margin before and after the barcode horizontally for
 * most 1D formats.
 */
@property (nonatomic, strong) NSNumber *margin;
 
/**
 * Specifies whether to use compact mode for PDF417.
 */
@property (nonatomic, assign) BOOL pdf417Compact;
 
/**
 * Specifies what compaction mode to use for PDF417.
 */
@property (nonatomic, assign) ZXPDF417Compaction pdf417Compaction;
 
/**
 * Specifies the minimum and maximum number of rows and columns for PDF417.
 */
@property (nonatomic, strong) ZXPDF417Dimensions *pdf417Dimensions;
 
/**
 * Specifies the required number of layers for an Aztec code:
 *   a negative number (-1, -2, -3, -4) specifies a compact Aztec code
 *   0 indicates to use the minimum number of layers (the default)
 *   a positive number (1, 2, .. 32) specifies a normaol (non-compact) Aztec code
 */
@property (nonatomic, strong) NSNumber *aztecLayers;
 
@end