1 /*
2  * Copyright 2008 ZXing authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package com.google.zxing;
18
19 /**
20  * These are a set of hints that you may pass to Writers to specify their behavior.
21  *
22  * @author dswitkin@google.com (Daniel Switkin)
23  */

24 public enum EncodeHintType {
25
26   /**
27    * Specifies what degree of error correction to use, for example in QR Codes.
28    * Type depends on the encoder. For example for QR codes it's type
29    * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
30    * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
31    * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
32    * In all cases, it can also be a {@link String} representation of the desired value as well.
33    * Note: an Aztec symbol should have a minimum of 25% EC words.
34    */

35   ERROR_CORRECTION,
36
37   /**
38    * Specifies what character encoding to use where applicable (type {@link String})
39    */

40   CHARACTER_SET,
41
42   /**
43    * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
44    */

45   DATA_MATRIX_SHAPE,
46
47   /**
48    * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false" 
49    * {@link String } value).
50    * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
51    * character set via ECIs.
52    * Please note that in that case, the most compact character encoding is chosen for characters in
53    * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
54    * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
55    * means of the {@link #CHARACTER_SET} encoding hint.
56    * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
57    * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
58    * for the purpose of delimiting AIs.
59    * This option and {@link #FORCE_C40} are mutually exclusive.
60    */

61   DATA_MATRIX_COMPACT,
62
63   /**
64    * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
65    *
66    * @deprecated use width/height params in
67    * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, intint)}
68    */

69   @Deprecated
70   MIN_SIZE,
71
72   /**
73    * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
74    *
75    * @deprecated without replacement
76    */

77   @Deprecated
78   MAX_SIZE,
79
80   /**
81    * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
82    * by format; for example it controls margin before and after the barcode horizontally for
83    * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
84    */

85   MARGIN,
86
87   /**
88    * Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or "true" or "false"
89    * {@link String} value).
90    */

91   PDF417_COMPACT,
92
93   /**
94    * Specifies what compaction mode to use for PDF417 (type
95    * {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its
96    * enum values).
97    */

98   PDF417_COMPACTION,
99
100   /**
101    * Specifies the minimum and maximum number of rows and columns for PDF417 (type
102    * {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
103    */

104   PDF417_DIMENSIONS,
105
106   /**
107    * Specifies whether to automatically insert ECIs when encoding PDF417 (type {@link Boolean}, or "true" or "false"
108    * {@link String} value). 
109    * Please note that in that case, the most compact character encoding is chosen for characters in
110    * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
111    * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
112    * means of the {@link #CHARACTER_SET} encoding hint.
113    */

114   PDF417_AUTO_ECI,
115
116   /**
117    * Specifies the required number of layers for an Aztec code.
118    * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
119    * 0 indicates to use the minimum number of layers (the default).
120    * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
121    * (Type {@link Integer}, or {@link String} representation of the integer value).
122    */

123    AZTEC_LAYERS,
124
125    /**
126     * Specifies the exact version of QR code to be encoded.
127     * (Type {@link Integer}, or {@link String} representation of the integer value).
128     */

129    QR_VERSION,
130
131   /**
132    * Specifies the QR code mask pattern to be used. Allowed values are
133    * 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select
134    * the optimal mask pattern.
135    * * (Type {@link Integer}, or {@link String} representation of the integer value).
136    */

137   QR_MASK_PATTERN,
138
139
140   /**
141    * Specifies whether to use compact mode for QR code (type {@link Boolean}, or "true" or "false"
142    * {@link String } value).
143    * Please note that when compaction is performed, the most compact character encoding is chosen
144    * for characters in the input that are not in the ISO-8859-1 character set. Based on experience,
145    * some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can
146    * be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
147    */

148   QR_COMPACT,
149
150   /**
151    * Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or "true" or "false"
152    * {@link String } value).
153    */

154   GS1_FORMAT,
155
156   /**
157    * Forces which encoding will be used. Currently only used for Code-128 code sets (Type {@link String}).
158    * Valid values are "A""B""C".
159    * This option and {@link #CODE128_COMPACT} are mutually exclusive.
160    */

161   FORCE_CODE_SET,
162
163   /**
164    * Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This 
165    * option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
166    */

167   FORCE_C40,
168
169   /**
170    * Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or "true" or "false" 
171    * {@link String } value).
172    * This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually
173    * exclusive.
174    */

175   CODE128_COMPACT,
176
177 }
178