Issue 505
[zxing.git] / cpp / core / src / zxing / DecodeHints.h
1 #ifndef __DECODEHINTS_H_
2 #define __DECODEHINTS_H_
3 /*
4  *  DecodeHintType.h
5  *  zxing
6  *
7  *  Copyright 2010 ZXing authors All rights reserved.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21
22 #include <zxing/BarcodeFormat.h>
23 #include <zxing/ResultPointCallback.h>
24
25 namespace zxing {
26
27 typedef unsigned int DecodeHintType;
28
29 class DecodeHints {
30
31  private:
32
33   static const DecodeHintType BARCODEFORMAT_QR_CODE_HINT = 1 << BarcodeFormat_QR_CODE;
34   static const DecodeHintType BARCODEFORMAT_DATA_MATRIX_HINT = 1 << BarcodeFormat_DATA_MATRIX;
35   static const DecodeHintType BARCODEFORMAT_UPC_E_HINT = 1 << BarcodeFormat_UPC_E;
36   static const DecodeHintType BARCODEFORMAT_UPC_A_HINT = 1 << BarcodeFormat_UPC_A;
37   static const DecodeHintType BARCODEFORMAT_EAN_8_HINT = 1 << BarcodeFormat_EAN_8;
38   static const DecodeHintType BARCODEFORMAT_EAN_13_HINT = 1 << BarcodeFormat_EAN_13;
39   static const DecodeHintType BARCODEFORMAT_CODE_128_HINT = 1 << BarcodeFormat_CODE_128;
40   static const DecodeHintType BARCODEFORMAT_CODE_39_HINT = 1 << BarcodeFormat_CODE_39;
41   static const DecodeHintType BARCODEFORMAT_ITF_HINT = 1 << BarcodeFormat_ITF;
42   static const DecodeHintType TRYHARDER_HINT = 1 << 31;
43
44   DecodeHintType hints;
45
46   Ref<ResultPointCallback> callback;
47
48  public:
49
50   static const DecodeHints PRODUCT_HINT;
51   static const DecodeHints ONED_HINT;
52   static const DecodeHints DEFAULT_HINT;
53
54   DecodeHints();
55   DecodeHints(DecodeHintType init);
56
57   void addFormat(BarcodeFormat toadd);
58   bool containsFormat(BarcodeFormat tocheck) const;
59   void setTryHarder(bool toset);
60   bool getTryHarder() const;
61
62   void setResultPointCallback(Ref<ResultPointCallback> const&);
63   Ref<ResultPointCallback> getResultPointCallback() const;
64
65 };
66
67 }
68
69 #endif